scip-query 0.10.10 → 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 (279) 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-J7RWXLUL.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-XXZXDXTD.js → chunk-5GXTUANY.js} +2 -2
  10. package/dist/{chunk-TL6QPNF5.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-Z4I7BVIU.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-5NVUWIAN.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-7UQWUVRG.js → chunk-AZBELWZQ.js} +2 -2
  23. package/dist/{chunk-WG6KRH5F.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-736BLPHR.js → chunk-DFSEARAU.js} +2 -2
  27. package/dist/{chunk-UFX7EPBA.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-ZQO43G2T.js → chunk-KZ4MG5NY.js} +2 -2
  45. package/dist/{chunk-UQLFQLAF.js → chunk-L446VQYQ.js} +2 -2
  46. package/dist/{chunk-NZ4UDB5N.js → chunk-LDJUB7XW.js} +2 -2
  47. package/dist/{chunk-MMLZEGMS.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-PTQVNJ4Q.js → chunk-NBNEVLRC.js} +2 -2
  53. package/dist/chunk-NTSR6SRP.js +2 -0
  54. package/dist/{chunk-RYXW3KRC.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-RGKRYO22.js +4 -0
  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-IPQTC36U.js → chunk-RXINFVBN.js} +2 -2
  64. package/dist/{chunk-RXRLZFUL.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-DQVKIG3D.js → chunk-T4N2ZRVY.js} +2 -2
  70. package/dist/{chunk-5VG7RKEF.js → chunk-TBCHRDAC.js} +2 -2
  71. package/dist/chunk-THB6AM3V.js +11 -0
  72. package/dist/chunk-ULHLDOD6.js +4 -0
  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-3DGD6NKW.js → chunk-VB2EZZPA.js} +2 -2
  77. package/dist/{chunk-56P7PDST.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-UYD7FJ3K.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-UDGXK2WA.js → chunk-ZUUNREKS.js} +2 -2
  86. package/dist/cli.js +277 -252
  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 +4 -4
  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 +55 -16
  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 +2 -2
  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/skills/scip-hyper-optimization/SKILL.md +153 -24
  224. package/skills/scip-hyper-optimization/agents/openai.yaml +3 -3
  225. package/dist/chunk-2UYQLFVC.js +0 -2
  226. package/dist/chunk-2VM46FC5.js +0 -8
  227. package/dist/chunk-3Q77KKEY.js +0 -2
  228. package/dist/chunk-3VD3JMK2.js +0 -2
  229. package/dist/chunk-4KTOV4QN.js +0 -3
  230. package/dist/chunk-4N4WONI4.js +0 -102
  231. package/dist/chunk-65AU3HFZ.js +0 -2
  232. package/dist/chunk-6LNQOOTB.js +0 -2
  233. package/dist/chunk-72KY2ZFO.js +0 -2
  234. package/dist/chunk-7JRRXGVZ.js +0 -2
  235. package/dist/chunk-A536TEU4.js +0 -3
  236. package/dist/chunk-A6IDHNMC.js +0 -4
  237. package/dist/chunk-A6TANQNV.js +0 -2
  238. package/dist/chunk-AW2QHPLL.js +0 -4
  239. package/dist/chunk-BSN22NRK.js +0 -9
  240. package/dist/chunk-C5CTSJ6X.js +0 -6
  241. package/dist/chunk-CCKPYPDI.js +0 -35
  242. package/dist/chunk-CZ425R2B.js +0 -18
  243. package/dist/chunk-DS6QEB3G.js +0 -5
  244. package/dist/chunk-F6ICF7HL.js +0 -40
  245. package/dist/chunk-FAYI6KZ5.js +0 -2
  246. package/dist/chunk-FG4NT6VY.js +0 -2
  247. package/dist/chunk-FRPEPTYJ.js +0 -5
  248. package/dist/chunk-GBEYTDY5.js +0 -2
  249. package/dist/chunk-GRJY65YT.js +0 -2
  250. package/dist/chunk-HF25DFSC.js +0 -3
  251. package/dist/chunk-HHN2B5KA.js +0 -2
  252. package/dist/chunk-I46WR7MT.js +0 -10
  253. package/dist/chunk-JM72FNGA.js +0 -2
  254. package/dist/chunk-KX5PLFZ5.js +0 -3
  255. package/dist/chunk-LPL4MA6R.js +0 -2
  256. package/dist/chunk-LZHUWKGD.js +0 -2
  257. package/dist/chunk-OBGRLXWF.js +0 -3
  258. package/dist/chunk-P5RYBRIO.js +0 -4
  259. package/dist/chunk-PFOCOG57.js +0 -2
  260. package/dist/chunk-PKMZCDQD.js +0 -4
  261. package/dist/chunk-QPU7EXAW.js +0 -2
  262. package/dist/chunk-QVI3NR7E.js +0 -7
  263. package/dist/chunk-QX7LLCGB.js +0 -23
  264. package/dist/chunk-RVWSAMTT.js +0 -2
  265. package/dist/chunk-SGLLBSCV.js +0 -2
  266. package/dist/chunk-SULEXAHO.js +0 -38
  267. package/dist/chunk-TH2N6QHW.js +0 -2
  268. package/dist/chunk-UWYJDBDW.js +0 -2
  269. package/dist/chunk-VUKC6F77.js +0 -20
  270. package/dist/chunk-W2CBNBEL.js +0 -71
  271. package/dist/chunk-XIVO4SDZ.js +0 -2
  272. package/dist/chunk-XSNRACLV.js +0 -3
  273. package/dist/chunk-XUGQU7PM.js +0 -41
  274. package/dist/chunk-Y6E3JHC4.js +0 -2
  275. package/dist/chunk-YBEEVDJQ.js +0 -2
  276. package/dist/chunk-YGHUVQLR.js +0 -2
  277. package/dist/chunk-YWDVDAD7.js +0 -2
  278. package/dist/chunk-YZA6PPZL.js +0 -3
  279. package/dist/chunk-ZU6PROUY.js +0 -2
@@ -1,5 +0,0 @@
1
- import{a as j,b as w,e as A,f as T,g as M,h as G,i as U}from"./chunk-YWOOQ4FF.js";import{b as E}from"./chunk-B75HZHUP.js";import{a as R}from"./chunk-GBEYTDY5.js";import{a as P}from"./chunk-SULEXAHO.js";import{a as L}from"./chunk-PTQVNJ4Q.js";import{c as b,d as D,g as I}from"./chunk-JM72FNGA.js";import{a as _,b as v}from"./chunk-DS6QEB3G.js";import{b as q,d as $,e as O}from"./chunk-XUGQU7PM.js";import{d as C}from"./chunk-7S5E7KWT.js";function Ve(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,o=ue(e,n,{semantic:t.semantic!==!1});if(!o)return[];if(!I(o.symbol))return[];if(o.callees.size===0)return K(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit});let s=oe(e,o,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return s.length>0?s.slice(0,r):K(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit})}function oe(e,n,t,i){let r=Z(e,{minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),o=pe(n,r),s=ae(n,r),a=T(s),l=M(n.callees,s),c=[];for(let u of o){if(u.callees.size<3)continue;let m=M(u.callees,s),d=H(n,u,s,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:a,magnitudeA:l,magnitudeB:m});d&&c.push(d)}return c.sort((u,m)=>m.similarity-u.similarity),c}function ae(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return A(t,n.corpus.length+1)}function H(e,n,t,i){let r=i.magnitudeA===void 0||i.magnitudeB===void 0?G(e.callees,n.callees,t,{medianIdf:i.medianIdf}):U(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB}),{similarity:o,significantShared:s,trivialShared:a}=r;if(o<i.minSimilarity)return null;let l=s.length+a.length;if(s.length<i.requireSignificantShared&&l<i.requireSharedCount)return null;let c=s.length>0?s:a,u=J(c,"callees");return{symbolA:e.symbol,shortNameA:b(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:b(n.symbol),fileB:n.file,similarity:o,similarityBasis:"callees",sharedCallees:c.map(b),uniqueToA:[...w(e.callees,n.callees)].map(b),uniqueToB:[...w(n.callees,e.callees)].map(b),...u}}function We(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:o=4,crossFileOnly:s=!1,scanLimit:a}=n,l=Z(e,{minCallees:o,scope:r,scanLimit:a,semantic:n.semantic!==!1}),c=l.corpus,u=n.focusFiles,m=[],d=0;for(let g=0;g<c.length;g+=1){let f=c[g],x=u?.has(f.file)??!1,y=l.weightedMagnitudes[g],F=new Set;for(let S of f.callees){let p=l.candidateIndexesByCallee.get(S);if(p)for(let h of p)h<=g||u&&!x&&!u.has(c[h].file)||F.add(h)}for(let S of F){let p=c[S];if(s&&f.file===p.file)continue;if(f.paramCount>=0&&p.paramCount>=0){let re=Math.abs(f.paramCount-p.paramCount),se=Math.max(2,Math.ceil(Math.max(f.paramCount,p.paramCount)*.5));if(re>se)continue}let h=H(f,p,l.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:l.medianIdf,magnitudeA:y,magnitudeB:l.weightedMagnitudes[S]});h&&(le(m,h,i,d),d+=1)}}return m.sort((g,f)=>f.result.similarity-g.result.similarity||g.order-f.order),m.map(g=>g.result)}function le(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let s=1;s<e.length;s+=1){let a=e[s],l=e[r];(a.result.similarity<l.result.similarity||a.result.similarity===l.result.similarity&&a.order>l.order)&&(r=s)}let o=e[r];n.similarity<=o.result.similarity||(e[r]={result:n,order:i})}var ce=["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 ue(e,n,t){let i=L(e,n);if(!i||!I(i.symbol))return null;let r=new R(e),o=P(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:X(o.map(s=>s.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var me=C("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),fe=C("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ge(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:o}=n,s=n.semantic!==!1,a=me.get(e,()=>new Map),l=`${t}|${i??""}|${o??""}|${s}`,c=a.get(l);return c||(c=be(e,{minCallees:t,scope:i,scanLimit:o,semantic:s}),a.set(l,c)),r===void 0?c:c.filter(u=>u.symbol!==r)}function Z(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,o=n.semantic!==!1,s=fe.get(e,()=>new Map),a=`${t}|${i??""}|${r??""}|${o}`,l=s.get(a);return l||(l=de(ge(e,{minCallees:t,scope:i,scanLimit:r,semantic:o})),s.set(a,l)),l}function de(e){let n=new Map;for(let s of e)for(let a of s.callees)n.set(a,(n.get(a)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=A(n,e.length),r=e.map(s=>M(s.callees,i)),o=new Map;for(let s=0;s<e.length;s+=1){let a=e[s];for(let l of a.callees){if((n.get(l)??0)>t)continue;let c=o.get(l);c||(c=[],o.set(l,c)),c.push(s)}}return{corpus:e,candidateIndexesByCallee:o,docFreq:n,idfWeights:i,weightedMagnitudes:r,medianIdf:T(i),ubiquityThreshold:t}}function pe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let o=n.corpus[r];o.symbol!==e.symbol&&t.set(o.symbol,o)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function be(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:o}=n,s=new R(e),a=E(s.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r),l=s.calleeMap(a,{semantic:o});return a.map(c=>({symbol:c.symbol,file:c.relativePath,callees:X((l.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:s.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=t)}function X(e){return new Set([...e].filter(n=>!ye(n)))}function ye(e){return ce.some(n=>e.includes(n))}function K(e,n,t){let i=Ce(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,o=[],s=ve(i,Re(e,{scanLimit:t.scanLimit}));for(let a of s){if(a.symbol===i.symbol||a.tokens.size<3)continue;let l=j(i.tokens,a.tokens);if(l.size<2)continue;let c=new Set([...i.tokens,...a.tokens]),u=c.size>0?l.size/c.size:0;u<r||o.push({symbolA:i.symbol,shortNameA:b(i.symbol),fileA:i.file,symbolB:a.symbol,shortNameB:b(a.symbol),fileB:a.file,similarity:u,similarityBasis:"source-tokens",sharedCallees:[...l].sort(),uniqueToA:[...w(i.tokens,a.tokens)].sort(),uniqueToB:[...w(a.tokens,i.tokens)].sort(),...J([...l],"source-tokens")})}return o.sort((a,l)=>l.similarity-a.similarity||a.shortNameB.localeCompare(l.shortNameB)),o.slice(0,t.limit)}function J(e,n){let t=e.flatMap(B),i=e.flatMap(y=>V(y,n)),r=N(t,Q),o=N(t,Y),s=N(i,z),a=[...new Set(i.filter(W))],l=e.filter(y=>{let F=V(y,n);return F.some(S=>z.has(S))&&F.some(W)}).length,c=[];r.length>0&&c.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),o.length>0&&c.push(`framework/generic scaffolding: ${o.slice(0,5).join(", ")}`),s.length>0&&c.push(`domain behavior verbs: ${s.slice(0,5).join(", ")}`),s.length>0&&a.length>0&&c.push(`domain-specific terms: ${a.slice(0,5).join(", ")}`);let u=n==="source-tokens"&&t.length>0&&t.every(y=>ee.has(y));u&&c.push("shared source tokens are generic scaffolding");let m=s.length>0&&a.length>0,d=r.length+o.length>0,g=n==="callees"&&m&&e.length>=4&&a.length>=4&&l>=2,f=g?"domain-behavior":m?d?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":o.length>0||u?"framework-scaffolding":"structural-overlap";f==="structural-overlap"&&e.length>0&&c.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let x=f==="domain-behavior"&&(e.length>=3||g)?"direct":"signal";return{evidenceClass:f,actionTier:x,evidenceClassReasons:c,recommendation:Se(f,x)}}function Se(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 N(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function B(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function V(e,n){if(n==="source-tokens")return B(e);let t=D(e);return B(t.length>0?t:he(e))}function he(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 W(e){return e.length>3&&!z.has(e)&&!Q.has(e)&&!Y.has(e)&&!ee.has(e)&&!Fe.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"]),Q=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),Y=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"]),ee=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),Fe=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 Ce(e,n){let t=L(e,n);if(!t||!I(t.symbol))return null;let i=we(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function we(e,n){let t=D(n.symbol),i=Ee(e,n.relativePath,n.startLine,n.endLine,t),r=te(i,t);return r.size>0?r:null}var ke=C("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),xe=C("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ne(e){return`${e.scanLimit??""}`}function Ie(e,n={}){let t=ke.get(e,()=>new Map),i=ne(n),r=t.get(i);return r||(r=De(e,n),t.set(i,r)),r}function Re(e,n={}){let t=xe.get(e,()=>new Map),i=ne(n),r=t.get(i);return r||(r=Me(Ie(e,n)),t.set(i,r)),r}function Me(e){let n=new Map;for(let r of e)for(let o of r.tokens)n.set(o,(n.get(o)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let o of r.tokens){if((n.get(o)??0)>t)continue;let s=i.get(o);s||(s=[],i.set(o,s)),s.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function ve(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 De(e,n={}){let t=new R(e),{scanLimit:i}=n,r=E(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return Le(e,r)}function Le(e,n){let t=new Map;for(let r of n){let o=t.get(r.relativePath)??[];o.push(r),t.set(r.relativePath,o)}let i=new Map;for(let[r,o]of t){let s=_(e,r);if(!s)continue;let a=q(e,r,s),l=Te(e,r,a),c=!1,u=null;for(let m of o){let d=Ae(m),g=l.get(d),f=g?new Set(g.tokens):null;f||(u??=v(e,r),f=te(ie(u,m.startLine,m.endLine,m.leaf),m.leaf),l.set(d,{key:d,symbol:m.symbol,startLine:m.startLine,endLine:m.endLine,leaf:m.leaf,tokens:[...f].sort()}),c=!0),f.size>0&&i.set(m.symbol,{symbol:m.symbol,file:m.relativePath,tokens:f})}c&&Ne(e,r,a,l)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function Ee(e,n,t,i,r){let o=v(e,n);return o.length===0?"":ie(o,t,i,r)}function ie(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
2
- `);let r=[new RegExp(`\\bdef\\s+${k(i)}\\b`),new RegExp(`\\bfun\\s+${k(i)}\\b`),new RegExp(`\\bfn\\s+${k(i)}\\b`),new RegExp(`\\bfunction\\s+${k(i)}\\b`),new RegExp(`\\b${k(i)}\\s*\\(`)],o=e.findIndex(s=>r.some(a=>a.test(s)));if(o>=0){let s=o;for(let a=o+1;a<e.length&&a<=o+8;a++){let l=e[a]??"";if(a>o&&ze(l)||(s=a,l.trim()===""&&a>o+1))break}return e.slice(o,s+1).join(`
3
- `)}return e.slice(n,Math.min(e.length,n+8)).join(`
4
- `)}function Ae(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function Te(e,n,t){let i=$(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 o=new Map;for(let s of r.entries){if(!s||typeof s.key!="string"||typeof s.symbol!="string"||typeof s.startLine!="number"||typeof s.endLine!="number"||typeof s.leaf!="string"||!Array.isArray(s.tokens)||!s.tokens.every(a=>typeof a=="string"))return new Map;o.set(s.key,s)}return o}catch{return new Map}}function Ne(e,n,t,i){let r={entries:[...i.values()].sort((o,s)=>o.key.localeCompare(s.key))};O(e,"source-fingerprints",n,t,JSON.stringify(r))}function te(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=Be(n),o=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(s=>s.trim()).filter(s=>s.length>1).filter(s=>!t.has(s)).filter(s=>!i.has(s));return new Set(o)}function Be(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 ze(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Ve as a,ae as b,We as c,le as d,ge as e,Z as f,de as g,pe as h,X as i,J as j};
5
- //# sourceMappingURL=chunk-FRPEPTYJ.js.map
@@ -1,2 +0,0 @@
1
- import{b as R,f as j,g as V}from"./chunk-C5CTSJ6X.js";import{a as F}from"./chunk-BGBBVSH4.js";import{b as z,c as J,d as Q}from"./chunk-UQLFQLAF.js";import{c as _}from"./chunk-SULEXAHO.js";import{a as O,j as H,k as W,m as L,n as Y}from"./chunk-F6ICF7HL.js";import{a as q}from"./chunk-VUKC6F77.js";import{f as h,h as D,i as G}from"./chunk-4N4WONI4.js";import{f as M,g as E,i as K,j as B}from"./chunk-JM72FNGA.js";import{a as w,f as g}from"./chunk-72KY2ZFO.js";import{a as S,b as P}from"./chunk-HF25DFSC.js";import{a as N,d as y}from"./chunk-DS6QEB3G.js";import{c as A}from"./chunk-A536TEU4.js";import{a as k}from"./chunk-64MNV6AB.js";function U(t,e,i){let o=e.identifierResolution==="strict"?L:Y,s=e.candidateNames?H(e.candidateNames):null;for(let n of e.paths)if(!(!S(n)&&!(e.includeVueSfc&&P(n)))&&!t.isIgnored(n)&&!e.skipPath?.(n))try{if(s&&!W(N(t,n),s))continue;let d=(a,c,p,b)=>{if(e.candidateNames&&!e.candidateNames.has(a))return;let I=e.resolveTargets?e.resolveTargets({sourceFile:n,name:a,kind:c,defaultTargets:b}):b();for(let x of I)i({sourceFile:n,name:a,target:x,occurrences:p,kind:c})},m=O(t,n);for(let[a,c]of m)d(a,"identifier",c.length,()=>o(t,n,a));for(let a of g(t,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=a.kind==="cross-language-dispatch"?()=>L(t,n,a.name):()=>o(t,n,a.name);d(a.name,a.kind,a.occurrences,c)}}finally{e.afterPath?.(n)}}function X(t,e={}){let{scope:i,files:o,minLoc:s=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:d=!1,excludeTypesFiles:m=!1,excludeRootedSymbols:a=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:b=!1,includeSuppressed:I=!1,sortByLocDesc:x=!1}=e,C=[],$=te(t,{scope:i,files:o,requireCallableSymbol:p}),v=new Map,T=new Map,ee=r=>{let l=v.get(r);if(l!==void 0)return l;let u=j(t,r);return v.set(r,u),u},ne=r=>{let l=T.get(r);if(l!==void 0)return l;let u=R(r);return T.set(r,u),u};for(let r of $){let l=r.relativePath;if(t.isIgnored(l)||d&&ee(l)||!ie(r,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||f!==void 0&&r.symbol===f)continue;let u=F(r);u<s||u>n||m&&re(l)||a&&V(t,r.symbol,l)||b&&K(r.symbol)||ne(l)!=="test"&&(B(r.symbol)||!I&&y(t,l,r.startLine)||C.push(r))}return x?C.sort((r,l)=>F(l)-F(r)):C}function te(t,e){return e.files!==void 0?[...new Set(e.files.map(o=>o.replace(/\\/g,"/")))].sort().filter(o=>!e.scope||o.includes(e.scope)).flatMap(o=>h(t,o)):e.requireCallableSymbol?G(t,{scope:e.scope,symbolMatches:M,sqlPrefilter:"callable"}):D(t,e.scope)}function ie(t,e){return e.requireCallableSymbol?M(t.symbol):e.requireFunctionLikeSymbol?E(t.symbol):t.isFunctionLike}function re(t){return(t.split("/").pop()??"").includes("types")}var Z=class{constructor(e){this.db=e}db;scopedDefinitions(e){return D(this.db,e)}definitionsForFile(e){return h(this.db,e)}productionCallableDefinitions(e={}){return X(this.db,e)}calleeMap(e,i={}){return _(this.db,e,i)}crossFileCallerMap(e,i={}){return z(this.db,e,i)}sourceFallbackCallerFiles(e){return J(this.db,e)}callerFileMap(e,i={}){return Q(this.db,e,i)}frameworkReferencedSymbolIds(e){let i=new Map;for(let s of e){if(!s.leaf)continue;let n=i.get(s.leaf)??[];n.push(s.symbolId),i.set(s.leaf,n)}let o=new Set;for(let s of k(this.db,{includeIgnored:!1}))if(S(s)==="rust")for(let{name:n}of g(this.db,s,{includeRustAttributeNames:!0}))for(let f of i.get(n)??[])o.add(f);return o}symbolsWithNonSelfCallees(e,i={}){if(e.length===0)return new Set;let o=new Map(e.map(n=>[n.symbolId,n.symbol])),s=this.calleeMap(e,i);return new Set([...s.entries()].filter(([n,f])=>{let d=o.get(n);return f.some(m=>m.symbol!==d)}).map(([n])=>n))}fileDependencyGraph(e){return q(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return y(this.db,e.relativePath,e.startLine)}sourceFiles(){return A(this.db)}scanSourceReferences(e,i){U(this.db,e,i)}callableSignature(e){let i=w(this.db,e.relativePath)?.callables.find(o=>o.startLine===e.startLine&&o.endLine===e.endLine);return i?{paramCount:i.paramCount}:null}};export{Z as a};
2
- //# sourceMappingURL=chunk-GBEYTDY5.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,10 +0,0 @@
1
- import{a as N}from"./chunk-UQLFQLAF.js";import{a as I,b as S}from"./chunk-PTQVNJ4Q.js";import{f as p,l as g}from"./chunk-4N4WONI4.js";import{c as h,e as b}from"./chunk-JM72FNGA.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents consumer_d ON consumer_d.id = c.document_id
5
- WHERE m.symbol_id = ?
6
- AND m.role != 1
7
- AND c.document_id != ?
8
- ${o.pathExclusionsFor("consumer_d")}
9
- ${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
10
- //# sourceMappingURL=chunk-I46WR7MT.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,3 +0,0 @@
1
- import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-GBEYTDY5.js";import{a as g,g as p}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-72KY2ZFO.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(C);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
- `);return j.test(t)?!0:w(i,m(e.symbol))}function w(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${F(e)}\\b`);return n.some(t=>i.test(t))}function C(n){return n.includes("public surface")}function F(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(n){let e=n.some(t=>u(t.symbol))?n.filter(t=>u(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}var j=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{X as a};
3
- //# sourceMappingURL=chunk-KX5PLFZ5.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,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,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
@@ -1,2 +0,0 @@
1
- import{b as d}from"./chunk-B75HZHUP.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
2
- //# sourceMappingURL=chunk-PFOCOG57.js.map
@@ -1,4 +0,0 @@
1
- import{a as O,d as v}from"./chunk-BSN22NRK.js";import{b as E,d as _,e as N,j as F,k as M}from"./chunk-XUGQU7PM.js";import{existsSync as P,readFileSync as X}from"fs";import{join as I}from"path";function L(t,n){let e=G(t,n)??W(t,n)??Z(t,n)??J(t,n);return q(t,e,n)}function G(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=A(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(A(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function A(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function W(t,n){if(!b(t[n]??""))return null;let e=n;for(;e>0&&b(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&b(t[i]??"");)i+=1;return{start:e,end:i}}function b(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function Z(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(x(o)!==null)break;if(k(o)!==null)return null;e-=1}if(e<0)return null;let i=x(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",c=x(o);if(c!==null){if(c<=i)break;r+=1;continue}if(k(o)!==null)break;r+=1}return{start:e,end:r}}function x(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function J(t,n){let e=t[n]??"";if(B(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&j(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&j(t[r]??"");)r+=1;return{start:i,end:r}}function j(t){return k(t)===null}function k(t){return t.trim().length===0?"blank":B(t)?"heading":A(t)?"fence":b(t)?"table":x(t)!==null?"list":null}function B(t){return/^#{1,6}\s+/.test(t.trim())}function q(t,n,e){let{start:i,end:r}=n;if(r-i>40){let c=Math.floor(20);i=Math.max(i,e-c),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 w(t,n){return n.filter(e=>t.includes(e))}var D=/\.(?:md|mdx|rst|txt)$/i;function K(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Q=3,V=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function St(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Q}=n,o=nt(t);if(!o)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let s of o.docFiles){if(e!==void 0&&!s.includes(e)||e===void 0&&!z(t,s)||e!==void 0&&!P(I(t.config.projectRoot,s)))continue;let l=Math.max(0,...o.changeTimes.get(s)??[]),h=Y(t,s),d=new Map,{resolved:g,broken:a,citations:u}=rt(t,s,o.tracked,o.trackedBySuffix,o.everSeenInHistory),p=new Map(u.map(f=>[f.file,f.contexts]));for(let f of g){if(f===s||D.test(f))continue;let m=(o.changeTimes.get(f)??[]).filter(y=>y>l).length;m!==0&&d.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:m,...R("reference",h),citationContexts:p.get(f)})}for(let[f,m]of o.coupling.get(s)??[]){if(m<r||!o.tracked.has(f))continue;let y=(o.changeTimes.get(f)??[]).filter($=>$>l).length;if(y===0)continue;let S=d.get(f);S?(S.evidence="both",S.coChanges=m,Object.assign(S,R("both",h))):d.set(f,{file:f,evidence:"co-change",coChanges:m,changesSinceDocUpdate:y,...R("co-change",h)})}if(d.size===0&&a.length===0)continue;let C=[...d.values()].sort((f,m)=>m.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:s,docLastChangedAt:l,staleness:C.reduce((f,m)=>f+m.changesSinceDocUpdate,0)+a.length*10,subjects:C.slice(0,8),brokenReferences:a})}return c.sort((s,l)=>l.staleness-s.staleness),{available:!0,commitsAnalyzed:o.historyCommitCount,docsScanned:o.docFiles.length,findings:c.slice(0,i)}}function Y(t,n){let e;try{e=X(I(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
3
- ${e}`.toLowerCase(),r=w(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=w(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 R(t,n){return{actionTier:tt(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function tt(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function nt(t){let n=O(t);if(!n)return null;let e=v(t)??new Set,i=new Map,r=new Map,o=new Set;for(let c of n.commits){let s=[...new Set(c.files)],l=s.filter(d=>D.test(d)),h=s.filter(d=>!D.test(d));for(let d of s){o.add(d);let g=i.get(d)??[];g.push(c.timestamp),i.set(d,g)}for(let d of l){let g=r.get(d);g||(g=new Map,r.set(d,g));for(let a of h)g.set(a,(g.get(a)??0)+1)}}return{changeTimes:i,coupling:r,docFiles:[...e].filter(c=>D.test(c)),everSeenInHistory:o,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:H(e)}}function bt(t,n){if(n.size===0)return[];let e=v(t)??new Set,i=H(e),r=et(n,i),o=[];for(let c of e){if(!z(t,c))continue;let s=U(t,c);if(!s)continue;let l=it(s.candidates,n,r,e,i);if(l.size===0)continue;let h=[...new Set([...l.values()].flatMap(u=>[...u]))],d=ot(s.contextsByCandidate,h),g=[...l].map(([u,p])=>({file:u,contexts:T([...p].flatMap(C=>d.get(C)??[])).slice(0,3)})).filter(u=>u.contexts.length>0),a=[...l.keys()];if(a.length>0){let u=a.sort();o.push({doc:c,cited:u,citations:g,citedClaims:T(g.flatMap(p=>p.contexts)).slice(0,3)})}}return o}function z(t,n){return D.test(n)&&!K(n)&&P(I(t.config.projectRoot,n))}function H(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("/"),c=n.get(o)??[];c.push(e),n.set(o,c)}}return n}function et(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 c=r.slice(-o).join("/"),s=n.get(c);s?.length===1&&s[0]===i&&e.add(c)}}return e}function it(t,n,e,i,r){let o=new Map;for(let c of t){if(!e.has(c))continue;let s;if(i.has(c))s=c;else{let h=r.get(c);h?.length===1&&(s=h[0])}if(!s||!n.has(s))continue;let l=o.get(s)??new Set;l.add(c),o.set(s,l)}return o}function rt(t,n,e,i,r){let o=new Set,c=new Set,s=U(t,n);if(!s)return{resolved:o,broken:[],citations:[]};let l=s.candidates,h=s.contextsByCandidate,d=new Map,g=(a,u)=>{let p=h.get(u);if(!p||p.length===0)return;let C=d.get(a)??[];C.push(...p),d.set(a,T(C).slice(0,3))};for(let a of l){if(e.has(a)){o.add(a),g(a,a);continue}let u=i.get(a);if(u&&u.length===1){o.add(u[0]),g(u[0],a);continue}u&&u.length>1||r.has(a)&&c.add(a)}return{resolved:o,broken:[...c],citations:[...d].map(([a,u])=>({file:a,contexts:u}))}}function ot(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 U(t,n){let e;try{e=X(I(t.config.projectRoot,n),"utf-8")}catch{return null}let i=E(t,n,e),r=_(t,"doc-path-evidence",n,i);if(r!==null){let c=at(r);if(c)return c}let o=st(e);return N(t,"doc-path-evidence",n,i,ct(o)),o}function st(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 c of o.matchAll(V)){let s=c[0].replace(/^\.?\//,"");e.add(s);let l=L(n,r);if(l.length===0)continue;let h=i.get(s)??[];h.push(l),i.set(s,T(h).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i}}function ct(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()]};return JSON.stringify(n)}function at(t){try{let n=JSON.parse(t);if(!F(n))return null;let e=M(n.candidates),i=dt(n.contextsByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i)}}catch{return null}}function dt(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=M(e[1]);if(!i)return null;n.push([e[0],i])}return n}function T(t){let n=[];for(let e of new Set(t))n.some(i=>lt(i,e))||n.push(e);return n}function lt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),i=n.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.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),c=e.filter(s=>o.has(s)).length;return c>=3&&c/r>=.6}export{L as a,w as b,K as c,St as d,bt as e};
4
- //# sourceMappingURL=chunk-PKMZCDQD.js.map
@@ -1,2 +0,0 @@
1
- import{e as l}from"./chunk-HF25DFSC.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
2
- //# sourceMappingURL=chunk-QPU7EXAW.js.map
@@ -1,7 +0,0 @@
1
- import{a as L,b as v}from"./chunk-GRJY65YT.js";import{a as S}from"./chunk-LM5SHAN4.js";import{a as y}from"./chunk-PFOCOG57.js";import{a as x}from"./chunk-B75HZHUP.js";import{a as D}from"./chunk-GBEYTDY5.js";import{a as M}from"./chunk-BGBBVSH4.js";import{e as h}from"./chunk-UQLFQLAF.js";import{a as F}from"./chunk-F6ICF7HL.js";import{l as C}from"./chunk-4N4WONI4.js";import{c as d,d as g,j as I}from"./chunk-JM72FNGA.js";import{basename as u,extname as p}from"path";function X(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new D(t),l=R(r.fileDependencyGraph(e));return y({candidates:()=>N(r,e,i),orderCandidates:x,scanLimit:o,prepare:s=>({callerFileMap:_(t,r,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>E(t,r,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function _(t,n,e,i){let a=L(n,e,{semantic:i.semantic,sourceFallback:!1}),o=new Map(e.map(s=>[s.symbolId,s])),r=new Map;for(let s of e){let c=k(t,n,s,a);if(c.length>1||(r.set(s.symbolId,s),c.length!==1))continue;let f=c[0],b=w(t,s.symbolId,f);if(!b)continue;let m=P(n,t,f,s.symbol,b);m?.isFunctionLike&&o.has(m.symbolId)&&r.set(m.symbolId,o.get(m.symbolId))}let l=[...r.values()];return l.length===0?a:h(a,n.sourceFallbackCallerFiles(l))}function E(t,n,e,i){let a=k(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=w(t,e.symbolId,o);if(!r)return null;let l=P(n,t,o,e.symbol,r);if(l&&I(l.symbol))return null;let{fanIn:s,source:c}=j(i.callerFileMap,i.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let f=A(t,e,o,l);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:M(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?d(l.symbol):u(o),callerFanIn:s,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function N(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function k(t,n,e,i){let a=u(e.relativePath,p(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>u(r,p(r))!==a).filter(r=>{let l=n.fileKind(r);return l!=="barrel"&&l!=="entry"&&l!=="test"});return v(t,e,o).realConsumers}function w(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
- LIMIT 1`,n,e)}function P(t,n,e,i,a){let o=t.definitionsForFile(e),r=W(n,e,i,a.start_line,a.end_line);return C(o,r)}function j(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:T(n,e),source:"file"}}function W(t,n,e,i,a){let o=g(e);if(!o)return i;let r=F(t,n).get(o);if(!r||r.length===0)return i;for(let l of r)if(l>=i&&l<=a)return l;return i}function R(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function T(t,n){let e=t.get(n)??0;if(e>0)return e;let i=u(n,p(n)),a=0;for(let[o,r]of t)o!==n&&u(o,p(o))===i&&r>a&&(a=r);return a}function A(t,n,e,i){return S(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):u(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{X as a};
7
- //# sourceMappingURL=chunk-QVI3NR7E.js.map
@@ -1,23 +0,0 @@
1
- import{g as p}from"./chunk-4N4WONI4.js";import{a as f,c as g,e as l}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-64MNV6AB.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},d=new Map;for(let[e,r]of Object.entries(m))d.set(r.toLowerCase(),Number(e));var b=500;function _(e){let r=parseInt(e,10);if(!isNaN(r))return r;let t=e.toLowerCase(),n=d.get(t);if(n!==void 0)return n;for(let[i,o]of d)if(i.includes(t))return o;return null}function O(e,r,t={}){let{scope:n,limit:i=100}=t,o=_(r);return o===null?[]:h(e,n).map(s=>({row:s,resolvedKind:N(s)})).filter(s=>s.resolvedKind===o).slice(0,i).map(({row:s,resolvedKind:u})=>({symbol:s.symbol,shortName:g(s.symbol),kind:u,kindName:m[u]??"Unknown",relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function P(e,r={}){let t=k(e,r.scope);for(let n of S(e,r.scope)){let i=N(n);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((n,i)=>i[1]-n[1]||n[0]-i[0]).map(([n,i])=>({kind:n,kindName:m[n]??"Unknown",count:i}))}function h(e,r){return p(e,{scope:r}).map(K)}function k(e,r){let t=new Map;for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", "),o=e.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
- FROM defn_enclosing_ranges der
3
- JOIN global_symbols gs ON der.symbol_id = gs.id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE gs.kind IS NOT NULL
6
- AND gs.kind != 0
7
- AND gs.symbol NOT LIKE '%#'
8
- AND d.relative_path IN (${i})
9
- GROUP BY gs.kind`,...n);for(let a of o)t.set(a.kind,(t.get(a.kind)??0)+a.count)}return t}function S(e,r){let t=[];for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", ");t.push(...e.all(`SELECT gs.symbol,
10
- gs.kind,
11
- gs.documentation,
12
- gs.enclosing_symbol,
13
- d.relative_path,
14
- der.start_line,
15
- der.end_line
16
- FROM defn_enclosing_ranges der
17
- JOIN global_symbols gs ON der.symbol_id = gs.id
18
- JOIN documents d ON der.document_id = d.id
19
- WHERE (gs.kind IS NULL OR gs.kind = 0 OR gs.symbol LIKE '%#')
20
- ${e.symbolNoiseFor("gs")}
21
- AND d.relative_path IN (${i})
22
- ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...n))}return t}function y(e){let r=[];for(let t=0;t<e.length;t+=b)r.push(e.slice(t,t+b));return r}function K(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function N(e){return e.kind!==null&&e.kind!==0?M(e.kind,e.symbol,e.documentation):R(e.symbol,e.documentation,e.enclosing_symbol)}function M(e,r,t){let n=(t??"").toLowerCase();if(l(r)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function R(e,r,t){let n=f(e);if("kind"in n)return null;let i=n.descriptors,o=i[i.length-2]??null,a=l(e),s=(r??"").toLowerCase();return a==="type"?s.includes("type ")?76:s.includes("interface ")?27:s.includes("struct ")?68:s.includes("trait ")?73:(s.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:s.includes("async def ")||s.includes("def ")?23:(t?l(t):o?.suffix??null)==="type"?21:83}export{O as a,P as b};
23
- //# sourceMappingURL=chunk-QX7LLCGB.js.map
@@ -1,2 +0,0 @@
1
- import{a as p,b as H,c as d,d as u}from"./chunk-BZ53S4ZN.js";import{a as b}from"./chunk-3VD3JMK2.js";import{a as R,b as g}from"./chunk-YWOOQ4FF.js";import{e as v}from"./chunk-HF25DFSC.js";function F(e,r={}){let{minSimilarity:h=.45,minSharedBehaviors:c=6,limit:t=20,scope:n,scanLimit:a,filePattern:l,focusFiles:f}=r,i=v(e,{scope:n,minBehaviorTokens:Math.max(3,c),scanLimit:a}).map(s=>({file:s.file,component:s.name,tokens:s.behaviorTokens,profile:s}));return b({profiles:i,limit:t,filePattern:l,focusFiles:f,compare:(s,o)=>y(s,o,h,c),sort:(s,o)=>o.similarity-s.similarity||s.fileA.localeCompare(o.fileA)||s.componentA.localeCompare(o.componentA)||s.fileB.localeCompare(o.fileB)||s.componentB.localeCompare(o.componentB)})}function y(e,r,h,c){let t=R(e.tokens,r.tokens);if(t.size<c||!A(t))return null;let n=H(e.tokens,r.tokens);if(n<h)return null;let a=d(t,"hook:"),l=d(t,"react-hook:"),f=d(t,"effect:"),i=d(t,"state:"),s=d(t,"request:"),o=d(t,"handler:"),k=d(t,"handler-verb:"),m=B({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k});return{fileA:e.file,componentA:e.component,fileB:r.file,componentB:r.component,similarity:n,sharedTokens:u(t),sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:u(g(e.tokens,r.tokens)).slice(0,25),uniqueToB:u(g(r.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k}),locA:e.profile.loc,locB:r.profile.loc}}function B(e){return p({genericWords:P,stripPrefixes:S,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:C})}function C(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook 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 hook-extraction evidence."}}function A(e){let r=0,h=0,c=0,t=0,n=0,a=0,l=0;for(let s of e)s.startsWith("hook:")?r+=1:s.startsWith("react-hook:")?h+=1:s.startsWith("effect:")?c+=1:s.startsWith("request:")?t+=1:s.startsWith("handler:")||s.startsWith("handler-verb:")?n+=1:s.startsWith("state:")?a+=1:s.startsWith("state-hook:")&&(l+=1);let f=a+l,i=r+h+c+t+n+f;return t>=1&&i>=4||r>=1&&(t>=1||a>=1||n>=2)&&i>=5||a>=1&&n>=2&&(c>=1||h>=2)&&i>=5}function E(e){let r=[];return e.sharedHooks.length&&r.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&r.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&r.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&r.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&r.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&r.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&r.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),r.join("; ")||"shared React behavior profile"}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),S=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{F as a};
2
- //# sourceMappingURL=chunk-RVWSAMTT.js.map
@@ -1,2 +0,0 @@
1
- import{a as I}from"./chunk-MMLZEGMS.js";import{a as H}from"./chunk-J7RWXLUL.js";import{a as p}from"./chunk-WG6KRH5F.js";import{a as T}from"./chunk-3DGD6NKW.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-XXZXDXTD.js";import{a as v,b as F}from"./chunk-IPQTC36U.js";import{b as D}from"./chunk-65AU3HFZ.js";import{b as S}from"./chunk-BSN22NRK.js";import{a as j}from"./chunk-7UQWUVRG.js";import{a as w}from"./chunk-I46WR7MT.js";import{a as P}from"./chunk-56P7PDST.js";import{a as A}from"./chunk-ZQO43G2T.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-SGLLBSCV.js.map
@@ -1,38 +0,0 @@
1
- import{b as j,g as G,h as J,i as B,p as Q}from"./chunk-F6ICF7HL.js";import{a as W,b as U,d as K,f as q}from"./chunk-4KTOV4QN.js";import{a as O}from"./chunk-VUKC6F77.js";import{f as P,g as F,k as H,l as $}from"./chunk-4N4WONI4.js";import{d as T,f as x}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-72KY2ZFO.js";import{a as N}from"./chunk-HF25DFSC.js";import{a as M}from"./chunk-DS6QEB3G.js";import{a as A,b as I,f as v,h as k}from"./chunk-XUGQU7PM.js";import{c as L,d as D}from"./chunk-7S5E7KWT.js";function Le(e,n,l={}){let o=Y(e,[n],{additive:l.additive,semantic:l.semantic}),s=l.callableOnly?(o.get(n.symbolId)??[]).filter(c=>x(c.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?s.slice(0,l.limit):s}function De(e,n,l={}){let o=ne(e)?oe(e,n,{semantic:l.semantic!==!1}):te(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var X=D("caller-rows",{clearGroups:["whole-project"]}),ee=2e4;function ne(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ee}function te(e){return X.get(e,()=>{let n=F(e),l=Y(e,n),o=new Map;for(let i of n)o.set(i.symbol,i.symbolId);let s=new Map,c=new Map;for(let i of n){let a=l.get(i.symbolId);if(!(!a||a.length===0))for(let d of a){let r=o.get(d.symbol);if(r===void 0||r===i.symbolId)continue;let m=s.get(r);m||(m=[],s.set(r,m),c.set(r,new Set));let u=`${i.symbol}|${i.relativePath}`;c.get(r).has(u)||(c.get(r).add(u),m.push({symbol:i.symbol,file:i.relativePath,source:"caller-map-inversion"}))}}return s})}function oe(e,n,l){let o=[],s=new Set,c=a=>{if(a.symbol===n.symbol)return;let d=`${a.symbol}|${a.file}`;s.has(d)||(s.add(d),o.push(a))};for(let a of Q(e,n))a.file!==n.relativePath&&c({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});let i=l.semantic?ie(e,n):null;if(i)for(let a of K(e,i)){if(a.file===n.relativePath||e.isIgnored(a.file))continue;let d=$(P(e,a.file),a.line);c({symbol:d?.symbol??a.file,file:a.file,source:"semantic-reference"})}return o}function ie(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 Y(e,n,l={}){if(n.length===0)return new Map;let o=l.additive??!1,s=[],c=[];for(let m of n)N(m.relativePath)&&E(e,m.relativePath)!==null?s.push(m):c.push(m);let i=new Map,a=new Map,d=m=>{for(let[u,t]of m){let b=i.get(u);b||(b=[],i.set(u,b));let p=a.get(u);p||(p=new Set,a.set(u,p));for(let g of t){let h=`${g.symbol}|${g.chunkId}`;p.has(h)||(p.add(h),b.push(g))}}};s.length>0&&d(re(e,s)),l.semantic!==!1&&d(fe(le(e,n)));let r=o?n:c;return r.length>0&&d(ue(e,r)),i}function le(e,n){let l=new Map,o=[],s=[];for(let i of n){if(!W(i.relativePath))continue;let a=M(e,i.relativePath);if(!a){s.push(i);continue}let d=I(e,i.relativePath,a),r=ce(e,i.relativePath),m=v(e,i.relativePath,i.symbol,d,r);if(m!==null){let u=se(m);if(u){u.length>0&&l.set(i.symbolId,u);continue}}o.push({def:i,contentHash:d,depsDigest:r})}if(o.length===0&&s.length===0)return l;let c=q(e,[...s,...o.map(i=>i.def)]);for(let[i,a]of c)l.set(i,a);return U(e).availability().available&&k(e,o.map(i=>({relativePath:i.def.relativePath,symbol:i.def.symbol,contentHash:i.contentHash,depsDigest:i.depsDigest,payload:JSON.stringify(c.get(i.def.symbolId)??[])}))),l}function se(e){try{return JSON.parse(e)}catch{return null}}var ae=L("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function ce(e,n){return ae.get(e,n,()=>{let o=[...O(e).get(n)??[]].sort().map(s=>`${s}:${I(e,s,M(e,s))}`);return A(o.join("|"))})}function re(e,n){let l=new Map,o=me(n,l),s=B(e);for(let[c,i]of o){let a=E(e,c);if(!a)continue;let d=H(i);for(let r of a){let m=d.get(r.line);if(!m)continue;let u=de(e,c,s,r.calleeLeaf,r.memberAccess);u&&u.symbol!==m.symbol&&l.get(m.symbolId).push({symbol:u.symbol,file:u.file,chunkId:r.line,source:"ast-callsite"})}}return l}function me(e,n){let l=new Map;for(let o of e){let s=l.get(o.relativePath);s?s.push(o):l.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of l.values())o.sort((s,c)=>s.endLine-s.startLine-(c.endLine-c.startLine));return l}function de(e,n,l,o,s){let c=G(n,l.get(o)??[]);return c.length===0?null:J(e,n,c,s)}function ue(e,n){if(n.length===0)return new Map;let o=R(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)),s=new Map;for(let t of o)s.has(t.document_id)||s.set(t.document_id,[]),s.get(t.document_id).push(t);let i=R(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)),a=R([...n.map(t=>t.documentId),...i.flatMap(t=>t.document_id===null?[]:[t.document_id])]),d=new Map(a.flatMap(t=>e.all(`SELECT id, relative_path FROM documents
37
- WHERE id IN (${t.map(()=>"?").join(",")})`,...t).map(b=>[b.id,b.relative_path]))),r=new Map;for(let t of i)r.has(t.symbol_id)||r.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?d.get(t.document_id)??"":""});let m=new Map,u=d;for(let t of n){let b=s.get(t.documentId)??[],p=new Set,g=[],h=null,Z=()=>{if(h)return h;let f=u.get(t.documentId)??"",y=new Set;if(f){let _=j(e,f),C=Math.max(0,t.startLine),w=Math.min(_.length-1,t.endLine);for(let S=C;S<=w;S+=1)for(let z of _[S])y.add(z)}return h=y,y};for(let f of b){if(f.symbol_id===t.symbolId)continue;let y=r.get(f.symbol_id);if(!y)continue;if(!(f.start_line>=t.startLine&&f.end_line<=t.endLine)){if(!(f.start_line<=t.endLine&&f.end_line>=t.startLine))continue;let S=T(y.symbol);if(!S||!Z().has(S))continue}let C=`${y.symbol}|${f.chunk_id}`;p.has(C)||(p.add(C),g.push({...y,chunkId:f.chunk_id,source:"scip-chunk"}))}m.set(t.symbolId,g)}return m}var V=500;function R(e){let n=[...new Set(e)],l=[];for(let o=0;o<n.length;o+=V)l.push(n.slice(o,o+V));return l}function fe(e){let n=new Map;for(let[l,o]of e){let s=[];for(let c of o)s.push({symbol:c.symbol,file:c.file,chunkId:-1,source:"semantic-callee"});n.set(l,s)}return n}export{Le as a,De as b,Y as c};
38
- //# sourceMappingURL=chunk-SULEXAHO.js.map
@@ -1,2 +0,0 @@
1
- import{a as D}from"./chunk-GBEYTDY5.js";import{p as A}from"./chunk-F6ICF7HL.js";import{b as d,d as h,f as y}from"./chunk-4KTOV4QN.js";import{c as S}from"./chunk-JM72FNGA.js";function F(e,n={}){let{samples:o=50,scope:r,maxDisagreements:l=5}=n,s=new D(e),i=C(s.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o);if(i.length===0||!R(e,i))return{available:!1,sampleSize:i.length,oracleCoverage:0,scores:[],topDisagreements:[]};let c={references:v(),callees:v()},a=[],g=0,T=y(e,i);for(let t of i){let u=f(t,h(e,t).map(m=>m.file)),b=f(t,(T.get(t.symbolId)??[]).map(m=>m.file));if(u.size===0&&b.size===0)continue;g+=1;let Q=f(t,A(e,t).map(m=>m.file)),I=f(t,(s.calleeMap([t],{semantic:!1}).get(t.symbolId)??[]).map(m=>m.file));x(c.references,t,"references",Q,u,a),x(c.callees,t,"callees",I,b,a)}return a.sort((t,u)=>u.cheapOnly.length+u.oracleOnly.length-(t.cheapOnly.length+t.oracleOnly.length)),{available:!0,sampleSize:i.length,oracleCoverage:i.length>0?p(g/i.length):0,scores:["references","callees"].map(t=>O(t,c[t])),topDisagreements:a.slice(0,l)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function C(e,n){let o=[...e].sort((s,i)=>s.symbolId-i.symbolId);if(o.length<=n)return o;let r=o.length/n,l=[];for(let s=0;s<n;s++)l.push(o[Math.floor(s*r)]);return l}function R(e,n){let o=n[0];if(!o)return!1;try{return d(e,o.relativePath).availability().available}catch{return!1}}function f(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function x(e,n,o,r,l,s){if(r.size===0&&l.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=l.size;let i=[],c=[];for(let a of r)l.has(a)?e.agreed+=1:i.push(a);for(let a of l)r.has(a)||c.push(a);(i.length>0||c.length>0)&&s.push({symbol:S(n.symbol),question:o,cheapOnly:i,oracleOnly:c})}var z={references:!0,callees:!1};function O(e,n){let o=n.oracleTotal>0?n.agreed/n.oracleTotal:1,r=n.cheapTotal-n.agreed;return{question:e,comparedSymbols:n.comparedSymbols,precision:z[e]&&n.cheapTotal>0?p(n.agreed/n.cheapTotal):null,recall:p(o),unverified:r}}function p(e){return Math.round(e*1e3)/1e3}export{F as a};
2
- //# sourceMappingURL=chunk-TH2N6QHW.js.map
@@ -1,2 +0,0 @@
1
- import{a as A}from"./chunk-GRJY65YT.js";import{a as C}from"./chunk-GBEYTDY5.js";import{a as k}from"./chunk-PTQVNJ4Q.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-UWYJDBDW.js.map
@@ -1,20 +0,0 @@
1
- import{b as c}from"./chunk-P5RYBRIO.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
2
- d1.relative_path AS from_file,
3
- d2.relative_path AS to_file
4
- FROM mentions m
5
- JOIN chunks c ON m.chunk_id = c.id
6
- JOIN documents d1 ON c.document_id = d1.id
7
- JOIN global_symbols gs ON m.symbol_id = gs.id
8
- JOIN (
9
- SELECT m2.symbol_id, c2.document_id
10
- FROM mentions m2
11
- JOIN chunks c2 ON m2.chunk_id = c2.id
12
- WHERE m2.role = 1
13
- GROUP BY m2.symbol_id
14
- ) sym_def ON sym_def.symbol_id = gs.id
15
- JOIN documents d2 ON sym_def.document_id = d2.id
16
- WHERE d1.id != d2.id
17
- AND m.role != 1
18
- ${e.pathExclusionsFor("d1","d2")}
19
- ${s}`)}function f(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}export{p as a};
20
- //# sourceMappingURL=chunk-VUKC6F77.js.map