scip-query 0.10.11 → 0.10.12

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 (276) hide show
  1. package/README.md +56 -35
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-2DOW7QCA.js +71 -0
  4. package/dist/chunk-2FMFF4RI.js +2 -0
  5. package/dist/{chunk-LSET2TXH.js → chunk-2GLNBCHB.js} +2 -2
  6. package/dist/chunk-2UVCH7CQ.js +2 -0
  7. package/dist/{chunk-LM5SHAN4.js → chunk-3XSNW5XB.js} +2 -2
  8. package/dist/chunk-4ISHQ7UW.js +35 -0
  9. package/dist/{chunk-BFXPG2VN.js → chunk-5GXTUANY.js} +2 -2
  10. package/dist/{chunk-FXNWFMKW.js → chunk-5JHEN5VN.js} +2 -2
  11. package/dist/chunk-62ULXMQ7.js +18 -0
  12. package/dist/chunk-63CI3IXR.js +102 -0
  13. package/dist/{chunk-P753MDDE.js → chunk-6BN3EHQE.js} +2 -2
  14. package/dist/chunk-7C6JBBE4.js +23 -0
  15. package/dist/chunk-7EK7OSWS.js +2 -0
  16. package/dist/chunk-7IWIMNHI.js +2 -0
  17. package/dist/chunk-7XTO4YXB.js +8 -0
  18. package/dist/{chunk-Z3YYR4OS.js → chunk-A4UTLKHU.js} +2 -2
  19. package/dist/{chunk-FDEQIPPK.js → chunk-ANUEY5WV.js} +2 -2
  20. package/dist/chunk-AOWFUGDL.js +2 -0
  21. package/dist/chunk-AREANYIA.js +3 -0
  22. package/dist/{chunk-6IR2AOBM.js → chunk-AZBELWZQ.js} +2 -2
  23. package/dist/{chunk-JME7OWD3.js → chunk-CXWCLVYL.js} +2 -2
  24. package/dist/chunk-CYHIKTJN.js +3 -0
  25. package/dist/{chunk-BVRS7RKQ.js → chunk-DDQONX6B.js} +2 -2
  26. package/dist/{chunk-IHUETYFW.js → chunk-DFSEARAU.js} +2 -2
  27. package/dist/{chunk-EY43NV4M.js → chunk-DQ6433ZG.js} +2 -2
  28. package/dist/chunk-DVFP6PZI.js +2 -0
  29. package/dist/chunk-E3ADDB43.js +2 -0
  30. package/dist/{chunk-YWOOQ4FF.js → chunk-ELC77ZDE.js} +1 -1
  31. package/dist/chunk-EOLGSSDR.js +2 -0
  32. package/dist/chunk-F6IXELII.js +20 -0
  33. package/dist/{chunk-QYB5P7GL.js → chunk-FMGVZBS2.js} +2 -2
  34. package/dist/{chunk-VOYOYC5T.js → chunk-FX6ULETZ.js} +2 -2
  35. package/dist/chunk-GG5LHT27.js +2 -0
  36. package/dist/chunk-GKB4JJDU.js +2 -0
  37. package/dist/chunk-H7JF2CKK.js +2 -0
  38. package/dist/chunk-HHOMJCP5.js +4 -0
  39. package/dist/chunk-HRDSU5FN.js +9 -0
  40. package/dist/{chunk-BZ53S4ZN.js → chunk-HWVYTJOV.js} +2 -2
  41. package/dist/chunk-JJ5SAWBT.js +2 -0
  42. package/dist/chunk-JNMLBL36.js +2 -0
  43. package/dist/chunk-JS6B76AQ.js +2 -0
  44. package/dist/{chunk-Z4HICZGY.js → chunk-KZ4MG5NY.js} +2 -2
  45. package/dist/{chunk-RNM6LMCF.js → chunk-L446VQYQ.js} +2 -2
  46. package/dist/{chunk-FFVIFETB.js → chunk-LDJUB7XW.js} +2 -2
  47. package/dist/{chunk-54KGX7EX.js → chunk-LEHVP4DY.js} +2 -2
  48. package/dist/chunk-MNCQPMCH.js +2 -0
  49. package/dist/chunk-MYTUWXHK.js +4 -0
  50. package/dist/chunk-N25HPUOK.js +2 -0
  51. package/dist/chunk-NABVR6B7.js +2 -0
  52. package/dist/{chunk-TK7O5ER5.js → chunk-NBNEVLRC.js} +2 -2
  53. package/dist/chunk-NTSR6SRP.js +2 -0
  54. package/dist/{chunk-7B6LP46R.js → chunk-OFXN2BCT.js} +2 -2
  55. package/dist/chunk-PWAK75BU.js +2 -0
  56. package/dist/chunk-Q5P7NOVM.js +2 -0
  57. package/dist/{chunk-G5UPYQGL.js → chunk-RGKRYO22.js} +4 -4
  58. package/dist/chunk-RM2WQ75T.js +2 -0
  59. package/dist/chunk-ROGZXWN2.js +2 -0
  60. package/dist/chunk-RSSXKJ6J.js +38 -0
  61. package/dist/chunk-RUV5IY25.js +7 -0
  62. package/dist/chunk-RVGEZYMQ.js +2 -0
  63. package/dist/{chunk-6LJHXREW.js → chunk-RXINFVBN.js} +2 -2
  64. package/dist/{chunk-YWYFU2V3.js → chunk-S2MRVIJ5.js} +2 -2
  65. package/dist/chunk-SA3DPTHT.js +7 -0
  66. package/dist/chunk-SGTKURU6.js +52 -0
  67. package/dist/chunk-SQNHOOJ5.js +3 -0
  68. package/dist/chunk-T3AEVJBG.js +4 -0
  69. package/dist/{chunk-NOJAM5ZV.js → chunk-T4N2ZRVY.js} +2 -2
  70. package/dist/{chunk-JATUZIEH.js → chunk-TBCHRDAC.js} +2 -2
  71. package/dist/chunk-THB6AM3V.js +11 -0
  72. package/dist/{chunk-TQ5W2H3S.js → chunk-ULHLDOD6.js} +1 -1
  73. package/dist/chunk-UQ73QF5D.js +43 -0
  74. package/dist/chunk-UVPY3RUZ.js +2 -0
  75. package/dist/chunk-V5FGK3DZ.js +2 -0
  76. package/dist/{chunk-ZQDIXAF5.js → chunk-VB2EZZPA.js} +2 -2
  77. package/dist/{chunk-7TWLSZK5.js → chunk-WTY5FERW.js} +2 -2
  78. package/dist/chunk-WUOB4DHH.js +6 -0
  79. package/dist/chunk-XHMVZFA6.js +2 -0
  80. package/dist/chunk-XRUGSM76.js +10 -0
  81. package/dist/{chunk-BASVXNY3.js → chunk-XUCZ3RQ5.js} +2 -2
  82. package/dist/chunk-YFQIKYOP.js +2 -0
  83. package/dist/chunk-Z2LDWIJV.js +5 -0
  84. package/dist/chunk-ZNWWVYQL.js +3 -0
  85. package/dist/{chunk-FKCGBZAC.js → chunk-ZUUNREKS.js} +2 -2
  86. package/dist/cli.js +238 -216
  87. package/dist/{config-types-BDIWAYzr.d.ts → config-types-dvHOz0zU.d.ts} +4 -1
  88. package/dist/{db-Djj3Nqrb.d.ts → db-rMZO5JFK.d.ts} +1 -1
  89. package/dist/{health-D5J42g4D.d.ts → health-CtTIGh6H.d.ts} +1 -1
  90. package/dist/index.d.ts +9 -5
  91. package/dist/index.js +2 -2
  92. package/dist/queries/affected.d.ts +2 -2
  93. package/dist/queries/affected.js +1 -1
  94. package/dist/queries/bottlenecks.d.ts +2 -2
  95. package/dist/queries/bottlenecks.js +1 -1
  96. package/dist/queries/by-kind.d.ts +2 -2
  97. package/dist/queries/by-kind.js +1 -1
  98. package/dist/queries/call-graph.d.ts +2 -2
  99. package/dist/queries/call-graph.js +1 -1
  100. package/dist/queries/change-surface.d.ts +2 -2
  101. package/dist/queries/change-surface.js +1 -1
  102. package/dist/queries/cleanup-plan.d.ts +2 -2
  103. package/dist/queries/cleanup-plan.js +1 -1
  104. package/dist/queries/co-change.d.ts +2 -2
  105. package/dist/queries/co-change.js +1 -1
  106. package/dist/queries/code.d.ts +2 -2
  107. package/dist/queries/code.js +1 -1
  108. package/dist/queries/complexity-hotspots.d.ts +2 -2
  109. package/dist/queries/complexity-hotspots.js +1 -1
  110. package/dist/queries/complexity.d.ts +2 -2
  111. package/dist/queries/complexity.js +1 -1
  112. package/dist/queries/convergence.d.ts +2 -2
  113. package/dist/queries/convergence.js +1 -1
  114. package/dist/queries/coupling.d.ts +2 -2
  115. package/dist/queries/coupling.js +1 -1
  116. package/dist/queries/cycles.d.ts +2 -2
  117. package/dist/queries/cycles.js +1 -1
  118. package/dist/queries/dataflow.d.ts +2 -2
  119. package/dist/queries/dataflow.js +1 -1
  120. package/dist/queries/dead.d.ts +2 -2
  121. package/dist/queries/dead.js +1 -1
  122. package/dist/queries/deep-chains.d.ts +2 -2
  123. package/dist/queries/deep-chains.js +1 -1
  124. package/dist/queries/deps.d.ts +2 -2
  125. package/dist/queries/deps.js +1 -1
  126. package/dist/queries/diff-gate.d.ts +2 -2
  127. package/dist/queries/diff-gate.js +1 -1
  128. package/dist/queries/diff-impact.d.ts +2 -2
  129. package/dist/queries/diff-impact.js +1 -1
  130. package/dist/queries/doc-drift.d.ts +2 -2
  131. package/dist/queries/doc-drift.js +1 -1
  132. package/dist/queries/drift.d.ts +2 -2
  133. package/dist/queries/drift.js +1 -1
  134. package/dist/queries/extract-candidates.d.ts +2 -2
  135. package/dist/queries/extract-candidates.js +1 -1
  136. package/dist/queries/fan.d.ts +2 -2
  137. package/dist/queries/fan.js +1 -1
  138. package/dist/queries/files.d.ts +2 -2
  139. package/dist/queries/health.d.ts +3 -3
  140. package/dist/queries/health.js +1 -1
  141. package/dist/queries/hierarchy.d.ts +2 -2
  142. package/dist/queries/hierarchy.js +1 -1
  143. package/dist/queries/hotspots.d.ts +2 -2
  144. package/dist/queries/hotspots.js +1 -1
  145. package/dist/queries/imports.d.ts +2 -2
  146. package/dist/queries/imports.js +1 -1
  147. package/dist/queries/incomplete-migration.d.ts +2 -2
  148. package/dist/queries/incomplete-migration.js +1 -1
  149. package/dist/queries/index.d.ts +3 -3
  150. package/dist/queries/index.js +1 -1
  151. package/dist/queries/isolated.d.ts +2 -2
  152. package/dist/queries/isolated.js +1 -1
  153. package/dist/queries/locality-candidates.d.ts +2 -2
  154. package/dist/queries/locality-candidates.js +1 -1
  155. package/dist/queries/members.d.ts +2 -2
  156. package/dist/queries/members.js +1 -1
  157. package/dist/queries/methods.d.ts +2 -2
  158. package/dist/queries/methods.js +1 -1
  159. package/dist/queries/outline.d.ts +2 -2
  160. package/dist/queries/outline.js +1 -1
  161. package/dist/queries/passthrough-candidates.d.ts +2 -2
  162. package/dist/queries/passthrough-candidates.js +1 -1
  163. package/dist/queries/plan-context.d.ts +2 -2
  164. package/dist/queries/plan-context.js +1 -1
  165. package/dist/queries/react-component-duplicates.d.ts +2 -2
  166. package/dist/queries/react-component-duplicates.js +1 -1
  167. package/dist/queries/react-hook-candidates.d.ts +2 -2
  168. package/dist/queries/react-hook-candidates.js +1 -1
  169. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  170. package/dist/queries/react-large-component-pressure.js +1 -1
  171. package/dist/queries/recent-duplicates.d.ts +2 -2
  172. package/dist/queries/recent-duplicates.js +1 -1
  173. package/dist/queries/redundant-reexports.d.ts +2 -2
  174. package/dist/queries/redundant-reexports.js +1 -1
  175. package/dist/queries/refs.d.ts +2 -2
  176. package/dist/queries/refs.js +1 -1
  177. package/dist/queries/self-audit.d.ts +7 -4
  178. package/dist/queries/self-audit.js +1 -1
  179. package/dist/queries/similar-chains.d.ts +2 -2
  180. package/dist/queries/similar-chains.js +1 -1
  181. package/dist/queries/similar-files.d.ts +2 -2
  182. package/dist/queries/similar-files.js +1 -1
  183. package/dist/queries/similar-signatures.d.ts +2 -2
  184. package/dist/queries/similar-signatures.js +1 -1
  185. package/dist/queries/similar.d.ts +46 -17
  186. package/dist/queries/similar.js +1 -1
  187. package/dist/queries/slice.d.ts +2 -2
  188. package/dist/queries/slice.js +1 -1
  189. package/dist/queries/stale-abstractions.d.ts +2 -2
  190. package/dist/queries/stale-abstractions.js +1 -1
  191. package/dist/queries/stats.d.ts +2 -2
  192. package/dist/queries/surface.d.ts +2 -2
  193. package/dist/queries/surface.js +1 -1
  194. package/dist/queries/symbols.d.ts +2 -2
  195. package/dist/queries/symbols.js +1 -1
  196. package/dist/queries/system.d.ts +2 -2
  197. package/dist/queries/system.js +1 -1
  198. package/dist/queries/trace.d.ts +2 -2
  199. package/dist/queries/trace.js +1 -1
  200. package/dist/queries/unused-imports.d.ts +2 -2
  201. package/dist/queries/unused-imports.js +1 -1
  202. package/dist/queries/unused-params.d.ts +2 -2
  203. package/dist/queries/unused-params.js +1 -1
  204. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  205. package/dist/queries/vue-component-duplicates.js +1 -1
  206. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  207. package/dist/queries/vue-composable-candidates.js +1 -1
  208. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  209. package/dist/queries/vue-large-view-pressure.js +1 -1
  210. package/dist/queries/wrapper-candidates.d.ts +2 -2
  211. package/dist/queries/wrapper-candidates.js +1 -1
  212. package/dist/reindex-worker.js +9 -9
  213. package/dist/reindex.d.ts +30 -4
  214. package/dist/reindex.js +19 -19
  215. package/dist/runtime.d.ts +4 -3
  216. package/dist/runtime.js +2 -2
  217. package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-trnNvymv.d.ts} +1 -1
  218. package/docs/COMMAND_REFERENCE.md +1 -1
  219. package/docs/analyzer-inventory.md +8 -0
  220. package/docs/analyzer-validation-ledger.md +7 -0
  221. package/package.json +3 -1
  222. package/scripts/evidence-product-contract.mjs +197 -0
  223. package/dist/chunk-2KHTSEIL.js +0 -102
  224. package/dist/chunk-3VD3JMK2.js +0 -2
  225. package/dist/chunk-4UZO3XCV.js +0 -35
  226. package/dist/chunk-5GOLFJEO.js +0 -8
  227. package/dist/chunk-5OST6GYB.js +0 -2
  228. package/dist/chunk-65AU3HFZ.js +0 -2
  229. package/dist/chunk-6GN7FXCH.js +0 -2
  230. package/dist/chunk-6JRV4MY2.js +0 -23
  231. package/dist/chunk-6QSOCTZT.js +0 -18
  232. package/dist/chunk-72KY2ZFO.js +0 -2
  233. package/dist/chunk-7GO4EQF5.js +0 -2
  234. package/dist/chunk-7IVSJJZU.js +0 -7
  235. package/dist/chunk-A536TEU4.js +0 -3
  236. package/dist/chunk-AVWPHM2Q.js +0 -4
  237. package/dist/chunk-BSN22NRK.js +0 -9
  238. package/dist/chunk-C5CTSJ6X.js +0 -6
  239. package/dist/chunk-CO5GJRP7.js +0 -2
  240. package/dist/chunk-CW5YFOCP.js +0 -5
  241. package/dist/chunk-DS6QEB3G.js +0 -5
  242. package/dist/chunk-E35O7UCB.js +0 -2
  243. package/dist/chunk-EXDQ35NN.js +0 -2
  244. package/dist/chunk-FAYI6KZ5.js +0 -2
  245. package/dist/chunk-FG4NT6VY.js +0 -2
  246. package/dist/chunk-GQBMH2TQ.js +0 -2
  247. package/dist/chunk-GRJY65YT.js +0 -2
  248. package/dist/chunk-HF25DFSC.js +0 -3
  249. package/dist/chunk-HHN2B5KA.js +0 -2
  250. package/dist/chunk-JCLDUKT6.js +0 -38
  251. package/dist/chunk-JGN2ZFJR.js +0 -2
  252. package/dist/chunk-JM72FNGA.js +0 -2
  253. package/dist/chunk-KDFONWTW.js +0 -40
  254. package/dist/chunk-LPL4MA6R.js +0 -2
  255. package/dist/chunk-LZHUWKGD.js +0 -2
  256. package/dist/chunk-M4COR2H6.js +0 -2
  257. package/dist/chunk-O6ZH6C6Y.js +0 -2
  258. package/dist/chunk-OBGRLXWF.js +0 -3
  259. package/dist/chunk-OLTESY4K.js +0 -3
  260. package/dist/chunk-P4KYUPBD.js +0 -4
  261. package/dist/chunk-P5RYBRIO.js +0 -4
  262. package/dist/chunk-P7AL7Y37.js +0 -2
  263. package/dist/chunk-PFOCOG57.js +0 -2
  264. package/dist/chunk-QLAUCRDJ.js +0 -2
  265. package/dist/chunk-QPU7EXAW.js +0 -2
  266. package/dist/chunk-RVWSAMTT.js +0 -2
  267. package/dist/chunk-USPV3T5K.js +0 -2
  268. package/dist/chunk-VCQYSG2M.js +0 -10
  269. package/dist/chunk-VUKC6F77.js +0 -20
  270. package/dist/chunk-W2CBNBEL.js +0 -71
  271. package/dist/chunk-W6BVEKYC.js +0 -3
  272. package/dist/chunk-WUCEKFQC.js +0 -3
  273. package/dist/chunk-XUGQU7PM.js +0 -41
  274. package/dist/chunk-Y5NBHMQX.js +0 -2
  275. package/dist/chunk-YCOFCT4B.js +0 -2
  276. package/dist/chunk-YZA6PPZL.js +0 -3
@@ -1,2 +0,0 @@
1
- import{a as A}from"./chunk-GRJY65YT.js";import{a as C}from"./chunk-5OST6GYB.js";import{a as k}from"./chunk-TK7O5ER5.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as f}from"path";var j=20,z=1,_=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),G=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),O=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function De(e,n={}){let t=L(n.limit,j),i=L(n.minConsumers,z),o=new C(e),s=o.fileDependencyGraph(n.scope),r=de(p(e,{includeIgnored:!1})),c=fe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?q(e,o,n.target):Y(e,n.scope,n.scanLimit)).map(a=>K(o,s,a,n,r,c)).filter(a=>a.consumerFiles.length>=i||n.target).sort(ue).slice(0,t)}function q(e,n,t){let i=V(e,t);if(i)return[N(i)];let o=k(e,t);if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(r=>r.symbolId===o.symbolId);return s?[X(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:b(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function Y(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),o=L(t,i.length);return i.slice(0,o).map(s=>N(s))}function K(e,n,t,i,o,s){let r=t.definition?J(e,t.definition,i.semantic):Q(n,t.unit.file),c=t.definition?r.length>0?"exact":"none":r.length>0?"file-level":"none",m=t.unit.file,l=u(f.dirname(m)),a=ee(r),h=Z(l),B=w([...F(l),...a?F(a):[]]),y=ne(t.unit,l,a,r),g=te(y,t.unit,l,a,r,o,s),E=ae(t.unit,c,a,r,l,g.whyNoSuggestedHome),W=ce(t.unit,l,a,r,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:t.unit,candidatePath:m,currentDirectory:l,directoryAncestry:h,consumerFiles:r,consumerCoverage:c,nearestCommonOwner:a,boundaryMarkers:B,recommendedTier:y,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:E,reasons:W,recommendation:le(y,g.suggestedHome,c)}}function J(e,n,t){let i=A(e,[n],{semantic:t!==!1,sourceFallback:!0});return H(i.get(n.symbolId)??[])}function Q(e,n){let t=[];for(let[i,o]of e.entries())i!==n&&o.has(n)&&t.push(i);return H(t)}function V(e,n){let t=D(n),i=p(e,{includeIgnored:!1}),o=i.find(r=>r===t);if(o)return o;let s=i.find(r=>r.endsWith(`/${t}`));return s||(i.find(r=>r.includes(t))??null)}function X(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:b(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function N(e){return{unit:{kind:"file",file:e,shortName:f.basename(e)}}}function Z(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let o=t.slice(0,i+1).join("/");n.push({path:o,depth:i,markers:v(o)})}return n}function F(e){return e==="."?[]:I(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function v(e){return w(I(e).map(({marker:n})=>n))}function I(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let o=_.get(n[i]);o&&t.push({marker:o,prefix:n.slice(0,i+1).join("/")})}return t}function ee(e){if(e.length===0)return null;let n=e.map(i=>u(f.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let o=i.split("/").filter(Boolean),s=[],r=Math.min(t.length,o.length);for(let c=0;c<r&&t[c]===o[c];c+=1)s.push(t[c]);t=s}return t.length===0?".":t.join("/")}function ne(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":R(t,"package")?"package-level-shared":R(t,"app")?"app-level-shared":U(t,["feature","domain","module"])||U(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function te(e,n,t,i,o,s,r){let c=ie(e,i);if(c)return d(c);let m=me(n.file),l=re(e,t,m,o,r);if(l)return l;let a=i;if(u(t)===u(a))return d(`${t} is already the nearest common owner for its consumers.`);let h=oe(a,t,m,r);return h||se(a,t,m,s,r)}function ie(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function re(e,n,t,i,o){if(e==="same-file"){let s=i[0]??null;return s?S(s):d("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=u(f.dirname(i[0])),r=M(n,t,s,o);return r?d(r):S(s)}return null}function oe(e,n,t,i){return pe(e)?$(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function se(e,n,t,i,o){if(e===".")return d("The nearest common owner is the repository root.");let s=`${e}/shared`,r=$(s,n,t,o,`Proposed home ${s} is outside source root ${t}.`);return r.confidence==="withheld"||i.has(s)?r:d(`${s} does not exist in the indexed project.`)}function $(e,n,t,i,o){if(!P(e,t))return d(o);let s=M(n,t,e,i);return s?d(s):S(e)}function S(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function d(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ae(e,n,t,i,o,s){let r=["Report-only signal; review ownership before moving files."];return n==="none"&&r.push("No consumers were found in the current index."),n==="file-level"&&r.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&r.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&r.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&r.push("File targets describe module locality, not symbol-level usage."),t&&o.startsWith(`${t}/`)&&r.push("Candidate already lives under the nearest common owner."),s&&r.push(`No exact suggested home: ${s}`),r}function ce(e,n,t,i,o,s){let r=[];return r.push(`${e.shortName} currently lives in ${n}.`),t?r.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):r.push("No consumer owner could be inferred from the current index."),o?r.push(`Suggested home is ${o}.`):s&&r.push(`No exact suggested home: ${s}`),r}function le(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ue(e,n){return T(n)-T(e)||e.candidatePath.localeCompare(n.candidatePath)}function T(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n-=8),e.recommendedTier==="no-exact-consumers"&&(n-=12),n}function de(e){let n=new Set(["."]);for(let t of e){let i=u(f.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=u(f.dirname(i))}return n}function me(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function P(e,n){let t=u(e),i=u(n);return i==="."||t===i||t.startsWith(`${i}/`)}function ge(e,n,t){let i=x(e),o=x(n);return(P(e,n)?i.slice(o.length):i).some(r=>t.has(r.toLowerCase()))}function M(e,n,t,i){return u(e)===u(t)||!ge(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function fe(...e){let n=new Set(O);for(let t of e)for(let i of t??[]){let o=he(i);o&&n.add(o)}return n}function he(e){let n=e.trim().toLowerCase();return n===""?null:n}function R(e,n){return v(e).includes(n)}function U(e,n){let t=v(e);return n.some(i=>t.includes(i))}function pe(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?G.has(t):!1}function D(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function u(e){let n=D(e);return n===""?".":n}function x(e){let n=D(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{De as a};
2
- //# sourceMappingURL=chunk-CO5GJRP7.js.map
@@ -1,5 +0,0 @@
1
- import{a as ne,b as A,e as H,f as $,g as z,h as ie,i as te}from"./chunk-YWOOQ4FF.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as T}from"./chunk-5OST6GYB.js";import{a as ee}from"./chunk-JCLDUKT6.js";import{a as D,b as S}from"./chunk-TQ5W2H3S.js";import{a as U}from"./chunk-TK7O5ER5.js";import{c as L,d as G,g as P}from"./chunk-JM72FNGA.js";import{a as _,b as j}from"./chunk-DS6QEB3G.js";import{b as X,d as J,e as Q}from"./chunk-XUGQU7PM.js";import{a as Y}from"./chunk-64MNV6AB.js";import{d as E}from"./chunk-7S5E7KWT.js";function fn(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=Me(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!P(s.symbol))return[];if(s.callees.size===0)return re(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=ye(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):re(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function ye(e,n,t,i){let r=W(e,{minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=De(n,r),a=he(n,r),l=$(a),c=z(n.callees,a),m=[];for(let f of s){if(f.callees.size<3)continue;let d=z(f.callees,a),o=oe(n,f,a,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:l,magnitudeA:c,magnitudeB:d});o&&m.push(o)}return m.sort((f,d)=>d.similarity-f.similarity),m}function he(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return H(t,n.corpus.length+1)}function oe(e,n,t,i){let r=Ce(e,n,t,i);if(!ke(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=ue(c,"callees");return{symbolA:e.symbol,shortNameA:L(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:L(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(L),uniqueToA:[...A(e.callees,n.callees)].map(L),uniqueToB:[...A(n.callees,e.callees)].map(L),...m}}function Fe(e,n,t,i){let r=i.magnitudeA??z(e.callees,t),s=i.magnitudeB??z(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??$(t);for(let o of e.callees){if(!n.callees.has(o))continue;let g=t.get(o)??0;a+=g*g,c+=1,g>=m&&(l+=1)}if(c===0)return!1;let f=r*s;return(f>0?a/f:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Ce(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?ie(e.callees,n.callees,t,{medianIdf:i.medianIdf}):te(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function ke(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function gn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=D(),f=0,d=0,o=0,g=0,u=0,p=0,b=0;return S("similar.all",()=>{let y=W(e,{minCallees:s,scope:r,scanLimit:l,semantic:c}),C=y.corpus;f=C.length;let x=n.focusFiles,k=[],B=0;return S("similar.all.pair-scan",()=>{for(let F=0;F<C.length;F+=1){let h=C[F],I=x?.has(h.file)??!1,w=y.weightedMagnitudes[F],M=new Set;for(let N of h.callees){let R=y.candidateIndexesByCallee.get(N);if(R)for(let v of R)v<=F||x&&!I&&!x.has(C[v].file)||M.add(v)}m&&(o+=M.size,M.size>0&&(d+=1));for(let N of M){let R=C[N];if(a&&h.file===R.file){m&&(u+=1);continue}if(le(h,R)){m&&(p+=1);continue}m&&(g+=1);let v=oe(h,R,y.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:y.medianIdf,magnitudeA:w,magnitudeB:y.weightedMagnitudes[N]});v&&(xe(k,v,i,B),m&&(b+=1),B+=1)}}},()=>({corpusSize:f,candidateSets:d,candidatePairs:o,comparedPairs:g,crossFileSkips:u,signatureSkips:p,insertedResults:b,topResults:k.length})),S("similar.all.sort-project",()=>(k.sort((F,h)=>h.result.similarity-F.result.similarity||F.order-h.order),k.map(F=>F.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:f,candidateSets:d,candidatePairs:o,comparedPairs:g,crossFileSkips:u,signatureSkips:p,insertedResults:b}))}function pn(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=D(),m=0,f=0,d=0,o=0,g=0,u=0,p=0;return S("similar.all-count",()=>{let b=W(e,{minCallees:r,scope:i,scanLimit:a,semantic:l}),y=b.corpus;m=y.length;let C=n.focusFiles;return S("similar.all-count.pair-scan",()=>{for(let x=0;x<y.length;x+=1){let k=y[x],B=C?.has(k.file)??!1,F=b.weightedMagnitudes[x],h=new Set;for(let I of k.callees){let w=b.candidateIndexesByCallee.get(I);if(w)for(let M of w)M<=x||C&&!B&&!C.has(y[M].file)||h.add(M)}c&&(d+=h.size,h.size>0&&(f+=1));for(let I of h){let w=y[I];if(s&&k.file===w.file){c&&(g+=1);continue}if(le(k,w)){c&&(u+=1);continue}c&&(o+=1),Fe(k,w,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:F,magnitudeB:b.weightedMagnitudes[I]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:f,candidatePairs:d,comparedPairs:o,crossFileSkips:g,signatureSkips:u,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:f,candidatePairs:d,comparedPairs:o,crossFileSkips:g,signatureSkips:u,insertedResults:p}))}function le(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}function xe(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var we=["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 Me(e,n,t){let i=U(e,n);if(!i||!P(i.symbol))return null;let r=new T(e),s=ee(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:ce(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var Le=E("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Ie=E("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function Re(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=Le.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,f=0,d=0;return S("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=ze(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),f=o.length,r===void 0)return o;let g=o.filter(u=>u.symbol!==r);return d=o.length-g.length,g},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:f,excludeSymbol:r!==void 0,excludedSymbols:d}))}function W(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=Ie.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,f=0,d=0;return S("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=ve(Re(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,f=o.docFreq.size,d=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:f,candidateBuckets:d}))}function ve(e){let n=D(),t=0,i=S("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let g of e)for(let u of g.callees)o.set(u,(o.get(u)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=S("similar.callee-index.idf-weights",()=>H(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=S("similar.callee-index.weighted-magnitudes",()=>e.map(o=>z(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,f=S("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let g=0;g<e.length;g+=1){let u=e[g];for(let p of u.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let b=o.get(p);b||(b=[],o.set(p,b)),b.push(g),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),d=S("similar.callee-index.median-idf",()=>$(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:f,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:d,ubiquityThreshold:r}}function De(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function ze(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=D(),l=new T(e),c=0,m=S("similar.callee-fingerprints.candidates",()=>{let u=O(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=u.length,u},()=>({scope:i,scanLimit:r,candidateCount:c})),f=0,d=S("similar.callee-fingerprints.callee-map",()=>{let u=l.calleeMap(m,{semantic:s});if(a)for(let p of u.values())f+=p.length;return u},()=>({candidateCount:c,semantic:s,calleeEdges:f})),o=0,g=0;return S("similar.callee-fingerprints.shape",()=>{let u=m.map(p=>({symbol:p.symbol,file:p.relativePath,callees:ce((d.get(p.symbolId)??[]).map(b=>b.symbol)),paramCount:l.callableSignature(p)?.paramCount??-1})).filter(p=>p.callees.size>=t);return o=u.length,a&&(g=u.reduce((p,b)=>p+b.callees.size,0)),u},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:g,minCallees:t}))}function ce(e){return new Set([...e].filter(n=>!Ee(n)))}function Ee(e){return we.some(n=>e.includes(n))}function re(e,n,t){let i=Be(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,f=0;return S("similar.source-shape",()=>{let d=a==="target-pruned"?Ue(e,i,{minSimilarity:r,scanLimit:t.scanLimit}):Ge(i,_e(e,{scanLimit:t.scanLimit}));l=d.length;for(let o of d){if(o.symbol===i.symbol||o.tokens.size<3)continue;c+=1;let g=ne(i.tokens,o.tokens);if(g.size<2){m+=1;continue}let u=new Set([...i.tokens,...o.tokens]),p=u.size>0?g.size/u.size:0;if(p<r){f+=1;continue}s.push({symbolA:i.symbol,shortNameA:L(i.symbol),fileA:i.file,symbolB:o.symbol,shortNameB:L(o.symbol),fileB:o.file,similarity:p,similarityBasis:"source-tokens",sharedCallees:[...g].sort(),uniqueToA:[...A(i.tokens,o.tokens)].sort(),uniqueToB:[...A(o.tokens,i.tokens)].sort(),...ue([...g],"source-tokens")})}return s.sort((o,g)=>g.similarity-o.similarity||o.shortNameB.localeCompare(g.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:f,results:s.length}))}function ue(e,n){let t=e.flatMap(V),i=e.flatMap(b=>se(b,n)),r=K(t,me),s=K(t,de),a=K(i,Z),l=[...new Set(i.filter(ae))],c=e.filter(b=>{let y=se(b,n);return y.some(C=>Z.has(C))&&y.some(ae)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let f=n==="source-tokens"&&t.length>0&&t.every(b=>fe.has(b));f&&m.push("shared source tokens are generic scaffolding");let d=a.length>0&&l.length>0,o=r.length+s.length>0,g=n==="callees"&&d&&e.length>=4&&l.length>=4&&c>=2,u=g?"domain-behavior":d?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||f?"framework-scaffolding":"structural-overlap";u==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=u==="domain-behavior"&&(e.length>=3||g)?"direct":"signal";return{evidenceClass:u,actionTier:p,evidenceClassReasons:m,recommendation:Te(u,p)}}function Te(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function K(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function se(e,n){if(n==="source-tokens")return V(e);let t=G(e);return V(t.length>0?t:Ae(e))}function Ae(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function ae(e){return e.length>3&&!Z.has(e)&&!me.has(e)&&!de.has(e)&&!fe.has(e)&&!qe.has(e)}var Z=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),me=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),de=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),fe=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),qe=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Be(e,n){let t=U(e,n);if(!t||!P(t.symbol))return null;let i=Ne(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ne(e,n){let t=G(n.symbol),i=We(e,n.relativePath,n.startLine,n.endLine,t),r=Se(i,t);return r.size>0?r:null}var Pe=E("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Oe=E("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ge(e){return`${e.scanLimit??""}`}function $e(e,n={}){let t=Pe.get(e,()=>new Map),i=ge(n),r=t.get(i);return r||(r=Ze(e,n),t.set(i,r)),r}function _e(e,n={}){let t=Oe.get(e,()=>new Map),i=ge(n),r=t.get(i);return r||(r=je($e(e,n)),t.set(i,r)),r}function je(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Ge(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Ue(e,n,t){let i=D(),r=new T(e),s=He(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=S("similar.source-shape.target-files",()=>{let u=[...n.tokens],p=[];for(let b of Y(e,{includeIgnored:!1})){a+=1;let y=_(e,b);y&&(l+=1,Ke(y,u,s)&&p.push(b))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),f=0,d=S("similar.source-shape.target-definitions",()=>{let u=O(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return f=u.length,u},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:f})),o=0;return S("similar.source-shape.target-fingerprints",()=>{let u=pe(e,d);return i&&(o=u.length),u},()=>({symbol:n.symbol,definitionCount:f,fingerprintCount:o})).filter(u=>u.symbol!==n.symbol)}function He(e,n){return Math.max(2,Math.ceil(e*n))}function Ke(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(Ve(i,s)&&(r+=1,r>=t))return!0;return!1}function Ve(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function Ze(e,n={}){let t=new T(e),{scanLimit:i}=n,r=O(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return pe(e,r)}function pe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=_(e,r);if(!a)continue;let l=X(e,r,a),c=Je(e,r,l),m=!1,f=null;for(let d of s){let o=Xe(d),g=c.get(o),u=g?new Set(g.tokens):null;u||(f??=j(e,r),u=Se(be(f,d.startLine,d.endLine,d.leaf),d.leaf),c.set(o,{key:o,symbol:d.symbol,startLine:d.startLine,endLine:d.endLine,leaf:d.leaf,tokens:[...u].sort()}),m=!0),u.size>0&&i.set(d.symbol,{symbol:d.symbol,file:d.relativePath,tokens:u})}m&&Qe(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function We(e,n,t,i,r){let s=j(e,n);return s.length===0?"":be(s,t,i,r)}function be(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
2
- `);let r=[new RegExp(`\\bdef\\s+${q(i)}\\b`),new RegExp(`\\bfun\\s+${q(i)}\\b`),new RegExp(`\\bfn\\s+${q(i)}\\b`),new RegExp(`\\bfunction\\s+${q(i)}\\b`),new RegExp(`\\b${q(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&en(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
3
- `)}return e.slice(n,Math.min(e.length,n+8)).join(`
4
- `)}function Xe(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function Je(e,n,t){let i=J(e,"source-fingerprints",n,t);if(!i)return new Map;try{let r=JSON.parse(i);if(!Array.isArray(r.entries))return new Map;let s=new Map;for(let a of r.entries){if(!a||typeof a.key!="string"||typeof a.symbol!="string"||typeof a.startLine!="number"||typeof a.endLine!="number"||typeof a.leaf!="string"||!Array.isArray(a.tokens)||!a.tokens.every(l=>typeof l=="string"))return new Map;s.set(a.key,a)}return s}catch{return new Map}}function Qe(e,n,t,i){let r={entries:[...i.values()].sort((s,a)=>s.key.localeCompare(a.key))};Q(e,"source-fingerprints",n,t,JSON.stringify(r))}function Se(e,n){if(!e)return new Set;let t=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"]),i=Ye(n),s=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(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function Ye(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 en(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{fn as a,he as b,gn as c,pn as d,xe as e,Re as f,W as g,ve as h,De as i,ce as j,ue as k};
5
- //# sourceMappingURL=chunk-CW5YFOCP.js.map
@@ -1,5 +0,0 @@
1
- import{c as g,e as h}from"./chunk-7S5E7KWT.js";import{readFileSync as w}from"fs";import{join as V}from"path";var j=g("source-text",{clearGroups:["whole-project","source-file"]}),v=g("source-lines",{clearGroups:["whole-project","source-file"]});function l(e,t){let r=t.replace(/\\/g,"/");return j.get(e,r,()=>{let n=V(e.config.projectRoot,r);try{return w(n,"utf-8")}catch(s){if(_(s))return"";throw s}})}function _(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function A(e,t){let r=t.replace(/\\/g,"/");return v.get(e,r,()=>{let n=l(e,r);return n?n.split(`
2
- `):[]})}var N=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar))?\b/i;function R(e){let t=N.exec(e);return t?t[1]??"":null}function X(e,t,r){if(r<=0)return!1;let n=A(e,t);if(n.length===0)return!1;for(let s=r-1;s>=0&&s>=r-5;s-=1){let a=(n[s]??"").trim();if(a!==""){if(R(a)!==null)return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}import{createRequire as P}from"module";var c=P(import.meta.url),p=null,k=!1;function T(){if(k)return null;if(p)return p;try{return p=c("tree-sitter"),p}catch{return k=!0,null}}var C=new Map,m=new Set;function E(e){if(m.has(e))return null;let t=C.get(e);if(t)return t;let r;try{switch(e){case"rust":r=c("tree-sitter-rust");break;case"typescript":r=c("tree-sitter-typescript").typescript;break;case"tsx":r=c("tree-sitter-typescript").tsx;break;case"javascript":r=c("tree-sitter-javascript");break;case"python":r=c("tree-sitter-python");break;case"java":r=c("tree-sitter-java");break;case"kotlin":r=c("tree-sitter-kotlin");break;case"scala":r=c("tree-sitter-scala");break;case"ruby":r=c("tree-sitter-ruby");break;case"c":r=c("tree-sitter-c");break;case"cpp":r=c("tree-sitter-cpp");break;case"csharp":r=c("tree-sitter-c-sharp");break;case"php":r=c("tree-sitter-php").php;break;case"vb":{let n=c("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return m.add(e),null}return C.set(e,r),r}var x=new Map;function M(e){let t=x.get(e);if(t)return t;let r=E(e);if(!r)return null;let n=T();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return m.add(e),null}return x.set(e,s),s}function Q(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function Z(e,t){let r=M(e);if(!r)return null;try{return Q(r,t)}catch{return null}}import{posix as y}from"path";import{parse as U}from"@vue/compiler-sfc";var I=h("vue-sfc-units");function ae(e,t){let r=B(t),n=l(e,r);return I.get(e,r,n,()=>z(e,r,n))}function B(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function D(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function ce(e){return!e||e.body.length===0?0:e.body.split(`
3
- `).length}function z(e,t,r){let n={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!r)return n;let s;try{s=U(r,{filename:t})}catch(i){return n.errors.push(L(i)),n}n.errors.push(...s.errors.map(L));let{descriptor:a}=s;return a.template&&(n.template=f(e,t,"template",a.template)),a.script&&n.scripts.push(b(e,t,a.script,!1)),a.scriptSetup&&n.scripts.push(b(e,t,a.scriptSetup,!0)),n.styles=a.styles.map(i=>f(e,t,"style",i)),n.customBlocks=a.customBlocks.map(i=>f(e,t,"custom",i)),n.errors.push(...[n.template,...n.scripts,...n.styles,...n.customBlocks].flatMap(i=>i?.errors??[])),n}function b(e,t,r,n){let s=f(e,t,"script",r);return{...s,kind:"script",setup:n,astLanguage:D(s.lang)}}function f(e,t,r,n){let s=$(n.attrs),a=typeof s.lang=="string"?s.lang:null,i=typeof s.src=="string"?s.src:typeof n.src=="string"?n.src:void 0;if(i){let o=W(t,i);if(!o)return{kind:r,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:s,lang:a,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${r} block source: ${i}`]};let u=l(e,o),F=u?Math.max(0,u.split(`
4
- `).length-1):0;return{kind:r,ownerPath:t,sourcePath:o,external:!0,src:i,attrs:s,lang:a,body:u,startLine:0,endLine:F,errors:u?[]:[`Vue ${r} block source not found: ${o}`]}}let S=Math.max(0,n.loc.start.line-1);return{kind:r,ownerPath:t,sourcePath:t,external:!1,attrs:s,lang:a,body:n.content,startLine:S,endLine:Math.max(S,n.loc.end.line-1),errors:[]}}function W(e,t){let r=t.split(/[?#]/,1)[0];if(!r||r.startsWith("/")||r.includes("://"))return null;let n=B(y.normalize(y.join(y.dirname(e),r)));return n===".."||n.startsWith("../")?null:n}function $(e){return{...e}}function L(e){return e instanceof Error?e.message:String(e)}function oe(e,t){let r=O(e,t);if(!r)return null;let n=d(r);return n?{calleeLeaf:n,memberAccess:q(r),line:e.startPosition.row}:null}function O(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 q(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function d(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?d(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?d(t):null}case"super":case"self":case"this":return null;default:return null}}export{l as a,A as b,R as c,X as d,Z as e,ae as f,D as g,ce as h,oe as i,d as j};
5
- //# sourceMappingURL=chunk-DS6QEB3G.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-PFOCOG57.js";import{a as d}from"./chunk-5OST6GYB.js";import{a as c}from"./chunk-KDFONWTW.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as u}from"./chunk-72KY2ZFO.js";import{a as o}from"./chunk-HF25DFSC.js";function F(r,t={}){let{scope:l,limit:s=30,scanLimit:b}=t,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:t.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>y(e.relativePath)),scanLimit:b,evaluate:e=>{let n=u(r,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 L=c(r,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||h(L.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 y(r){let t=o(r);return t==="typescript"||t==="tsx"||t==="javascript"}function h(r,t,l){return r?r.some(s=>s>t&&s<=l):!1}export{F as a};
2
- //# sourceMappingURL=chunk-E35O7UCB.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-JCLDUKT6.js";import{a as u}from"./chunk-TK7O5ER5.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-EXDQ35NN.js.map
@@ -1,2 +0,0 @@
1
- import{c as s,d as l}from"./chunk-BZ53S4ZN.js";import{a as u}from"./chunk-3VD3JMK2.js";import{a as p,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{e as c}from"./chunk-HF25DFSC.js";function y(i,t={}){let{minSimilarity:r=.62,minTokens:e=8,limit:a=20,scope:d,scanLimit:g,filePattern:h,focusFiles:k}=t,P=c(i,{scope:d,minJsxTokens:e,scanLimit:g}).filter(n=>n.kind==="component").map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n}));return u({profiles:P,limit:a,filePattern:h,focusFiles:k,compare:(n,o)=>B(n,o,r),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.componentA.localeCompare(o.componentA)||n.fileB.localeCompare(o.fileB)||n.componentB.localeCompare(o.componentB)})}function B(i,t,r){let e=p(i.tokens,t.tokens);if(e.size<6||!C(e))return null;let a=f(i.tokens,t.tokens);return a<r?null:{fileA:i.file,componentA:i.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:l(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:l(m(i.tokens,t.tokens)).slice(0,25),uniqueToB:l(m(t.tokens,i.tokens)).slice(0,25),locA:i.profile.loc,locB:t.profile.loc}}function C(i){let t=0,r=0;for(let e of i)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(r+=1);return t>=1||r>=4}export{y as a};
2
- //# sourceMappingURL=chunk-FAYI6KZ5.js.map
@@ -1,2 +0,0 @@
1
- import{c as l}from"./chunk-YZA6PPZL.js";function v(e,t={}){let{minTotalLines:n=800,minTemplateLines:i=300,minScriptLines:a=300,minStyleLines:r=500,limit:o=20,scope:m,scanLimit:p,filePattern:u}=t;return l(e,{scope:m,scanLimit:p}).filter(s=>!u||s.file.includes(u)).map(s=>L(s,{minTotalLines:n,minTemplateLines:i,minScriptLines:a,minStyleLines:r})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(e,t){let n=[];if(e.totalLines>=t.minTotalLines&&n.push(`${e.totalLines} total component line(s)`),e.templateLines>=t.minTemplateLines&&n.push(`${e.templateLines} template line(s)`),e.scriptLines>=t.minScriptLines&&n.push(`${e.scriptLines} script line(s)`),e.styleLines>=t.minStyleLines&&n.push(`${e.styleLines} style line(s)`),n.length===0)return null;let i=b(e),a=g(e,t,i),r=x(e.file),o=V(i,r);return{file:e.file,totalLines:e.totalLines,sfcLines:e.sfcLines,templateLines:e.templateLines,scriptLines:e.scriptLines,styleLines:e.styleLines,externalScriptLines:e.externalScriptLines,externalScriptPaths:e.externalScriptPaths,customBlockLines:e.customBlockLines,dominantPressure:i,pressureKinds:a,contextKind:r,recommendationKind:o,recommendation:d(o,r),reasons:n,loc:e.totalLines}}function b(e){let t=[{axis:"template",lines:e.templateLines},{axis:"script",lines:e.scriptLines-e.externalScriptLines},{axis:"style",lines:e.styleLines},{axis:"external-script",lines:e.externalScriptLines},{axis:"custom-block",lines:e.customBlockLines}];return t.sort((n,i)=>i.lines-n.lines),t[0]?.lines?t[0].axis:"total"}function g(e,t,n){let i=[];return e.totalLines>=t.minTotalLines&&(i.push("total"),n!=="total"&&i.push(n)),e.templateLines>=t.minTemplateLines&&i.push("template"),e.scriptLines>=t.minScriptLines&&i.push("script"),e.styleLines>=t.minStyleLines&&i.push("style"),(e.externalScriptLines>=t.minScriptLines||n==="external-script")&&i.push("external-script"),e.customBlockLines>0&&n==="custom-block"&&i.push("custom-block"),[...new Set(i.length>0?i:[n])]}function x(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(i=>w.has(i))||/(?:view|page|route)\.vue$/i.test(e)||/(?:^|\/)(views|pages|routes)\//i.test(e)?"route-page":"component"}function V(e,t){return e==="style"?"style-decomposition":e==="template"?"template-decomposition":e==="external-script"?"external-script-boundary":e==="custom-block"?"custom-block-review":t==="route-page"?"route-page-decomposition":e==="script"?"script-behavior-extraction":"total-size-review"}function d(e,t){switch(e){case"template-decomposition":return t==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{v as a};
2
- //# sourceMappingURL=chunk-FG4NT6VY.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-PFOCOG57.js";import{a as u}from"./chunk-5OST6GYB.js";import{c as p}from"./chunk-JM72FNGA.js";function C(e,r){let{scope:c,minLoc:l=10,limit:s=30,scanLimit:a}=r??{},o=new u(e);return b({candidates:()=>o.productionCallableDefinitions({scope:c,minLoc:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:o.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:o.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>d(t,n,l),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:s})}function d(e,r,c){let l=e.endLine-e.startLine+1;if(l<c)return null;let s=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],o=new Set,t=new Set;for(let m of a){let i=`${m.symbol}|${m.file}`;o.add(i),m.file!==e.relativePath&&t.add(i)}let n=t.size,y=o.size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:l,fanIn:s,fanOut:n,calleeCount:y,score:Math.round(l/50*(s/5)*Math.max(n/5,1)*100)/100}}export{C as a};
2
- //# sourceMappingURL=chunk-GQBMH2TQ.js.map
@@ -1,2 +0,0 @@
1
- import{a as F}from"./chunk-P5RYBRIO.js";import{d as x}from"./chunk-JM72FNGA.js";import{a as v,d as S}from"./chunk-HF25DFSC.js";import{a as L,b as y}from"./chunk-DS6QEB3G.js";import{b as m,d as g,e as d}from"./chunk-XUGQU7PM.js";import{c as p}from"./chunk-7S5E7KWT.js";var C=p("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function k(t,e,r){return t.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function z(t,e,r){let n=[],i=0,s=0,c=x(e.symbol);for(let a of r)_(t,a,e.relativePath,c)?i++:h(t,a,c)?s++:n.push(a);return{realConsumers:n,barrelConsumers:i,importOnlyConsumers:s}}function h(t,e,r){if(!r)return!1;let n=v(e);if(!n)return!1;let i=C.get(t,e,()=>b(t,e,n));return i.importedLeaves.has(r)&&!i.usedLeaves.has(r)}function b(t,e,r){let n=L(t,e);if(!n)return U();let i=m(t,e,n),s=g(t,"consumer-file-usage",e,i);if(s){let a=E(s);if(a)return a}let c=w(t,e,r);return d(t,"consumer-file-usage",e,i,D(c)),c}function w(t,e,r){let n=new Set,i=new Set,s=S(t,e);if(!s)return{importedLeaves:n,usedLeaves:i};let c=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let u=f||c.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(u?n.add(o.text):i.add(o.text));for(let l of o.children)a(l,u)};return a(s.rootNode,!1),{importedLeaves:n,usedLeaves:i}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function D(t){return JSON.stringify({importedLeaves:[...t.importedLeaves],usedLeaves:[...t.usedLeaves]})}function E(t){try{let e=JSON.parse(t);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(e.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function _(t,e,r,n){if(!n)return!1;let i=y(t,e);if(i.length===0)return!1;let s=F(t,e);if(s.length===0)return!1;let c=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),o=0;for(let f=0;f<i.length;f++){if(!a.test(i[f]??""))continue;if(o++,!s.find(l=>l.startLine<=f&&f<=l.endLine))return!1}return o>0}export{k as a,z as b,h as c};
2
- //# sourceMappingURL=chunk-GRJY65YT.js.map
@@ -1,3 +0,0 @@
1
- import{a as p,b as k,e as g,g as b,i as C}from"./chunk-DS6QEB3G.js";import{b as y,d as S,e as v,j as _,k as l}from"./chunk-XUGQU7PM.js";import{c as T}from"./chunk-A536TEU4.js";import{e as N,f as x}from"./chunk-7S5E7KWT.js";import{extname as R}from"path";var G={".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 d(e){return G[R(e).toLowerCase()]??null}function j(e){return R(e).toLowerCase()===".vue"}import{extname as Y}from"path";import{parse as Q}from"@vue/compiler-sfc";function w(e){let t=Q(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=b(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var L=x("ast-trees",{clearGroups:["whole-project","source-file"]});function A(e,t){if(j(t))return X(e,t);let n=d(t);if(!n)return null;let s=p(e,t);return s?L.get(e,t,s,()=>g(n,s)):null}function X(e,t){let n=p(e,t);return n?L.get(e,t,n,()=>{let s=w(n);if(!s)return null;let o=`
2
- `.repeat(s.startLine)+s.body;return g(s.language,o)}):null}var ee=[".tsx",".jsx"],F=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),te=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),ne=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),se=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),oe=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),re=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),ae=new Set(["children","className","false","key","null","style","true","undefined"]),ie=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),ce=N("react-component-behavior-profiles");function et(e,t={}){let n=T(e,{extensions:ee}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>le(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function le(e,t){let n=t.replace(/\\/g,"/"),s=p(e,n);return ce.get(e,n,s,()=>ue(e,n,s)).map(pe)}function ue(e,t,n){let s=y(e,t,n),o=S(e,"react-component-behavior-profiles",t,s);if(o){let r=de(o);if(r)return r}let a=me(e,t);return v(e,"react-component-behavior-profiles",t,s,fe(a)),a}function me(e,t){let n=ge(t);if(!n)return[];let s=A(e,t);if(!s)return[];let o=k(e,t).length;return Ne(s.rootNode,n).filter(r=>r.kind==="hook"||$(r.bodyNode)).map(r=>{let i=ke(r.bodyNode),u=Re(r.bodyNode,n);return{file:t,name:r.name,kind:r.kind,startLine:r.node.startPosition.row,endLine:r.node.endPosition.row,loc:Math.max(1,r.node.endPosition.row-r.node.startPosition.row+1),fileLines:o,jsxTokens:i.tokens,behaviorTokens:u.tokens,componentNames:m(i.componentNames),nativeTags:m(i.nativeTags),propNames:m(i.propNames),eventNames:m(i.eventNames),hookNames:m(u.hookNames),requestNames:m(u.requestNames),stateNames:m(u.stateNames),effectNames:m(u.effectNames),handlerNames:m(u.handlerNames)}})}function pe(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function fe(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function de(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let s of t){let o=he(s);if(!o)return null;n.push(o)}return n}catch{return null}}function he(e){if(!_(e))return null;let{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:u,behaviorTokens:J,componentNames:z,nativeTags:D,propNames:I,eventNames:V,hookNames:H,requestNames:Z,stateNames:M,effectNames:K,handlerNames:U}=e;if(typeof t!="string"||typeof n!="string"||s!=="component"&&s!=="hook"||!h(o)||!h(a)||!h(r)||!h(i))return null;let c={jsxTokens:l(u),behaviorTokens:l(J),componentNames:l(z),nativeTags:l(D),propNames:l(I),eventNames:l(V),hookNames:l(H),requestNames:l(Z),stateNames:l(M),effectNames:l(K),handlerNames:l(U)};return Object.values(c).some(W=>W===null)?null:{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:new Set(c.jsxTokens),behaviorTokens:new Set(c.behaviorTokens),componentNames:c.componentNames,nativeTags:c.nativeTags,propNames:c.propNames,eventNames:c.eventNames,hookNames:c.hookNames,requestNames:c.requestNames,stateNames:c.stateNames,effectNames:c.effectNames,handlerNames:c.handlerNames}}function h(e){return typeof e=="number"&&Number.isFinite(e)}function ge(e){let t=Y(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:d(e)}function Ne(e,t){let n=[],s=new Set,o=a=>{let r=xe(a);if(r&&!Se(a)){let i=`${r.name}:${r.node.startIndex}:${r.node.endIndex}`;s.has(i)||(s.add(i),n.push(r));return}for(let i of a.namedChildren)o(i)};return(t==="tsx"||t==="javascript")&&o(e),n}function xe(e){if(e.type==="function_declaration"){let a=O(e);return!a||!B(a)?null:{name:a,kind:P(a),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=f(t);if(!s||!n||!B(s))return null;let o=ye(n);return o?{name:s,kind:P(s),node:e,bodyNode:o}:null}function B(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function P(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function ye(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=ve(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Se(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function O(e){return f(e.childForFieldName("name")??e.namedChild(0))}function ve(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function $(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some($)}function ke(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?be(s,t):s.type==="jsx_expression"?Ce(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of s.namedChildren)n(o)};return n(e),t}function be(e,t){let n=Te(e),s=!1;if(n){let o=E(n);s=Fe(o),s?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let a=_e(o);if(!a)continue;let r=E(a);if(r.startsWith("on")&&r.length>2){let i=r.slice(2).replace(/^[A-Z]/,u=>u.toLowerCase());t.eventNames.add(i),t.tokens.add(`event:${i}`)}else ie.has(r)||(t.propNames.add(r),t.tokens.add(`${s?"prop":"native-prop"}:${r}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function Ce(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of Be(n))ae.has(s)||t.tokens.add(`binding:${s}`)}function Te(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function _e(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Re(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=o=>{if(o.type==="call_expression"){let a=C(o,t);a&&je(a.calleeLeaf,n)}else if(o.type==="variable_declarator")Le(o,n);else if(o.type==="function_declaration"){let a=O(o);a&&q(a,n)}for(let a of o.namedChildren)s(a)};return s(e),n}function je(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!F.has(e)&&!se.has(e)&&t.tokens.add(`hook:${e}`)),F.has(e)&&t.tokens.add(`react-hook:${e}`),te.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),ne.has(e)&&t.tokens.add(`state-hook:${e}`),we(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function we(e){if(oe.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Le(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let a=n.namedChildren.find(i=>f(i)),r=f(a);r&&(t.stateNames.add(r),t.tokens.add(`state:${r}`))}let o=f(n);o&&q(o,t)}function q(e,t){let n=Ae(e);!n||!re.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Ae(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Fe(e){return/^[A-Z]/.test(e)||e.includes(".")}function E(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function f(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Be(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function m(e){return[...e].sort()}export{d as a,j as b,w as c,A as d,et as e};
3
- //# sourceMappingURL=chunk-HF25DFSC.js.map
@@ -1,2 +0,0 @@
1
- import{c as o,d as a}from"./chunk-BZ53S4ZN.js";import{a as p}from"./chunk-3VD3JMK2.js";import{a as c,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{c as u}from"./chunk-YZA6PPZL.js";function D(n,i={}){let{minSimilarity:t=.62,minTokens:e=8,limit:l=20,scope:d,scanLimit:h,filePattern:k,focusFiles:g}=i,P=C(n,{scope:d,minTokens:e,scanLimit:h});return p({profiles:P,limit:l,filePattern:k,focusFiles:g,compare:(r,s)=>T(r,s,t),sort:(r,s)=>s.similarity-r.similarity||r.fileA.localeCompare(s.fileA)||r.fileB.localeCompare(s.fileB)})}function C(n,i){return u(n,{scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(t=>({file:t.file,tokens:t.templateTokens,loc:v(t)}))}function v(n){return n.totalLines}function T(n,i,t){let e=c(n.tokens,i.tokens);if(e.size<6||!b(e))return null;let l=f(n.tokens,i.tokens);return l<t?null:{fileA:n.file,fileB:i.file,similarity:l,sharedTokens:a(e),sharedComponents:o(e,"component:"),sharedProps:o(e,"prop:"),sharedEvents:o(e,"event:"),sharedDirectives:o(e,"directive:"),sharedSlots:o(e,"slot:"),sharedIdentifiers:o(e,"id:"),uniqueToA:a(m(n.tokens,i.tokens)).slice(0,25),uniqueToB:a(m(i.tokens,n.tokens)).slice(0,25),locA:n.loc,locB:i.loc}}function b(n){let i=0,t=0;for(let e of n)e.startsWith("component:")&&(i+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("directive:")||e.startsWith("slot:"))&&(t+=1);return i>=1||t>=3}export{D as a};
2
- //# sourceMappingURL=chunk-HHN2B5KA.js.map
@@ -1,38 +0,0 @@
1
- import{b as J,g as B,h as W,i as U,p as Y}from"./chunk-KDFONWTW.js";import{a as K,b as z,d as Q,f as V}from"./chunk-OLTESY4K.js";import{a as q,b as C}from"./chunk-TQ5W2H3S.js";import{a as x}from"./chunk-VUKC6F77.js";import{f as H,g as $,l as j,m as G}from"./chunk-2KHTSEIL.js";import{d as F,f as P}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-72KY2ZFO.js";import{a as T}from"./chunk-HF25DFSC.js";import{a as R}from"./chunk-DS6QEB3G.js";import{a as k,b as w,f as N,h as O}from"./chunk-XUGQU7PM.js";import{c as A,d as D}from"./chunk-7S5E7KWT.js";function De(e,n,l={}){let o=X(e,[n],{additive:l.additive,semantic:l.semantic}),i=l.callableOnly?(o.get(n.symbolId)??[]).filter(a=>P(a.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?i.slice(0,l.limit):i}function ke(e,n,l={}){let o=oe(e)?le(e,n,{semantic:l.semantic!==!1}):ie(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var ne=D("caller-rows",{clearGroups:["whole-project"]}),te=2e4;function oe(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>te}function ie(e){return ne.get(e,()=>{let n=$(e),l=X(e,n),o=new Map;for(let r of n)o.set(r.symbol,r.symbolId);let i=new Map,a=new Map;for(let r of n){let s=l.get(r.symbolId);if(!(!s||s.length===0))for(let u of s){let m=o.get(u.symbol);if(m===void 0||m===r.symbolId)continue;let d=i.get(m);d||(d=[],i.set(m,d),a.set(m,new Set));let f=`${r.symbol}|${r.relativePath}`;a.get(m).has(f)||(a.get(m).add(f),d.push({symbol:r.symbol,file:r.relativePath,source:"caller-map-inversion"}))}}return i})}function le(e,n,l){let o=[],i=new Set,a=s=>{if(s.symbol===n.symbol)return;let u=`${s.symbol}|${s.file}`;i.has(u)||(i.add(u),o.push(s))};for(let s of Y(e,n))s.file!==n.relativePath&&a({symbol:s.enclosingSymbol??s.file,file:s.file,source:"resolved-reference"});let r=l.semantic?se(e,n):null;if(r)for(let s of Q(e,r)){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let u=G(H(e,s.file),s.line);a({symbol:u?.symbol??s.file,file:s.file,source:"semantic-reference"})}return o}function se(e,n){return e.get(`SELECT
2
- d.id AS documentId,
3
- gs.id AS symbolId,
4
- gs.symbol,
5
- d.relative_path AS relativePath,
6
- COALESCE(der.start_line, c.start_line) AS startLine,
7
- COALESCE(der.end_line, c.end_line) AS endLine,
8
- COALESCE(gs.display_name, '') AS leaf,
9
- NULL AS parentTypeName,
10
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
12
- gs.kind AS kind,
13
- gs.documentation AS documentation,
14
- gs.enclosing_symbol AS enclosingSymbol
15
- FROM global_symbols gs
16
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
17
- LEFT JOIN chunks c ON c.document_id = der.document_id
18
- JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
19
- WHERE gs.id = ?
20
- LIMIT 1`,n.symbolId)??null}function X(e,n,l={}){if(n.length===0)return new Map;let o=l.additive??!1,i=[],a=[];for(let d of n)T(d.relativePath)&&E(e,d.relativePath)!==null?i.push(d):a.push(d);let r=new Map,s=new Map,u=d=>{for(let[f,t]of d){let g=r.get(f);g||(g=[],r.set(f,g));let c=s.get(f);c||(c=new Set,s.set(f,c));for(let p of t){let h=`${p.symbol}|${p.chunkId}`;c.has(h)||(c.add(h),g.push(p))}}};i.length>0&&u(de(e,i)),l.semantic!==!1&&u(be(ae(e,n)));let m=o?n:a;return m.length>0&&u(pe(e,m)),r}function ae(e,n){let l=q(),o=new Map,i=[],a=[],r=0,s=0,u=0,m=0;if(C("semantic.callees.cache-scan",()=>{for(let c of n){if(!K(c.relativePath)){l&&(r+=1);continue}let p=R(e,c.relativePath);if(!p){l&&(s+=1),a.push(c);continue}let h=w(e,c.relativePath,p),_=me(e,c.relativePath),b=N(e,c.relativePath,c.symbol,h,_);if(b!==null){let y=ce(b);if(y){l&&(u+=1),y.length>0&&o.set(c.symbolId,y);continue}l&&(m+=1)}i.push({def:c,contentHash:h,depsDigest:_})}},()=>({definitions:n.length,skippedNonTs:r,sourceMissing:s,cacheHits:u,parseFailures:m,misses:i.length,unkeyed:a.length,resultRows:o.size})),i.length===0&&a.length===0)return o;let d=[...a,...i.map(c=>c.def)],f=0,t=C("semantic.callees.compute-misses",()=>{let c=V(e,d);return f=c.size,c},()=>({definitions:d.length,misses:i.length,unkeyed:a.length,rows:f}));for(let[c,p]of t)o.set(c,p);if(z(e).availability().available){let c=i.map(p=>({relativePath:p.def.relativePath,symbol:p.def.symbol,contentHash:p.contentHash,depsDigest:p.depsDigest,payload:JSON.stringify(t.get(p.def.symbolId)??[])}));C("semantic.callees.cache-write",()=>O(e,c),()=>({entries:c.length}))}else C("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:i.length}));return o}function ce(e){try{return JSON.parse(e)}catch{return null}}var re=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function me(e,n){return re.get(e,n,()=>{let o=[...x(e).get(n)??[]].sort().map(i=>`${i}:${w(e,i,R(e,i))}`);return k(o.join("|"))})}function de(e,n){let l=new Map,o=ue(n,l),i=U(e);for(let[a,r]of o){let s=E(e,a);if(!s)continue;let u=j(r);for(let m of s){let d=u.get(m.line);if(!d)continue;let f=fe(e,a,i,m.calleeLeaf,m.memberAccess);f&&f.symbol!==d.symbol&&l.get(d.symbolId).push({symbol:f.symbol,file:f.file,chunkId:m.line,source:"ast-callsite"})}}return l}function ue(e,n){let l=new Map;for(let o of e){let i=l.get(o.relativePath);i?i.push(o):l.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of l.values())o.sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine));return l}function fe(e,n,l,o,i){let a=B(n,l.get(o)??[]);return a.length===0?null:W(e,n,a,i)}function pe(e,n){if(n.length===0)return new Map;let o=L(n.map(t=>t.documentId)).flatMap(t=>e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
21
- FROM mentions m
22
- JOIN chunks c ON m.chunk_id = c.id
23
- WHERE m.role != 1
24
- AND c.document_id IN (${t.map(()=>"?").join(",")})`,...t)),i=new Map;for(let t of o)i.has(t.document_id)||i.set(t.document_id,[]),i.get(t.document_id).push(t);let r=L(o.map(t=>t.symbol_id)).flatMap(t=>e.all(`SELECT gs.id AS symbol_id, gs.symbol,
25
- COALESCE(der.document_id, def_chunk.document_id) AS document_id
26
- FROM global_symbols gs
27
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
28
- LEFT JOIN (
29
- SELECT m.symbol_id, MIN(c.document_id) AS document_id
30
- FROM mentions m
31
- JOIN chunks c ON m.chunk_id = c.id
32
- WHERE m.role = 1
33
- AND m.symbol_id IN (${t.map(()=>"?").join(",")})
34
- GROUP BY m.symbol_id
35
- ) def_chunk ON def_chunk.symbol_id = gs.id
36
- WHERE gs.id IN (${t.map(()=>"?").join(",")})`,...t,...t)),s=L([...n.map(t=>t.documentId),...r.flatMap(t=>t.document_id===null?[]:[t.document_id])]),u=new Map(s.flatMap(t=>e.all(`SELECT id, relative_path FROM documents
37
- WHERE id IN (${t.map(()=>"?").join(",")})`,...t).map(g=>[g.id,g.relative_path]))),m=new Map;for(let t of r)m.has(t.symbol_id)||m.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?u.get(t.document_id)??"":""});let d=new Map,f=u;for(let t of n){let g=i.get(t.documentId)??[],c=new Set,p=[],h=null,_=()=>{if(h)return h;let b=f.get(t.documentId)??"",y=new Set;if(b){let M=J(e,b),I=Math.max(0,t.startLine),v=Math.min(M.length-1,t.endLine);for(let S=I;S<=v;S+=1)for(let ee of M[S])y.add(ee)}return h=y,y};for(let b of g){if(b.symbol_id===t.symbolId)continue;let y=m.get(b.symbol_id);if(!y)continue;if(!(b.start_line>=t.startLine&&b.end_line<=t.endLine)){if(!(b.start_line<=t.endLine&&b.end_line>=t.startLine))continue;let S=F(y.symbol);if(!S||!_().has(S))continue}let I=`${y.symbol}|${b.chunk_id}`;c.has(I)||(c.add(I),p.push({...y,chunkId:b.chunk_id,source:"scip-chunk"}))}d.set(t.symbolId,p)}return d}var Z=500;function L(e){let n=[...new Set(e)],l=[];for(let o=0;o<n.length;o+=Z)l.push(n.slice(o,o+Z));return l}function be(e){let n=new Map;for(let[l,o]of e){let i=[];for(let a of o)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(l,i)}return n}export{De as a,ke as b,X as c};
38
- //# sourceMappingURL=chunk-JCLDUKT6.js.map
@@ -1,2 +0,0 @@
1
- import{a as I}from"./chunk-54KGX7EX.js";import{a as H}from"./chunk-LSET2TXH.js";import{a as p}from"./chunk-JME7OWD3.js";import{a as T}from"./chunk-ZQDIXAF5.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-BFXPG2VN.js";import{a as v,b as F}from"./chunk-6LJHXREW.js";import{b as D}from"./chunk-65AU3HFZ.js";import{b as S}from"./chunk-BSN22NRK.js";import{a as j}from"./chunk-6IR2AOBM.js";import{a as w}from"./chunk-VCQYSG2M.js";import{a as P}from"./chunk-7TWLSZK5.js";import{a as A}from"./chunk-Z4HICZGY.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
- //# sourceMappingURL=chunk-JGN2ZFJR.js.map
@@ -1,2 +0,0 @@
1
- var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(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 s=t[0],i=t[1],r=e.slice(s.length+1+i.length+1),n;if(r.startsWith("`")){let f=r.indexOf("`",1);f===-1?(n=r.slice(1),r=""):(n=r.slice(1,f),r=r.slice(f+2))}else{let f=r.indexOf(" ");f===-1?(n=r,r=""):(n=r.slice(0,f),r=r.slice(f+1))}let o,c=r.indexOf(" ");c===-1?(o=r,r=""):(o=r.slice(0,c),r=r.slice(c+1));let a=m(r);return{scheme:s,manager:i,packageName:n,version:o,descriptors:a,raw:e}}function b(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let n=e.indexOf("]",s+1);if(n===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,n),suffix:"type-param"}),s=n+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let n=e.indexOf(")",s+1);if(n!==-1&&e[n+1]!=="."){t.push({name:e.slice(s+1,n),suffix:"parameter"}),s=n+1;continue}}let i;if(e[s]==="`"){let n=e.indexOf("`",s+1);if(n===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,n),s=n+1}else{let n=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(n,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[s];if(r==="("){let n=e.indexOf(")",s+1);n!==-1&&e[n+1]==="."?(t.push({name:i,suffix:"method"}),s=n+2):n!==-1?(t.push({name:i,suffix:"method"}),s=n+1):(t.push({name:i,suffix:"term"}),s++)}else{let n=d[r];n&&t.push({name:i,suffix:n}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function y(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let r of s.descriptors){let n=g(r);n&&i.push(n)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?x(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function x(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 k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"||t==="term"}function T(e){return p(e)==="namespace"}var h=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return h.test(e)}var S=new Set(["test","tests","_tests"]);function O(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function j(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function I(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length<=r.length)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,b,y as c,k as d,p as e,D as f,$ as g,T as h,M as i,O as j,j as k,I as l};
2
- //# sourceMappingURL=chunk-JM72FNGA.js.map
@@ -1,40 +0,0 @@
1
- import{d as F}from"./chunk-OLTESY4K.js";import{c as R}from"./chunk-TK7O5ER5.js";import{b as h}from"./chunk-P5RYBRIO.js";import{u as w}from"./chunk-OBGRLXWF.js";import{f as y,m as _}from"./chunk-2KHTSEIL.js";import{d}from"./chunk-JM72FNGA.js";import{a as S}from"./chunk-72KY2ZFO.js";import{a as k}from"./chunk-HF25DFSC.js";import{a as m}from"./chunk-DS6QEB3G.js";import{c as E}from"./chunk-A536TEU4.js";import{c as u,d as v}from"./chunk-7S5E7KWT.js";function I(e,t,n,r={}){if(!n)return[];let i=m(e,t);return i?i.indexOf(n)===-1?[]:(N(e,t).get(n)??[]).filter(s=>!J(s,r)):[]}function J(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var U=u("file-identifiers",{clearGroups:["whole-project","source-file"]});function A(e,t){let n=S(e,t);return n?n.fileIdentifiers:U.get(e,t,()=>new Set(N(e,t).keys()))}var Z=u("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,t){let n=S(e,t);return n?n.identifierLineMap:Z.get(e,t,()=>Y(e,t))}var W=u("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function me(e,t){let n=S(e,t);return n?n.identifiersByLine:W.get(e,t,()=>{let r=N(e,t),i=0;for(let s of r.values()){let o=s[s.length-1];o!==void 0&&o>i&&(i=o)}let a=new Array(i+1);for(let s=0;s<=i;s+=1)a[s]=new Set;for(let[s,o]of r)for(let c of o)a[c].add(s);return a})}function Y(e,t){let n=new Map,r=(o,c)=>{let l=n.get(o);if(!l){n.set(o,[c]);return}l[l.length-1]!==c&&l.push(c)},i=m(e,t);if(!i)return n;let a=w(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let o=0;o<a.length;o+=1){let c=a[o]??"";for(let l of c.matchAll(s))l[1]&&r(l[1],o)}return n}function pe(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
- m.symbol_id,
3
- d.relative_path,
4
- COUNT(*) AS ref_count
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents d ON c.document_id = d.id
8
- WHERE m.role != 1
9
- ${r}
10
- ${e.pathExclusionsFor("d")}
11
- GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function ge(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
- FROM mentions m
13
- JOIN chunks c ON m.chunk_id = c.id
14
- JOIN documents d ON c.document_id = d.id
15
- WHERE m.role != 1
16
- ${r}
17
- ${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function O(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
18
- c.start_line AS chunk_start, c.end_line AS chunk_end
19
- FROM mentions m
20
- JOIN chunks c ON m.chunk_id = c.id
21
- JOIN documents d ON c.document_id = d.id
22
- WHERE m.role != 1
23
- ${r}
24
- ${e.pathExclusionsFor("d")}
25
- ORDER BY d.relative_path, c.start_line`,...n??[])})}function x(e,t,n){if(!t)return n();if(t.length===0)return[];let r=[];for(let i=0;i<t.length;i+=750)r.push(...n(t.slice(i,i+750)));return r}function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function p(e,t){return L(e)===L(t)}var Q=u("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function P(e,t){let n=L(t);return Q.get(e,n,()=>V(e,n))}function V(e,t){let n=new Map;for(let r of h(e,t)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&T(n,i,r.sourcePath),r.kind==="namespace")for(let a of r.usedMembers)T(n,a,r.sourcePath)}return n}function T(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}function Ce(e,t){let n=$(e);return n?t.filter(r=>$(r.file)===n):t}function Me(e,t,n,r){let i=n.find(a=>a.file===t);if(i)return i;if(r){let a=new Set(h(e,t).map(s=>s.sourcePath).filter(s=>!!s));for(let s of n)for(let o of a)if(p(o,s.file))return s;return null}return n.length===1?n[0]:null}function $(e){let t=k(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var X=v("global-leaf-index",{clearGroups:["whole-project"]});function C(e){return X.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
26
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
27
- FROM global_symbols gs
28
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
29
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
30
- LEFT JOIN (
31
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
32
- FROM mentions m
33
- JOIN chunks c ON m.chunk_id = c.id
34
- JOIN documents d ON c.document_id = d.id
35
- WHERE m.role = 1
36
- GROUP BY m.symbol_id
37
- ) mention_doc ON mention_doc.symbol_id = gs.id
38
- WHERE 1 = 1
39
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let r of t){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=d(r.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(s=>s.symbolId===r.id)||a.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return n})}var j=/[A-Za-z_$][A-Za-z0-9_$]*/g,q=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function M(e){let t=[],n=!1;for(let r of e)r&&(n=!0,q.test(r)||t.push(r));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:t}}function B(e,t){let n=K(t)?t:M(t);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;j.lastIndex=0;let r;for(;(r=j.exec(e))!==null;)if(n.candidateNames.has(r[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function K(e){return"candidateNames"in e}function D(e,t,n){let r=C(e).get(n);if(!r||r.length===0)return[];if(r.length===1)return[g(r[0])];let i=r.filter(c=>c.file===t);if(i.length>0)return i.map(g);let a=P(e,t),s=a.get(n);if(s)for(let c of s){let l=r.filter(f=>p(c,f.file));if(l.length>0)return l.map(g)}let o=new Set;for(let c of a.values())for(let l of c)o.add(l);for(let c of o){let l=r.filter(f=>p(c,f.file));if(l.length>0&&l.length===r.length)return l.map(g)}return[]}function Ge(e,t,n){let r=D(e,t,n);if(r.length>0)return r;let i=C(e).get(n);return!i||i.length===0?[]:i.map(g)}function G(e,t,n={}){let r=R(e,t);if(!r)return[];let i=d(r.symbol);if(!i)return[];if(n.semantic!==!1){let s=F(e,{...r,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let l=o.get(c.file)??[];l.push(c.line),o.set(c.file,l)}return H(e,o)}}let a=new Map;for(let s of E(e)){let o=m(e,s);if(!o||o.indexOf(i)===-1||s!==r.relativePath&&!D(e,s,i).some(f=>f.symbolId===r.symbolId))continue;let c=I(e,s,i,s===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{});c.length>0&&a.set(s,c)}return H(e,a)}function ze(e,t){let n=new Map;for(let o of t){if(!o.leaf)continue;let c=n.get(o.leaf)??[];c.push(o),n.set(o.leaf,c)}if(n.size===0)return new Map;let r=new Set(t.map(o=>o.symbolId)),i=new Set(n.keys()),a=M(i),s=new Map;for(let o of E(e)){if(!B(m(e,o),a))continue;let c=A(e,o);if(c.size!==0){for(let l of c)if(n.has(l))for(let f of D(e,o,l)){if(!r.has(f.symbolId)||o===f.relativePath)continue;let b=s.get(f.symbolId);b||(b=new Set,s.set(f.symbolId,b)),b.add(o)}}}return s}function g(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function H(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}function ee(e,t){let n=se(e,t);return n?ae(e,te(e,n.match,n.identifier)):[]}function Xe(e,t,n={}){return ne(e,t,n).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function ne(e,t,n={}){let r=G(e,t,{semantic:n.semantic}),i=r.length>0?z(r,"source-attribution"):z(ee(e,t),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function z(e,t){return e.map(n=>({...n,provenance:t}))}function te(e,t,n){let r=new Map;for(let[i,a]of re(e,t.symbolId))r.set(i,ie(e,i,a,t,n));return r}function re(e,t){let n=new Map;for(let r of O(e,[t])){if(e.isIgnored(r.relative_path))continue;let i=n.get(r.relative_path);i||(i=[],n.set(r.relative_path,i)),i.push({start_line:r.chunk_start,end_line:r.chunk_end})}return n}function ie(e,t,n,r,i){let a=t===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?I(e,t,i,a):[];return n.flatMap(o=>oe(s,o))}function oe(e,t){let n=e.filter(r=>r>=t.start_line&&r<=t.end_line);return n.length>0?n:[t.start_line]}function se(e,t){let n=R(e,t);return n?{match:n,identifier:d(n.symbol)||null}:null}function ae(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}export{N as a,me as b,pe as c,ge as d,O as e,p as f,Ce as g,Me as h,C as i,M as j,B as k,P as l,D as m,Ge as n,ze as o,ee as p,Xe as q};
40
- //# sourceMappingURL=chunk-KDFONWTW.js.map
@@ -1,2 +0,0 @@
1
- import{a as d}from"./chunk-3VD3JMK2.js";import{c as a}from"./chunk-YWOOQ4FF.js";import{a as c}from"./chunk-VUKC6F77.js";function F(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:f}=e,r=e.minDeps??(f?1:3),{profiles:s,distinctiveDeps:p}=m(t,{scope:n,minDeps:r});return d({profiles:s,limit:l,filePattern:f,overrunFactor:5,compare:(i,u)=>D(i,u,o,p)})}function m(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:f,distinctiveDeps:r}=g(n),s=[];for(let[p,i]of n)i.size>=l&&s.push({file:p,deps:new Set([...i].filter(u=>!f.has(u)))});return{profiles:s,distinctiveDeps:r}}function g(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let s of r)n.set(s,(n.get(s)??0)+1);let f=Math.max(3,Math.ceil(l*.03));for(let[r,s]of n)s>=5&&s/l>.3?e.add(r):s<=f&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function D(t,e,o,l){let n=new Set;for(let i of t.deps)e.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let f=0;for(let i of n)l.has(i)&&f++;if(f<2)return null;let r=a(t.deps,e.deps);if(r<o)return null;let s=[];for(let i of t.deps)e.deps.has(i)||s.push(i);let p=[];for(let i of e.deps)t.deps.has(i)||p.push(i);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:s,uniqueToB:p}}export{F as a};
2
- //# sourceMappingURL=chunk-LPL4MA6R.js.map
@@ -1,2 +0,0 @@
1
- import{a as C,b as k,c as o,d as f}from"./chunk-BZ53S4ZN.js";import{a as V}from"./chunk-3VD3JMK2.js";import{a as B,b}from"./chunk-YWOOQ4FF.js";import{c as y}from"./chunk-YZA6PPZL.js";function L(e,i={}){let{minSimilarity:u=.45,minSharedBehaviors:a=6,limit:r=20,scope:n,scanLimit:c,filePattern:d,focusFiles:h}=i,t=y(e,{scope:n,minBehaviorTokens:Math.max(3,a),scanLimit:c}).map(s=>({file:s.file,tokens:s.behaviorTokens,profile:s}));return V({profiles:t,limit:r,filePattern:d,focusFiles:h,compare:(s,l)=>R(s,l,u,a),sort:(s,l)=>l.similarity-s.similarity||s.fileA.localeCompare(l.fileA)||s.fileB.localeCompare(l.fileB)})}function R(e,i,u,a){let r=B(e.tokens,i.tokens);if(r.size<a||!P(r))return null;let n=k(e.tokens,i.tokens);if(n<u)return null;let c=o(r,"composable:"),d=o(r,"store:"),h=o(r,"reactivity:"),t=o(r,"lifecycle:"),s=o(r,"request:"),l=o(r,"function:"),g=o(r,"function-verb:"),v=o(r,"template-binding:"),p=o(r,"template-event:"),m=F({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p});return{fileA:e.file,fileB:i.file,similarity:n,sharedTokens:f(r),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:f(b(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(b(i.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:s,sharedLifecycle:t,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v}),locA:e.profile.totalLines,locB:i.profile.totalLines}}function F(e){return C({genericWords:q,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:T})}function T(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let i=0,u=0,a=0,r=0,n=0,c=0,d=0;for(let s of e)s.startsWith("composable:")?i+=1:s.startsWith("store:")?u+=1:s.startsWith("request:")?a+=1:s.startsWith("lifecycle:")?r+=1:s.startsWith("function:")?n+=1:s.startsWith("reactivity:")?c+=1:(s.startsWith("function-verb:")||s.startsWith("template-binding:")||s.startsWith("template-event:"))&&(d+=1);let h=i+u,t=h+a+r+n+d;return a>=1&&t>=4||r>=1&&n>=2&&t>=4||h>=2&&(a>=1||n>=2)&&t>=5||n>=2&&c>=1&&t>=4}function S(e){let i=[];return e.sharedComposables.length&&i.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&i.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&i.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&i.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&i.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&i.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&i.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),i.join("; ")||"shared Vue behavior profile"}var q=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
2
- //# sourceMappingURL=chunk-LZHUWKGD.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-PFOCOG57.js";import{a as m}from"./chunk-5OST6GYB.js";import{a as d}from"./chunk-BGBBVSH4.js";import{c as u}from"./chunk-JM72FNGA.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-M4COR2H6.js.map
@@ -1,2 +0,0 @@
1
- import{b as h}from"./chunk-B75HZHUP.js";import{a as u}from"./chunk-5OST6GYB.js";import{a as o}from"./chunk-BGBBVSH4.js";import{e as p}from"./chunk-OLTESY4K.js";import{c as y}from"./chunk-JM72FNGA.js";function W(m,c={}){let{scope:I,minLoc:C=3,scanLimit:r}=c,s=new u(m),d=c.semantic!==!1,b=h(s.productionCallableDefinitions({scope:I,minLoc:C,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof r=="number"&&r>0}),r),l=s.symbolsWithNonSelfCallees(b,{additive:!1,semantic:!1}),i=b.filter(e=>!l.has(e.symbolId)),L=s.crossFileCallerMap(i,{semantic:!1}),a=new Set(L.keys());for(let e of s.frameworkReferencedSymbolIds(i))a.add(e);let t=i.filter(e=>!a.has(e.symbolId));if(d&&t.length>0){for(let e of p(m,t).keys())a.add(e);for(let e of s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))l.add(e);t=t.filter(e=>!a.has(e.symbolId)).filter(e=>!l.has(e.symbolId))}let S=s.sourceFallbackCallerFiles(t);for(let e of S.keys())a.add(e);let f=t.filter(e=>!a.has(e.symbolId)),v=s.symbolsWithNonSelfCallees(f,{additive:!0,semantic:d});for(let e of v)l.add(e);return f.filter(e=>!l.has(e.symbolId)).sort((e,n)=>o(n)-o(e)||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine).map(e=>({symbol:e.symbol,shortName:y(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{W as a};
2
- //# sourceMappingURL=chunk-O6ZH6C6Y.js.map
@@ -1,3 +0,0 @@
1
- import{a as w}from"./chunk-XUGQU7PM.js";import{a as v}from"./chunk-64MNV6AB.js";import{a as O,d as D,f as P}from"./chunk-7S5E7KWT.js";function V(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Rt=P("stripped-lines",{clearGroups:["whole-project","source-file"]});O({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,h=""},clearFile:()=>{_=null,h=""}});var _=null,h="";function Y(t){return _===t||(_=t,h=V(t)),h}function Ct(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${X(n)}\\b`,"m").test(t)}function jt(t,n){let e=new Set,r=new RegExp(`\\b${X(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as K,dirname as S,extname as p,join as g,relative as m,resolve as u}from"path";var Q=D("indexed-paths",{clearGroups:[]}),Z=D("indexed-path-digest",{clearGroups:[]}),I=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],b=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],G=[".php"],q=new Set(I),R=new Set(b),J=new Set(k),C=new Set(A),$=new Set(L),M=new Set(W),B=new Set(H),j=new Set(U),F=new Set(G),tt=[{extensions:I,lookup:q},{extensions:b,lookup:R},{extensions:k,lookup:J},{extensions:A,lookup:C},{extensions:L,lookup:$},{extensions:W,lookup:M},{extensions:H,lookup:B},{extensions:U,lookup:j},{extensions:G,lookup:F}];function x(t,n){return n.has(p(t).toLowerCase())}function nt(t){return x(t,R)}function et(t){return x(t,J)}function rt(t){return x(t,C)}function ot(t){return x(t,$)}function st(t){return x(t,M)}function it(t){return x(t,B)}function kt(t){return p(t).toLowerCase()===".vb"}function ct(t){return x(t,j)}function at(t){return x(t,F)}function lt(t){let n=p(t).toLowerCase();for(let e of tt)if(e.lookup.has(n))return e.extensions;return I}function ut(t){return et(t)||it(t)||at(t)}function At(t,n,e){return nt(n)?pt(t,n,e):rt(n)?ft(t,n,e):ot(n)?St(t,n,e):st(n)?xt(t,n,e):ut(n)?dt(t,e.replace(/\\/g,"."),lt(n)):ct(n)?Et(t,n,e):gt(t,n,e)}function gt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=E(t);for(let c of _t(o)){let a=d(m(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(m(t.config.projectRoot,o))}function pt(t,n,e){let r=E(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of ht(o)){let c=d(m(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function ft(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),y(t,mt(s))}function St(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return y(t,It(o))}function xt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return y(t,o)}function dt(t,n,e){let r=E(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,N=[...r].find(z=>z.endsWith(l));if(N)return N}for(let i of e){let l=[...r].find(N=>K(N)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function Et(t,n,e){let r=E(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of Nt(s)){let a=d(m(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function ht(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function y(t,n){let e=E(t);for(let r of n){let o=d(m(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function It(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function Nt(t){let n=p(t);return j.has(n)?[t]:[`${t}.dart`,t]}function _t(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of I)e.add(t.slice(0,-n.length)+r)}else for(let r of I)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function E(t){return Q.get(t,()=>new Set(v(t,{includeIgnored:!1}).map(d)))}function Lt(t){return Z.get(t,()=>w([...E(t)].sort().join(`
2
- `)))}function d(t){return t.replace(/\\/g,"/")}export{I as a,b,k as c,A as d,L as e,W as f,H as g,U as h,G as i,kt as j,lt as k,At as l,pt as m,ft as n,St as o,xt as p,dt as q,Et as r,Lt as s,d as t,V as u,Ct as v,$t as w,jt as x,yt as y};
3
- //# sourceMappingURL=chunk-OBGRLXWF.js.map
@@ -1,3 +0,0 @@
1
- import{a as k,b as S}from"./chunk-TQ5W2H3S.js";import{l as H}from"./chunk-OBGRLXWF.js";import{f as D}from"./chunk-2KHTSEIL.js";import{d as P,e as oe}from"./chunk-JM72FNGA.js";import{c as ne,g as ie,i as re}from"./chunk-XUGQU7PM.js";import{a as O}from"./chunk-64MNV6AB.js";import{a as ee,c as te}from"./chunk-7S5E7KWT.js";import{performance as m}from"perf_hooks";function b(r,t,e){if(r.has(t))return r.get(t);let n=e();return r.set(t,n),n}import se from"path";function Ae(r,t){return r.getReferences().map(e=>{let n=e.getNode();return U(n,t)})}function Oe(r){let t=r;return typeof t.findReferences=="function"?t.findReferences():[]}function ae(r,t,e,n){let i=[];for(let o of Oe(r))for(let s of Ae(o,n))s.file===t.relativePath&&s.line>=t.startLine&&s.line<=t.endLine||i.push(s);for(let o of e)i.push(o);return C(i)}function ce(r,t,e,n){let i=[],o=e?.getStart();for(let s of r.getReferences()){let a=s.getNode();N(n,a.getSourceFile().getFilePath())===t&&(o!==void 0&&a.getStart()===o||i.push({location:U(a,n),node:a}))}return i}function U(r,t){let e=r.getSourceFile(),n=e.getLineAndColumnAtPos(r.getStart());return{file:N(t,e.getFilePath())??e.getBaseName(),line:n.line-1,column:n.column-1}}function le(r,t,e){let n=r.getSourceFile(),i=$(n,r),o=r.getText(),s=new RegExp(`\\b${Ue(o)}\\b`,"g"),a=n.getFullText().split(`
2
- `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let d=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(d))!==null;)c.push({file:t,line:l,column:p.index})}return C(c.filter(l=>N(e,se.join(e,l.file))===t))}function _(r){for(let t=r;t;t=t.getParent()){let e=t.getKindName();if(e.includes("Type")||e==="InterfaceDeclaration"||e==="TypeAliasDeclaration")return!0;if(e==="CallExpression"||e==="NewExpression"||e==="ExpressionStatement")return!1}return!1}function $(r,t){return r.getLineAndColumnAtPos(t.getStart()).line-1}function C(r){let t=new Set,e=[];for(let n of r){let i=`${n.file}:${n.line}:${n.column}`;t.has(i)||(t.add(i),e.push(n))}return e}function N(r,t){let e=se.relative(r||process.cwd(),t).replace(/\\/g,"/");return!e||e.startsWith("..")?null:e}function Ue(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(r,t,e,n){let i=We(t,n);return i.size===0?new Map:Be(r,e,i)}function We(r,t){let e=new Map;for(let n of D(r,t)){let i=P(n.symbol)??n.leaf;if(!i)continue;let o=e.get(i);o||(o=[],e.set(i,o)),o.push(n)}return e}function Be(r,t,e){let n=new Map,i=new Map;return t.forEachDescendant(o=>{for(let s of He(r,o)){let a=e.get(s);if(!a)continue;let c=$(t,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),p=i.get(l.symbolId);p!==void 0&&p<=d||(i.set(l.symbolId,d),n.set(l.symbolId,o))}}}),n}function He(r,t){let e=[],n=i=>{i&&!e.includes(i)&&e.push(i)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let i=t.getNameNode();n(i?.getText())}if("getName"in t&&typeof t.getName=="function"){let i=t.getName();n(i)}return r.Node.isIdentifier(t)&&n(t.getText()),e}var _e=te("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function de(r,t,e,n){let i=me(r,t),o=pe(i.get(n)??[],e);if(o)return o;let s=[];for(let a of i.values())for(let c of a)((c.leaf||P(c.symbol)||"").includes(n)||c.symbol.includes(n))&&s.push(c);return pe(s,e)}function ue(r,t){let e=new Map;for(let[n,i]of me(r,t)){let o=i[0];o&&e.set(n,o)}return e}function me(r,t){return _e.get(r,t,()=>{let e=new Map;for(let n of D(r,t)){let i=n.leaf||P(n.symbol);if(!i)continue;let o=e.get(i);o||(o=[],e.set(i,o)),o.push({...n,leaf:i})}for(let n of e.values())n.sort((i,o)=>i.startLine-o.startLine||i.endLine-o.endLine||i.symbolId-o.symbolId);return e})}function pe(r,t){let e=null,n=Number.POSITIVE_INFINITY;for(let i of r){let o=Math.abs(i.startLine-t);(o<n||o===n&&e&&i.startLine<e.startLine)&&(e=i,n=o)}return e}import z from"path";var T=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function R(r){let t=r.toLowerCase();return T.some(e=>t.endsWith(e))}function ge(r,t){let e=new Map,n=null,i=null,o=()=>(i??=O(r,{extensions:T}),i),s=()=>(n??=S("typescript.source-file-index",()=>$e(r.config.projectRoot,t,o()),()=>({projects:t.length,indexedDocuments:o().length})),n),a=c=>R(c)?b(e,c,()=>{let l=w(z.resolve(r.config.projectRoot,c));for(let{project:d,sourceFiles:p}of s()){let f=p.get(l)??null;if(f||(f=d.addSourceFileAtPathIfExists(l)??null,f&&p.set(w(f.getFilePath()),f)),f)return{project:d,sourceFile:f}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:o}}function $e(r,t,e){let n=t.map(({project:i})=>({project:i,sourceFiles:new Map(i.getSourceFiles().map(o=>[w(o.getFilePath()),o]))}));for(let i of e){let o=w(z.resolve(r,i));for(let s of n){if(s.sourceFiles.has(o))break;let a=s.project.addSourceFileAtPathIfExists(o)??null;if(a){s.sourceFiles.set(w(a.getFilePath()),a);break}}}return n}function w(r){return z.resolve(r)}import F from"path";import{existsSync as W,readdirSync as ze,readFileSync as ye}from"fs";function he(r){let t=F.join(r,"package.json");if(!W(t))return[];let e;try{e=JSON.parse(ye(t,"utf8"))}catch{return[]}return(Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[]).flatMap(i=>Ve(r,i)).flatMap(i=>qe(r,i))}function Ve(r,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let s=F.join(r,t);return W(F.join(s,"package.json"))?[s]:[]}let e=t.indexOf("*"),n=t.slice(0,e).replace(/\/$/,""),i=t.slice(e+1).replace(/^\//,""),o=F.join(r,n||".");if(!W(o))return[];try{return ze(o).map(s=>F.join(o,s,i)).filter(s=>W(F.join(s,"package.json")))}catch{return[]}}function qe(r,t){try{let e=JSON.parse(ye(F.join(t,"package.json"),"utf8"));if(!e.name)return[];let n=F.relative(r,t).replace(/\\/g,"/");return[{name:e.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function Se(r,t){for(let e of r)if(t===e.name||t.startsWith(`${e.name}/`))return e.name;return null}function be(r){return[`${r.sourceRootRelative}/index.ts`,`${r.sourceRootRelative}/index.tsx`,`${r.sourceRootRelative}/index.mts`,`${r.sourceRootRelative}/index.cts`]}import{existsSync as L,readFileSync as Je,readdirSync as Ke,statSync as Ge}from"fs";import h from"path";var q=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function J(r,t){let n=t?h.dirname(h.join(r,t)):r,i=h.resolve(r);for(;n.startsWith(i);){for(let s of q){let a=h.join(n,s);if(L(a))return a}let o=h.dirname(n);if(o===n)break;n=o}for(let o of q){let s=h.join(r,o);if(L(s))return s}return null}function Me(r){let t=r.config.projectRoot,e=new Set(Ye(t,r.config.semantic?.typescript?.tsconfigs)),n=O(r,{includeIgnored:!1,extensions:T});for(let i of n){let o=J(t,i);o&&e.add(h.resolve(o))}if(e.size===0){let i=J(t);i&&e.add(h.resolve(i))}return[...e].filter(i=>!Ie(t,i)).sort((i,o)=>i.localeCompare(o))}function Ye(r,t=[]){let e=new Set;for(let n of t){let i=h.isAbsolute(n)?n:h.join(r,n);L(i)&&e.add(h.resolve(i))}for(let n of Xe(r))for(let i of q){let o=h.join(n,i);L(o)&&e.add(h.resolve(o))}if(e.size===0){let n=J(r);n&&e.add(h.resolve(n))}return[...e].filter(n=>!Ie(r,n)).sort((n,i)=>n.localeCompare(i))}function Xe(r){let t=h.join(r,"package.json");if(!L(t))return[];let e;try{e=JSON.parse(Je(t,"utf8"))}catch{return[]}return(Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[]).flatMap(i=>Qe(r,i))}function Qe(r,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let s=h.join(r,t);return V(s)?[s]:[]}let e=t.indexOf("*"),n=t.slice(0,e).replace(/\/$/,""),i=t.slice(e+1).replace(/^\//,""),o=h.join(r,n||".");return V(o)?Ke(o).map(s=>h.join(o,s,i)).filter(V):[]}function V(r){try{return Ge(r).isDirectory()}catch{return!1}}function Ie(r,t){let e=h.relative(r,t).replace(/\\/g,"/");return e.startsWith("..")||e.includes("/node_modules/")||e.startsWith("node_modules/")||e.includes("/dist/")||e.startsWith("dist/")}import{createRequire as Ze}from"module";var et=Ze(import.meta.url),j;function xe(){if(j!==void 0)return j;try{j=et("ts-morph")}catch{j=null}return j}function ke(r,t){return t.map(e=>({tsconfigPath:e,project:new r.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0})}))}function B(r,t,e){return{language:"typescript",availability:()=>({available:!1,reason:r,tsconfigPath:t,tsconfigPaths:e}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var tt=32;function Ce(r,t){let e=S("typescript.provider.load",()=>xe());if(!e)return B("ts-morph is not installed");let n=S("typescript.provider.tsconfig-discovery",()=>Me(r));if(n.length===0)return B("no tsconfig found");try{let i=S("typescript.provider.project-bundles",()=>ke(e,n),()=>({tsconfigs:n.length}));return S("typescript.provider.construct",()=>new K(r,e,i),()=>({tsconfigs:n.length}))}catch(i){return B(i instanceof Error?i.message:String(i),n[0],n)}}var K=class{constructor(t,e,n){this.db=t;this.tsMorph=e;this.projects=n;this.workspacePackages=he(t.config.projectRoot),this.sourceFiles=ge(t,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return b(this.importUsageCache,t,()=>{let e=this.sourceFiles.sourceFile(t);if(!e)return[];let n=it();return S("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,e,n),()=>({file:t,...n}))})}referencesFor(t){return b(this.referencesCache,t.symbolId,()=>{let e=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,e)})}referencesForDefinitions(t){let e=new Map,n=k(),i=[];for(let c of t){let l=this.referencesCache.get(c.symbolId);l?e.set(c.symbolId,l):i.push(c)}if(i.length===0)return e;let o=i,s=i.filter(c=>!ve(c));if(s.length>=tt){let c=this.referencesForDefinitionsBySymbolScan(s);for(let l of s){let d=c.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),e.set(l.symbolId,d)}if(o=i.filter(l=>ve(l)),o.length===0)return e}let a=new Map;for(let c of o){let l=a.get(c.relativePath);l?l.push(c):a.set(c.relativePath,[c])}for(let[c,l]of a){let d=De();S("typescript.references-map.file",()=>{let p=this.definitionNodesForFile(c);for(let f of l){n&&(d.cacheMisses+=1);let u=p.get(f.symbolId)??null;n&&(u?d.nodeHits+=1:d.nodeMisses+=1);let g=this.referencesForDefinitionNode(f,u,n?d:void 0);this.referencesCache.set(f.symbolId,g),e.set(f.symbolId,g)}},()=>({relativePath:c,definitions:l.length,...Re(d)}))}return e}referencesForDefinitionsBySymbolScan(t){let e=k(),n=De(),i=new Map,o=new Set(t.map(a=>a.symbolId)),s=new Map(t.map(a=>[a.symbolId,a]));for(let a of t)i.set(a.symbolId,[]);return S("typescript.references-map.inverted-scan",()=>{let a=e?m.now():0;for(let p of t){let f=this.packageImportReferencesForDefinition(p);if(f.length>0){let u=i.get(p.symbolId)??[];u.push(...f),i.set(p.symbolId,u)}e&&(n.packageReferenceCount+=f.length)}e&&(n.packageRefsMs+=m.now()-a);let c=new Map,l=new Set(t.map(p=>p.leaf).filter(Boolean)),d=e?m.now():0;for(let p of this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(p))continue;let f=this.sourceFiles.sourceFile(p);f&&(e&&(n.scanFiles+=1),this.addReferencesFromSourceFileScan(f,p,o,s,l,c,i,e?n:void 0))}e&&(n.scanMs+=m.now()-d);for(let[p,f]of i){let u=C(f);i.set(p,u),e&&(n.referenceCount+=u.length)}},()=>({definitions:t.length,...Re(n)})),i}addReferencesFromSourceFileScan(t,e,n,i,o,s,a,c){let l=this.compilerCheckerForSourceFile(t),d=t.compilerNode,p=st(t),f=u=>{if(this.tsMorph.ts.isIdentifier(u)){if(c&&(c.identifiers+=1),!o.has(u.text)&&!p.has(u.text)){this.tsMorph.ts.forEachChild(u,f);return}let g=this.compilerReferenceSymbol(l,u,c);if(g){let y;if(s.has(g)?y=s.get(g)??null:(y=this.definitionFromCompilerSymbol(g),s.set(g,y)),c&&(y?c.targetHits+=1:c.targetMisses+=1),y&&n.has(y.symbolId)){c&&(c.requestedHits+=1);let v=i.get(y.symbolId);if(v&&!ct(v,e,Fe(d,u))){let I=a.get(y.symbolId)??[],A=d.getLineAndCharacterOfPosition(u.getStart(d));I.push({file:e,line:A.line,column:A.character}),a.set(y.symbolId,I)}}}}this.tsMorph.ts.forEachChild(u,f)};f(d)}compilerReferenceSymbol(t,e,n){n&&(n.symbolLookups+=1);let i=t.getSymbolAtLocation(e);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return n&&(n.aliasResolutions+=1),t.getAliasedSymbol(i)}catch{return i}}}calleesFor(t){return b(this.calleesCache,t.symbolId,()=>b(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath)).get(t.symbolId)??[])}calleesForDefinitions(t){let e=new Map,n=new Map;for(let i of t){let o=n.get(i.relativePath);o?o.push(i):n.set(i.relativePath,[i])}for(let[i,o]of n){let s=this.fileCalleesCache.get(i),a=new Set(o.map(l=>l.symbolId)),c=s??this.calleeMapForFile(i,a);for(let l of o){let d=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,d),e.set(l.symbolId,d)}}return e}referencesForDefinitionNode(t,e,n){let i=n?m.now():0,o=this.packageImportReferencesForDefinition(t);if(n&&(n.packageRefsMs+=m.now()-i,n.packageReferenceCount+=o.length),!e)return o;let s=n?m.now():0,a=ae(e,t,o,this.db.config.projectRoot);return n&&(n.semanticRefsMs+=m.now()-s,n.referenceCount+=a.length),a}signatureFor(t){return b(this.signatureCache,t.symbolId,()=>{let e=this.nodeForDefinition(t);if(!e||!this.tsMorph.Node.isFunctionDeclaration(e)&&!this.tsMorph.Node.isMethodDeclaration(e)&&!this.tsMorph.Node.isArrowFunction(e)&&!this.tsMorph.Node.isFunctionExpression(e)&&!this.tsMorph.Node.isConstructorDeclaration(e))return null;let n=e.getType().getCallSignatures()[0];if(!n)return null;let i=n.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return Pe(c)}),o=n.getReturnType().getText(e);return`(${i.join(",")})=>${Pe(o)}`})}importUsageForSourceFile(t,e,n){let i=[],o=new Map;for(let s of e.getImportDeclarations()){n.declarations+=1;let a=H(this.db,t,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of G(s)){n.entries+=1;let d=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(d?n.bindingSymbols+=1:n.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:d,references:[]};if(i.push(p),c||!l.localName||!d)continue;let f=o.get(l.localName);f?f.push(p):o.set(l.localName,[p])}}return o.size>0&&e.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||rt(s))return;n.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(n.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:U(s,this.db.config.projectRoot),node:s}),n.matchedReferences+=1;break}}}),i.map(s=>s.typeOnlyDeclaration?nt(t,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(n.fallbackEntries+=1,this.valueImportUsageForEntry(t,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(t,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(t,e,n){let i=n.identifier?n.identifier.findReferences():[],o=[];for(let s of i)for(let a of ce(s,t,n.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(t,e,n,o)}valueImportUsageFromLocations(t,e,n,i){let o=i.some(c=>!_(c.node)),s=i.some(c=>_(c.node)),a=n.isTypeOnly;return{importer:t,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:a,isUsed:a||i.length>0,isTypeUsed:a||s,isValueUsed:o,references:i.map(c=>c.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,e=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,e,n);for(let[n,i]of t)t.set(n,C(i));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,e,n){if(this.db.isIgnored(n))return;let i=this.sourceFiles.sourceFileMatch(n);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,e,n,o)}addPackageImportReferencesForDeclaration(t,e,n,i){let o=Se(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=e.get(o);if(s)for(let a of G(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=le(a.identifier,n,this.db.config.projectRoot);l.length>0&&pt(t,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let t=new Map;for(let e of this.workspacePackages){let n=new Map;for(let i of be(e))this.collectPackageExports(e,i,n,new Set);n.size>0&&t.set(e.name,n)}return this.packageExportIndex=t,t}collectPackageExports(t,e,n,i){if(i.has(e))return;i.add(e);let o=this.sourceFiles.sourceFile(e);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?H(this.db,e,a):e;if(!c||!c.startsWith(`${t.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(t,c,n,i);continue}for(let d of l){let p=d.getNameNode().getText(),f=d.getAliasNode()?.getText()??p,u=this.indexedDefinitionByLeaf(c,p);if(!u)continue;let g=n.get(f);g||(g=new Set,n.set(f,g)),g.add(u.symbolId)}}}indexedDefinitionByLeaf(t,e){return b(this.indexedDefinitionLeafCache,t,()=>ue(this.db,t)).get(e)??null}nodeForDefinition(t){return b(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return b(this.fileDefinitionNodeCache,t,()=>{let e=this.sourceFiles.sourceFile(t);return e?fe(this.tsMorph,this.db,e,t):new Map})}definitionFromCompilerSymbol(t,e){let n=t.name,i=e?m.now():0,o=t.declarations??[];e&&(e.declarationsMs+=m.now()-i,e.declarationChecks+=o.length);for(let s of o){let a=e?m.now():0,c=s.getSourceFile(),l=N(this.db.config.projectRoot,c.fileName),d=c.getLineAndCharacterOfPosition(s.getStart(c)).line;if(e&&(e.declarationLocationMs+=m.now()-a),!l||this.db.isIgnored(l))continue;let p=e?m.now():0,f=de(this.db,l,d,n);if(e&&(e.indexedLookupMs+=m.now()-p),f)return{symbolId:f.symbolId,symbol:f.symbol,file:f.relativePath,line:f.startLine}}return null}calleeMapForFile(t,e){let n=k(),i=0,o=0,s=0,a=0,c=0,l=0,d=0,p=0,f=n?lt():void 0;return S("typescript.callee-map.file",()=>{let u=n?m.now():0,g=this.sourceFiles.sourceFile(t);if(n&&(c=Math.round(m.now()-u)),!g)return new Map;let y=n?m.now():0,v=D(this.db,t).sort((M,x)=>M.startLine-x.startLine||x.endLine-M.endLine);if(n&&(l=Math.round(m.now()-y)),i=v.length,v.length===0)return new Map;let I=new Map,A=n?m.now():0,Le=this.compilerCheckerForSourceFile(g),Q=g.compilerNode;n&&(d=Math.round(m.now()-A));let je=new Map,Z=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){n&&(o+=1);let x=this.semanticCalleeForCallNode(Le,Q,v,M,je,e,f);x&&(n&&(s+=1),ot(I,x.callerId,x.target))}this.tsMorph.ts.forEachChild(M,Z)},Ee=n?m.now():0;Z(Q),n&&(p=Math.round(m.now()-Ee));for(let[M,x]of I)I.set(M,dt(x));return a=I.size,I},()=>({relativePath:t,definitions:i,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:e?.size??i,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:d,traversalMs:p,...f?ft(f):{}}))}semanticCalleeForCallNode(t,e,n,i,o,s,a){let c=a?m.now():0,l=at(n,Fe(e,i));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let d=i.expression,p=this.compilerSymbolForExpression(t,d,a),f=null;if(p)if(a&&(a.targetSymbolHits+=1),o.has(p))a&&(a.compilerSymbolCacheHits+=1),f=o.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let u=a?m.now():0;f=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-u),o.set(p,f)}else a&&(a.targetMisses+=1);return f?{callerId:l.symbolId,target:{symbol:f.symbol,file:f.file,line:f.line}}:null}compilerSymbolForExpression(t,e,n){let i=n?m.now():0,o=t.getSymbolAtLocation(e);if(n&&(n.expressionSymbolMs+=m.now()-i),o)return o;n&&(n.typeFallbacks+=1);let s=n?m.now():0,a=t.getTypeAtLocation(e).getSymbol();return n&&(n.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(t){let e=t.getProject(),n=this.compilerCheckerCache.get(e);return n||(n=e.getTypeChecker().compilerObject,this.compilerCheckerCache.set(e,n)),n}};function G(r){let t=[],e=r.getDefaultImport();e&&t.push({identifier:e,importedName:"default",localName:e.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let n=r.getNamespaceImport();n&&t.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let i of r.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);t.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function nt(r,t,e){return{importer:r,sourcePath:t,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function it(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function rt(r){for(let t=r;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function ot(r,t,e){let n=r.get(t);n||(n=[],r.set(t,n)),n.push(e)}function st(r){let t=new Set;for(let e of r.getImportDeclarations())for(let n of G(e))n.localName&&t.add(n.localName);return t}function at(r,t){let e=null;for(let n of r)t<n.startLine||t>n.endLine||(!e||n.startLine>=e.startLine)&&(e=n);return e}function Fe(r,t){return r.getLineAndCharacterOfPosition(t.getStart(r)).line}function ct(r,t,e){return t===r.relativePath&&e>=r.startLine&&e<=r.endLine}function ve(r){return r.symbol.includes("#")?oe(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function lt(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function ft(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function De(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0}}function Re(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs)}}function pt(r,t,e){for(let n of t){let i=r.get(n)??[];i.push(...e),r.set(n,i)}}function dt(r){let t=new Set,e=[];for(let n of r){let i=`${n.symbol}|${n.file}|${n.line}`;t.has(i)||(t.add(i),e.push(n))}return e}function Pe(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var Y=new WeakMap;ee({name:"semantic-provider",groups:["semantic-provider"],clearAll:r=>Y.delete(r)});function X(r,t){let e=`${r.config.projectRoot}:typescript-workspace`,n=Y.get(r);n||(n=new Map,Y.set(r,n));let i=n.get(e);if(i)return i;let o=Ce(r,t);return n.set(e,o),o}function dn(r,t){let e=E(r,t);return e?e.importUsage(t):[]}function un(r,t){let e=E(r,t.relativePath);return e?e.referencesFor(t):[]}function mn(r,t){let e=k(),n=new Map,i=ne(r),o=[],s=[],a=[],c=0,l=0,d=0,p=0;if(S("semantic.references.cache-scan",()=>{for(let f of t){if(!i||!R(f.relativePath)){e&&!R(f.relativePath)&&(c+=1),a.push(f);continue}let u=ie(r,f.relativePath,f.symbol,i);if(u!==null){let g=mt(u);if(g){e&&(l+=1),p+=Te(r,n,f,g);continue}e&&(d+=1)}s.push(f)}},()=>({definitions:t.length,skippedNonTs:c,cacheHits:l,parseFailures:d,misses:s.length,unkeyed:a.length,resultRows:n.size,callerFiles:p})),s.length>0||a.length>0){let f=[...a,...s],u=0,g=S("semantic.references.compute-misses",()=>{let y=ut(r,f);return u=y.size,y},()=>({definitions:f.length,misses:s.length,unkeyed:a.length,rows:u}));for(let y of f)p+=Te(r,n,y,g.get(y.symbolId)??[]);if(i)for(let y of s)o.push({relativePath:y.relativePath,symbol:y.symbol,projectFingerprint:i,payload:JSON.stringify(g.get(y.symbolId)??[])})}return o.length>0&&(X(r).availability().available?S("semantic.references.cache-write",()=>re(r,o),()=>({entries:o.length})):S("semantic.references.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",entries:o.length}))),n}function ut(r,t){let e=k(),n=new Map,i=0,o=0,s=0,a=0;return S("semantic.references.provider-loop",()=>{let c=new Map,l=[];for(let d of t){let p=E(r,d.relativePath);if(!p){e&&(o+=1);continue}if(e&&(i+=1),p.referencesForDefinitions){let f=c.get(p);f?f.push(d):c.set(p,[d])}else l.push({provider:p,definition:d})}for(let[d,p]of c){let f=d.referencesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];Ne(n,u.symbolId,g,e,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.referencesFor(p);Ne(n,p.symbolId,f,e,u=>{s+=1,a+=u})}return n},()=>({definitions:t.length,providerHits:i,providerMisses:o,definitionsWithReferences:s,referenceCount:a,rows:n.size}))}function Ne(r,t,e,n,i){r.set(t,e),n&&e.length>0&&i(e.length)}function Te(r,t,e,n){let i=0;for(let o of n){if(o.file===e.relativePath||r.isIgnored(o.file))continue;let s=t.get(e.symbolId);s||(s=new Set,t.set(e.symbolId,s));let a=s.size;s.add(o.file),s.size!==a&&(i+=1)}return i}function mt(r){try{return JSON.parse(r)}catch{return null}}function gn(r,t){let e=k(),n=new Map,i=0,o=0,s=0,a=0;return S("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let d of t){let p=E(r,d.relativePath);if(!p){e&&(o+=1);continue}e&&(i+=1);let f=d;if(p.calleesForDefinitions){let u=c.get(p);u?u.push(f):c.set(p,[f])}else l.push({provider:p,definition:f})}for(let[d,p]of c){let f=d.calleesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];we(n,u.symbolId,g,e,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.calleesFor(p);we(n,p.symbolId,f,e,u=>{s+=1,a+=u})}return n},()=>({definitions:t.length,providerHits:i,providerMisses:o,definitionsWithCallees:s,calleeCount:a,rows:n.size}))}function we(r,t,e,n,i){e.length>0&&(r.set(t,e),n&&i(e.length))}function yn(r,t){let e=E(r,t.relativePath);return e?e.signatureFor(t):null}function E(r,t){if(!R(t))return null;let e=X(r,t);return e.availability().available?e:null}export{R as a,X as b,dn as c,un as d,mn as e,gn as f,yn as g};
3
- //# sourceMappingURL=chunk-OLTESY4K.js.map
@@ -1,4 +0,0 @@
1
- import{a as X,d as R}from"./chunk-BSN22NRK.js";import{a as P,b as z}from"./chunk-TQ5W2H3S.js";import{b as j,d as O,e as L,j as B,k as A}from"./chunk-XUGQU7PM.js";import{existsSync as G,readFileSync as F}from"fs";import{join as x}from"path";function U(t,n){let e=K(t,n)??Q(t,n)??V(t,n)??Y(t,n);return tt(t,e,n)}function K(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=w(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(w(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function w(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function Q(t,n){if(!I(t[n]??""))return null;let e=n;for(;e>0&&I(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&I(t[i]??"");)i+=1;return{start:e,end:i}}function I(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function V(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(v(o)!==null)break;if(E(o)!==null)return null;e-=1}if(e<0)return null;let i=v(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=v(o);if(s!==null){if(s<=i)break;r+=1;continue}if(E(o)!==null)break;r+=1}return{start:e,end:r}}function v(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function Y(t,n){let e=t[n]??"";if($(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&H(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&H(t[r]??"");)r+=1;return{start:i,end:r}}function H(t){return E(t)===null}function E(t){return t.trim().length===0?"blank":$(t)?"heading":w(t)?"fence":I(t)?"table":v(t)!==null?"list":null}function $(t){return/^#{1,6}\s+/.test(t.trim())}function tt(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
- `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function _(t,n){return n.filter(e=>t.includes(e))}var b=/\.(?:md|mdx|rst|txt)$/i;function nt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var et=3,it=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function kt(t,n={}){let{doc:e,limit:i=20,minCoupling:r=et}=n,o=ct(t);if(!o)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let s=[];for(let c of o.docFiles){if(e!==void 0&&!c.includes(e)||e===void 0&&!W(t,c)||e!==void 0&&!G(x(t.config.projectRoot,c)))continue;let u=Math.max(0,...o.changeTimes.get(c)??[]),f=rt(t,c),d=new Map,{resolved:h,broken:l,citations:g}=dt(t,c,o.tracked,o.trackedBySuffix,o.everSeenInHistory),m=new Map(g.map(a=>[a.file,a.contexts]));for(let a of h){if(a===c||b.test(a))continue;let p=(o.changeTimes.get(a)??[]).filter(S=>S>u).length;p!==0&&d.set(a,{file:a,evidence:"reference",coChanges:0,changesSinceDocUpdate:p,...N("reference",f),citationContexts:m.get(a)})}for(let[a,p]of o.coupling.get(c)??[]){if(p<r||!o.tracked.has(a))continue;let S=(o.changeTimes.get(a)??[]).filter(T=>T>u).length;if(S===0)continue;let C=d.get(a);C?(C.evidence="both",C.coChanges=p,Object.assign(C,N("both",f))):d.set(a,{file:a,evidence:"co-change",coChanges:p,changesSinceDocUpdate:S,...N("co-change",f)})}if(d.size===0&&l.length===0)continue;let D=[...d.values()].sort((a,p)=>p.changesSinceDocUpdate-a.changesSinceDocUpdate);s.push({doc:c,docLastChangedAt:u,staleness:D.reduce((a,p)=>a+p.changesSinceDocUpdate,0)+l.length*10,subjects:D.slice(0,8),brokenReferences:l})}return s.sort((c,u)=>u.staleness-c.staleness),{available:!0,commitsAnalyzed:o.historyCommitCount,docsScanned:o.docFiles.length,findings:s.slice(0,i)}}function rt(t,n){let e;try{e=F(x(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
3
- ${e}`.toLowerCase(),r=_(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=_(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function N(t,n){return{actionTier:ot(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function ot(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function ct(t){let n=X(t);if(!n)return null;let e=R(t)??new Set,i=new Map,r=new Map,o=new Set;for(let s of n.commits){let c=[...new Set(s.files)],u=c.filter(d=>b.test(d)),f=c.filter(d=>!b.test(d));for(let d of c){o.add(d);let h=i.get(d)??[];h.push(s.timestamp),i.set(d,h)}for(let d of u){let h=r.get(d);h||(h=new Map,r.set(d,h));for(let l of f)h.set(l,(h.get(l)??0)+1)}}return{changeTimes:i,coupling:r,docFiles:[...e].filter(s=>b.test(s)),everSeenInHistory:o,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:Z(e)}}function At(t,n){if(n.size===0)return[];let e=P(),i=0,r=0,o=0,s=0,c=0,u=0;return z("doc-reference.docs-citing-files",()=>{let f=R(t)??new Set;i=f.size;let d=Z(f),h=st(n,d),l=[];for(let g of f){if(!W(t,g))continue;e&&(r+=1);let m;try{m=F(x(t.config.projectRoot,g),"utf-8")}catch{e&&(o+=1);continue}if(!ut(m,h)){e&&(s+=1);continue}let D=J(t,g,m);if(!D)continue;e&&(c+=1);let a=at(D.candidates,n,h,f,d);if(a.size===0)continue;let p=[...new Set([...a.values()].flatMap(y=>[...y]))],S=lt(D.contextsByCandidate,p),C=[...a].map(([y,k])=>({file:y,contexts:M([...k].flatMap(q=>S.get(q)??[])).slice(0,3)})).filter(y=>y.contexts.length>0),T=[...a.keys()];if(T.length>0){e&&(u+=1);let y=T.sort();l.push({doc:g,cited:y,citations:C,citedClaims:M(C.flatMap(k=>k.contexts)).slice(0,3)})}}return l},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:u}))}function W(t,n){return b.test(n)&&!nt(n)&&G(x(t.config.projectRoot,n))}function Z(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function st(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function at(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(i.has(s))c=s;else{let f=r.get(s);f?.length===1&&(c=f[0])}if(!c||!n.has(c))continue;let u=o.get(c)??new Set;u.add(s),o.set(c,u)}return o}function dt(t,n,e,i,r){let o=new Set,s=new Set,c=J(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let u=c.candidates,f=c.contextsByCandidate,d=new Map,h=(l,g)=>{let m=f.get(g);if(!m||m.length===0)return;let D=d.get(l)??[];D.push(...m),d.set(l,M(D).slice(0,3))};for(let l of u){if(e.has(l)){o.add(l),h(l,l);continue}let g=i.get(l);if(g&&g.length===1){o.add(g[0]),h(g[0],l);continue}g&&g.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...d].map(([l,g])=>({file:l,contexts:g}))}}function lt(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function J(t,n,e){let i=e;if(i===void 0)try{i=F(x(t.config.projectRoot,n),"utf-8")}catch{return null}let r=j(t,n,i),o=O(t,"doc-path-evidence",n,r);if(o!==null){let c=ht(o);if(c)return c}let s=ft(i);return L(t,"doc-path-evidence",n,r,gt(s)),s}function ut(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function ft(t){let n=t.split(/\r?\n/),e=new Set,i=new Map;for(let r=0;r<n.length;r+=1){let o=n[r]??"";for(let s of o.matchAll(it)){let c=s[0].replace(/^\.?\//,"");e.add(c);let u=U(n,r);if(u.length===0)continue;let f=i.get(c)??[];f.push(u),i.set(c,M(f).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i}}function gt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()]};return JSON.stringify(n)}function ht(t){try{let n=JSON.parse(t);if(!B(n))return null;let e=A(n.candidates),i=pt(n.contextsByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i)}}catch{return null}}function pt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=A(e[1]);if(!i)return null;n.push([e[0],i])}return n}function M(t){let n=[];for(let e of new Set(t))n.some(i=>mt(i,e))||n.push(e);return n}function mt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{U as a,_ as b,nt as c,kt as d,At as e};
4
- //# sourceMappingURL=chunk-P4KYUPBD.js.map
@@ -1,4 +0,0 @@
1
- import{a as oe,b as ie,c as P,d as ae,e as pe,f as ce,g as j,h as me,i as F,j as le,k as ue,l as _,m as U,n as T,o as G,p as Y,q as S,r as K,s as Z,t as J,v as R,w as h,x as M,y as ee}from"./chunk-OBGRLXWF.js";import{b as ge}from"./chunk-YZA6PPZL.js";import{a as de,b as fe,d as C}from"./chunk-HF25DFSC.js";import{a as v}from"./chunk-DS6QEB3G.js";import{b as B,d as V,e as Q}from"./chunk-XUGQU7PM.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as Se}from"path";var je=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&&je.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function b(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,ue(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 O(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function D(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 z(t,r,e,s){let n=C(t,r),o=de(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function he(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=Se(o).replace(/\.[^.]+$/,"");return[$(o,i,Y(t,r,o),h(n,i))]})}function Me(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(m=>m.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");n.push(f(i,a,Y(t,r,i),s))}return n}function xe(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:K(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function ye(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:K(t,r,o)})}return s}function Ne(t,r,e){return z(t,r,{csharp:s=>qe(t,r,s),vb:s=>$e(t,r,s)},()=>{let s=le(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*/),c=!!p,m=(c?p:a)?.trim()??i,l=m.split(".").pop()??m,u=c?a?.trim()??l:l;return[b(t,r,o,m,l,u,S(t,m,j))]})})}function $e(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,c=a.text,m=c.split(".").pop()??c,l=p?.text??m;n.push(f(m,l,S(t,c,j),s,p?"namespace":"named"))}return n}function qe(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 c=p.text,m=c.split(".").pop()??c,l=a?.text??m;n.push(f(m,l,S(t,c,j),s,a?"namespace":"named"))}return n}var Fe=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ie(t,r){return Fe.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 te(t,r,e){return I(t,r,s=>We(t,r,s),()=>Ue(t,r,e))}function Ue(t,r,e){return Ze(e).flatMap(s=>et(t,r,s.clause,s.specifier,s.start,s.end,e))}function We(t,r,e){let s=Je(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...ze(t,r,e,o,s));return n}function Je(t,r,e){let s=g(e,new Set(["import_statement"]));if(fe(r))for(let n of Ie(t,r))s.add(n);return s}function ze(t,r,e,s,n){let o=Qe(s);if(!o)return[];let i=_(t,r,o),a=y(s,"import_clause");return a?Xe(e,a,i,n,Ge(s.text)):[O("*",i)]}function Xe(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(He(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Be(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ve(i,e,s,n));return o}function He(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Be(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ke(t,i);return D("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Ve(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,c=a?.text??p;n.push(f(p,c,r,e,"named",{isTypeOnly:s||Ye(o.text)}))}return n}function Qe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Ge(t){return/^\s*import\s+type\b/.test(t)}function Ye(t){return/^\s*type\b/.test(t.trim())}function Ke(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 et(t,r,e,s,n,o,i){let a=_(t,r,s),p=R(i,n,o);return e?tt(e).map(m=>({...m,sourcePath:a})).map(m=>{if(m.kind==="namespace"){let l=M(p,m.localName);return D(m.importedName,m.sourcePath,{localName:m.localName,usedMembers:l,used:l.length>0||h(p,m.localName),isTypeOnly:m.isTypeOnly})}return m.kind==="side-effect"?O(m.importedName,m.sourcePath):$(m.importedName,m.localName??"",m.sourcePath,m.localName?h(p,m.localName):!1,m.kind,[],{isTypeOnly:m.isTypeOnly})}):[O("*",a)]}function tt(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=rt(s),i=[];return n&&i.push(...Pe(n,e)),o&&i.push(...Pe(o,e)),i}function Pe(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,c]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(c??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 rt(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 re(t,r,e){let s=C(t,r);return s?pt(t,r,s):st(t,r,e)}function st(t,r,e){return[...nt(t,r,e),...ot(t,r,e),...it(t,r,e)]}function nt(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=>at(l.trim())).filter(l=>!!l),c=q(e,o.index),m=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:_(t,r,a),names:p,startLine:c,endLine:m})}return s}function ot(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:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function it(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:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function at(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 pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ct(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=mt(n,o,i,a);s.push(p)}return s}function ct(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return _(t,r,n.text)}function mt(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),c=a.namedChild(1);p&&i.push((c??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 be(t,r,e){return z(t,r,{java:s=>lt(t,r,s),kotlin:s=>ut(t,r,s),scala:s=>dt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ft(t,r,o,n):[]}))}function lt(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 c=p.text;if(i){n.push(D("*",S(t,c,P)));continue}let m=c.split(".").pop()??c;n.push(f(m,m,S(t,c,P),s))}return n}function ut(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(D("*",S(t,i.text,P)));continue}let c=i.text,m=c.split(".").pop()??c,u=p?.namedChild(0)?.text??m;n.push(f(m,u,S(t,c,P),s))}return n}function dt(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(D("*",S(t,p,P)));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 E=u.text,A=d?.text??E;if(E==="_")continue;n.push(f(E,A,S(t,`${p}.${E}`,P),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,P),s))}continue}let c=a[a.length-1]?.text??p,m=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(c,c,S(t,m&&a.length>1?`${m}.${c}`:p,P),s))}return n}function ft(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,c]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),m=p?.trim();if(!m||m==="_")return[];let l=(c??m.split(".").pop()??m).trim(),u=m==="_"?n:`${n}.${m}`.replace(/\.\./g,".");return[b(t,r,s,u,m,l)]})}return[b(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function _e(t,r,e){return I(t,r,s=>gt(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,c]=a.split(/\s+as\s+/i),m=p?.trim()??a,l=m.split("\\").pop()??m,u=(c??l).trim();return[b(t,r,n,m,l,u,S(t,m.replace(/\\/g,"."),F))]}):[]}))}function gt(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,"."),F),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(c=>c.type==="namespace_name")?.text??"";for(let c of a.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:m,localName:l,qualified:u}=Ee(c,p);m&&o(u,m,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:c,localName:m,qualified:l}=Ee(p,"");c&&o(l,c,m)}}return n}function Ee(t,r){let e=t.namedChildren.find(c=>c.type==="qualified_name"),s=t.namedChildren.filter(c=>c.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 Re(t,r,e){return I(t,r,s=>St(t,r,s),()=>xt(e).flatMap(s=>Nt(t,r,s,e)))}function St(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=Te(i);if(!a)continue;let p=U(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=ht(i);if(a===null)continue;let p=U(t,r,a);for(let c=1;c<o.namedChildCount;c+=1){let m=o.namedChild(c);if(m.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Te(m);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Te(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 ht(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 xt(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,c=a+o.length,m=ee(o);for(;n+1<r.length&&(m>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
- ${u}`,c+=1+u.length,m+=ee(u),s+=u.length+1}let l=yt(p);l&&e.push({...l,start:a,end:c})}return e}function yt(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 Nt(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 c=p.trim().replace(/,$/,"");if(!c)return[];let[m,l]=c.split(/\s+as\s+/),u=m.trim(),d=(l??u.split(".")[0]??u).trim(),E=U(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:E,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?U(t,r,e.module):null,a=[];for(let p of x(o)){let c=p.trim().replace(/,$/,"");if(!c)continue;if(c==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[m,l]=c.split(/\s+as\s+/),u=(l??m).trim();a.push({importedName:m.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as It}from"path";function Ce(t,r,e){return I(t,r,s=>bt(t,r,s),()=>Pt(t,r,e))}function Pt(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"?G(t,r,i):null;if(a){let p=Oe(i);return[$(p,p,a,h(n,p))]}return[O(i,a)]})}function bt(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 c=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!c||c.type!=="string")continue;let l=c.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?G(t,r,l):null;if(u){let d=Oe(l);n.push(f(d,d,u,s))}else n.push(O(l,u))}return n}function Oe(t){return ge(It(t).replace(/\.[^.]+$/,""),/_/)}function De(t,r,e){return I(t,r,s=>Et(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?_t(t,r,o,n):[]}))}function Et(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 W(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 W(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:X(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:X(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=X(r,e.text),o=[];for(let i of s.namedChildren)o.push(...W(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...W(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=W(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:X(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function X(t,r){return t?r?`${t}::${r}`:t:r}function _t(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let m=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[E,A]=d.split(/\s+as\s+/),w=E?.trim();if(!w)return[];let we=(A??w.split("::").pop()??w).trim(),Le=`${m}::${w}`.replace(/::::/g,"::");return[b(t,r,s,Le,w.split("::").pop()??w,we,T(t,r,m))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),c=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[b(t,r,s,a,a.split("::").pop()??a,p,c)]}function ke(t,r,e){let s=C(t,r);if(s)return Tt(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(...Ct(t,r,i))}return n}function Tt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Rt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of W(o,""))i.importedName&&s.push(se(t,r,i.qualifiedName))}return s}function Rt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Ct(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+/),c=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[se(t,r,c)]})}return[se(t,r,s)]}function se(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 Ae(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 Ot={language:"javascript",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:te,parseReExports:re},Dt=k({language:"python",extensions:ie,imports:"ast-with-regex-fallback",parseImports:Re}),kt=k({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:be}),At={language:"rust",extensions:ae,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:De,parseExports:ke},wt=k({language:"ruby",extensions:pe,imports:"ast-with-regex-fallback",parseImports:Ce}),Lt=k({language:"c/cpp",extensions:ce,imports:"ast-with-regex-fallback",parseImports:he}),jt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),vt={language:"dart",extensions:me,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:xe,parseExports:ye},Mt=k({language:"php",extensions:F,imports:"ast-with-regex-fallback",parseImports:_e}),$t=[Ot,Dt,kt,At,wt,Lt,jt,vt,Mt];function H(t){return Ae($t,t)}var ne={clearGroups:["whole-project","source-file"]},qt=L("source-imports",ne),Ft=L("source-exports",ne),Ut=L("source-reexports",ne);function ns(t,r){let e=J(r);return Ut.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-reexports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.reExports))return c.reExports}catch{}let p=s.parseReExports(t,e,n);return Q(t,"source-reexports",e,o,JSON.stringify({resolutionFingerprint:i,reExports:p})),p})}function os(t,r){let e=J(r);return qt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-imports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.imports))return c.imports}catch{}let p=s.parseImports(t,e,n);return Q(t,"source-imports",e,o,JSON.stringify({resolutionFingerprint:i,imports:p})),p})}function is(t,r){let e=J(r);return Ft.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{ns as a,os as b,is as c};
4
- //# sourceMappingURL=chunk-P5RYBRIO.js.map