scip-query 0.10.8 → 0.10.10

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 (227) hide show
  1. package/README.md +3 -1
  2. package/dist/{chunk-E2CCBFLR.js → chunk-2UYQLFVC.js} +2 -2
  3. package/dist/chunk-2VM46FC5.js +8 -0
  4. package/dist/{chunk-24S6MYOC.js → chunk-3DGD6NKW.js} +2 -2
  5. package/dist/chunk-3Q77KKEY.js +2 -0
  6. package/dist/chunk-3VD3JMK2.js +2 -0
  7. package/dist/{chunk-RSKOYTSY.js → chunk-4KTOV4QN.js} +2 -2
  8. package/dist/chunk-4N4WONI4.js +102 -0
  9. package/dist/{chunk-EBIQY3RK.js → chunk-56P7PDST.js} +2 -2
  10. package/dist/{chunk-BWL2ECGQ.js → chunk-5NVUWIAN.js} +2 -2
  11. package/dist/{chunk-BEUQVBE3.js → chunk-5VG7RKEF.js} +2 -2
  12. package/dist/{chunk-C6BYNIH4.js → chunk-65AU3HFZ.js} +2 -2
  13. package/dist/{chunk-NWFSC356.js → chunk-6LNQOOTB.js} +2 -2
  14. package/dist/{chunk-6TDOT7B3.js → chunk-72KY2ZFO.js} +2 -2
  15. package/dist/{chunk-7KJBH4IP.js → chunk-736BLPHR.js} +2 -2
  16. package/dist/chunk-7JRRXGVZ.js +2 -0
  17. package/dist/{chunk-RHKMQNFI.js → chunk-7UQWUVRG.js} +2 -2
  18. package/dist/chunk-A6IDHNMC.js +4 -0
  19. package/dist/chunk-A6TANQNV.js +2 -0
  20. package/dist/{chunk-X3Z4MLVL.js → chunk-AW2QHPLL.js} +2 -2
  21. package/dist/chunk-BSN22NRK.js +9 -0
  22. package/dist/{chunk-ZDR4VTOP.js → chunk-BVRS7RKQ.js} +2 -2
  23. package/dist/{chunk-ANIOISCE.js → chunk-C5CTSJ6X.js} +2 -2
  24. package/dist/{chunk-MEKSFV6H.js → chunk-CCKPYPDI.js} +2 -2
  25. package/dist/chunk-CZ425R2B.js +18 -0
  26. package/dist/{chunk-QDGKE5HN.js → chunk-DQVKIG3D.js} +2 -2
  27. package/dist/chunk-F6ICF7HL.js +40 -0
  28. package/dist/chunk-FAYI6KZ5.js +2 -0
  29. package/dist/{chunk-ZL52RLDK.js → chunk-FDEQIPPK.js} +2 -2
  30. package/dist/chunk-FRPEPTYJ.js +5 -0
  31. package/dist/chunk-GBEYTDY5.js +2 -0
  32. package/dist/{chunk-VFLHKRTW.js → chunk-GRJY65YT.js} +2 -2
  33. package/dist/chunk-HF25DFSC.js +3 -0
  34. package/dist/chunk-HHN2B5KA.js +2 -0
  35. package/dist/{chunk-FKUCFCLU.js → chunk-I46WR7MT.js} +2 -2
  36. package/dist/{chunk-5SMUKUV5.js → chunk-IPQTC36U.js} +2 -2
  37. package/dist/{chunk-FGTHPJON.js → chunk-J7RWXLUL.js} +2 -2
  38. package/dist/{chunk-63MSELOP.js → chunk-KX5PLFZ5.js} +2 -2
  39. package/dist/{chunk-VMPB52FG.js → chunk-LPL4MA6R.js} +2 -2
  40. package/dist/chunk-LZHUWKGD.js +2 -0
  41. package/dist/{chunk-BJWNO6BU.js → chunk-MMLZEGMS.js} +2 -2
  42. package/dist/{chunk-5G5VI7J4.js → chunk-NZ4UDB5N.js} +2 -2
  43. package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
  44. package/dist/chunk-P5RYBRIO.js +4 -0
  45. package/dist/chunk-PKMZCDQD.js +4 -0
  46. package/dist/{chunk-T633QLYF.js → chunk-PTQVNJ4Q.js} +2 -2
  47. package/dist/{chunk-FHWEEQVO.js → chunk-QPU7EXAW.js} +2 -2
  48. package/dist/chunk-QVI3NR7E.js +7 -0
  49. package/dist/{chunk-6EO3E3IP.js → chunk-QX7LLCGB.js} +2 -2
  50. package/dist/{chunk-AA7L7GKI.js → chunk-QYB5P7GL.js} +2 -2
  51. package/dist/chunk-RVWSAMTT.js +2 -0
  52. package/dist/{chunk-SHM5D3DQ.js → chunk-RXRLZFUL.js} +2 -2
  53. package/dist/{chunk-LGX2Y4BA.js → chunk-RYXW3KRC.js} +2 -2
  54. package/dist/{chunk-B4EHYG6M.js → chunk-SGLLBSCV.js} +2 -2
  55. package/dist/{chunk-ZMU6IWDK.js → chunk-SULEXAHO.js} +2 -2
  56. package/dist/{chunk-KZYHFI2X.js → chunk-TH2N6QHW.js} +2 -2
  57. package/dist/{chunk-JRUKS66S.js → chunk-TL6QPNF5.js} +2 -2
  58. package/dist/{chunk-JUIAOOK7.js → chunk-UDGXK2WA.js} +2 -2
  59. package/dist/{chunk-Q34NWRPP.js → chunk-UFX7EPBA.js} +2 -2
  60. package/dist/chunk-UQLFQLAF.js +2 -0
  61. package/dist/{chunk-VXT7WVIN.js → chunk-UWYJDBDW.js} +2 -2
  62. package/dist/{chunk-GZQID3FS.js → chunk-UYD7FJ3K.js} +2 -2
  63. package/dist/{chunk-2YI45TNM.js → chunk-VUKC6F77.js} +2 -2
  64. package/dist/{chunk-L4QKEQ4S.js → chunk-WG6KRH5F.js} +2 -2
  65. package/dist/{chunk-LWTML2AN.js → chunk-XIVO4SDZ.js} +2 -2
  66. package/dist/{chunk-N7F5UM6J.js → chunk-XSNRACLV.js} +2 -2
  67. package/dist/chunk-XUGQU7PM.js +41 -0
  68. package/dist/{chunk-BJG67TCR.js → chunk-XXZXDXTD.js} +2 -2
  69. package/dist/chunk-Y6E3JHC4.js +2 -0
  70. package/dist/{chunk-6BNOACLT.js → chunk-YBEEVDJQ.js} +2 -2
  71. package/dist/chunk-YGHUVQLR.js +2 -0
  72. package/dist/chunk-YWDVDAD7.js +2 -0
  73. package/dist/{chunk-6N6QTGSD.js → chunk-Z4I7BVIU.js} +2 -2
  74. package/dist/{chunk-3FYGJ2GY.js → chunk-ZQO43G2T.js} +2 -2
  75. package/dist/{chunk-JYSAYZNX.js → chunk-ZU6PROUY.js} +2 -2
  76. package/dist/cli.js +256 -205
  77. package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
  78. package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
  79. package/dist/index.d.ts +3 -2
  80. package/dist/index.js +3 -3
  81. package/dist/queries/affected.d.ts +1 -1
  82. package/dist/queries/affected.js +1 -1
  83. package/dist/queries/bottlenecks.d.ts +1 -1
  84. package/dist/queries/bottlenecks.js +1 -1
  85. package/dist/queries/by-kind.d.ts +1 -1
  86. package/dist/queries/by-kind.js +1 -1
  87. package/dist/queries/call-graph.d.ts +1 -1
  88. package/dist/queries/call-graph.js +1 -1
  89. package/dist/queries/change-surface.d.ts +1 -1
  90. package/dist/queries/change-surface.js +1 -1
  91. package/dist/queries/cleanup-plan.d.ts +1 -1
  92. package/dist/queries/cleanup-plan.js +1 -1
  93. package/dist/queries/co-change.d.ts +1 -1
  94. package/dist/queries/co-change.js +1 -1
  95. package/dist/queries/code.d.ts +1 -1
  96. package/dist/queries/code.js +1 -1
  97. package/dist/queries/complexity-hotspots.d.ts +1 -1
  98. package/dist/queries/complexity-hotspots.js +1 -1
  99. package/dist/queries/complexity.d.ts +1 -1
  100. package/dist/queries/complexity.js +1 -1
  101. package/dist/queries/convergence.d.ts +1 -1
  102. package/dist/queries/convergence.js +1 -1
  103. package/dist/queries/coupling.d.ts +1 -1
  104. package/dist/queries/coupling.js +1 -1
  105. package/dist/queries/cycles.d.ts +1 -1
  106. package/dist/queries/cycles.js +1 -1
  107. package/dist/queries/dataflow.d.ts +1 -1
  108. package/dist/queries/dataflow.js +1 -1
  109. package/dist/queries/dead.d.ts +1 -1
  110. package/dist/queries/dead.js +1 -1
  111. package/dist/queries/deep-chains.d.ts +1 -1
  112. package/dist/queries/deep-chains.js +1 -1
  113. package/dist/queries/deps.d.ts +1 -1
  114. package/dist/queries/deps.js +1 -1
  115. package/dist/queries/diff-gate.d.ts +1 -1
  116. package/dist/queries/diff-gate.js +1 -1
  117. package/dist/queries/diff-impact.d.ts +1 -1
  118. package/dist/queries/diff-impact.js +1 -1
  119. package/dist/queries/doc-drift.d.ts +1 -1
  120. package/dist/queries/doc-drift.js +1 -1
  121. package/dist/queries/drift.d.ts +2 -1
  122. package/dist/queries/drift.js +1 -1
  123. package/dist/queries/extract-candidates.d.ts +1 -1
  124. package/dist/queries/extract-candidates.js +1 -1
  125. package/dist/queries/fan.d.ts +1 -1
  126. package/dist/queries/fan.js +1 -1
  127. package/dist/queries/files.d.ts +1 -1
  128. package/dist/queries/health.d.ts +2 -2
  129. package/dist/queries/health.js +1 -1
  130. package/dist/queries/hierarchy.d.ts +1 -1
  131. package/dist/queries/hierarchy.js +1 -1
  132. package/dist/queries/hotspots.d.ts +1 -1
  133. package/dist/queries/hotspots.js +1 -1
  134. package/dist/queries/imports.d.ts +1 -1
  135. package/dist/queries/imports.js +1 -1
  136. package/dist/queries/incomplete-migration.d.ts +1 -1
  137. package/dist/queries/incomplete-migration.js +1 -1
  138. package/dist/queries/index.d.ts +2 -2
  139. package/dist/queries/index.js +1 -1
  140. package/dist/queries/isolated.d.ts +1 -1
  141. package/dist/queries/isolated.js +1 -1
  142. package/dist/queries/locality-candidates.d.ts +1 -1
  143. package/dist/queries/locality-candidates.js +1 -1
  144. package/dist/queries/members.d.ts +1 -1
  145. package/dist/queries/members.js +1 -1
  146. package/dist/queries/methods.d.ts +1 -1
  147. package/dist/queries/methods.js +1 -1
  148. package/dist/queries/outline.d.ts +1 -1
  149. package/dist/queries/outline.js +1 -1
  150. package/dist/queries/passthrough-candidates.d.ts +1 -1
  151. package/dist/queries/passthrough-candidates.js +1 -1
  152. package/dist/queries/plan-context.d.ts +1 -1
  153. package/dist/queries/plan-context.js +1 -1
  154. package/dist/queries/react-component-duplicates.d.ts +2 -1
  155. package/dist/queries/react-component-duplicates.js +1 -1
  156. package/dist/queries/react-hook-candidates.d.ts +2 -1
  157. package/dist/queries/react-hook-candidates.js +1 -1
  158. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  159. package/dist/queries/react-large-component-pressure.js +1 -1
  160. package/dist/queries/recent-duplicates.d.ts +1 -1
  161. package/dist/queries/recent-duplicates.js +1 -1
  162. package/dist/queries/redundant-reexports.d.ts +1 -1
  163. package/dist/queries/redundant-reexports.js +1 -1
  164. package/dist/queries/refs.d.ts +1 -1
  165. package/dist/queries/refs.js +1 -1
  166. package/dist/queries/self-audit.d.ts +1 -1
  167. package/dist/queries/self-audit.js +1 -1
  168. package/dist/queries/similar-chains.d.ts +1 -1
  169. package/dist/queries/similar-chains.js +1 -1
  170. package/dist/queries/similar-files.d.ts +1 -1
  171. package/dist/queries/similar-files.js +1 -1
  172. package/dist/queries/similar-signatures.d.ts +1 -1
  173. package/dist/queries/similar-signatures.js +1 -1
  174. package/dist/queries/similar.d.ts +2 -1
  175. package/dist/queries/similar.js +1 -1
  176. package/dist/queries/slice.d.ts +1 -1
  177. package/dist/queries/slice.js +1 -1
  178. package/dist/queries/stale-abstractions.d.ts +1 -1
  179. package/dist/queries/stale-abstractions.js +1 -1
  180. package/dist/queries/stats.d.ts +1 -1
  181. package/dist/queries/surface.d.ts +1 -1
  182. package/dist/queries/surface.js +1 -1
  183. package/dist/queries/symbols.d.ts +1 -1
  184. package/dist/queries/symbols.js +1 -1
  185. package/dist/queries/system.d.ts +1 -1
  186. package/dist/queries/system.js +1 -1
  187. package/dist/queries/trace.d.ts +1 -1
  188. package/dist/queries/trace.js +1 -1
  189. package/dist/queries/unused-imports.d.ts +1 -1
  190. package/dist/queries/unused-imports.js +1 -1
  191. package/dist/queries/unused-params.d.ts +1 -1
  192. package/dist/queries/unused-params.js +1 -1
  193. package/dist/queries/vue-component-duplicates.d.ts +2 -1
  194. package/dist/queries/vue-component-duplicates.js +1 -1
  195. package/dist/queries/vue-composable-candidates.d.ts +2 -1
  196. package/dist/queries/vue-composable-candidates.js +1 -1
  197. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  198. package/dist/queries/wrapper-candidates.d.ts +1 -1
  199. package/dist/queries/wrapper-candidates.js +1 -1
  200. package/docs/analyzer-inventory.md +29 -0
  201. package/docs/analyzer-validation-ledger.md +32 -1
  202. package/package.json +1 -1
  203. package/dist/chunk-2H57MJLI.js +0 -2
  204. package/dist/chunk-4TMJDHC6.js +0 -5
  205. package/dist/chunk-5GVOJOBL.js +0 -2
  206. package/dist/chunk-7XWXGANX.js +0 -4
  207. package/dist/chunk-AETMKBZR.js +0 -40
  208. package/dist/chunk-BTCASU5J.js +0 -3
  209. package/dist/chunk-C6ROZBJA.js +0 -32
  210. package/dist/chunk-COUFCH64.js +0 -2
  211. package/dist/chunk-EKECQP6Z.js +0 -2
  212. package/dist/chunk-FVA3NH4P.js +0 -2
  213. package/dist/chunk-I274B3B3.js +0 -7
  214. package/dist/chunk-J6ADQKQA.js +0 -2
  215. package/dist/chunk-K7VBTWNR.js +0 -2
  216. package/dist/chunk-KLXVEBVC.js +0 -2
  217. package/dist/chunk-KRGBLZT2.js +0 -7
  218. package/dist/chunk-P3K7LX7M.js +0 -4
  219. package/dist/chunk-PVZMPG5I.js +0 -2
  220. package/dist/chunk-RY7CAOJF.js +0 -4
  221. package/dist/chunk-S7YOLFLX.js +0 -2
  222. package/dist/chunk-SOGKYB5I.js +0 -8
  223. package/dist/chunk-VAXDTQHE.js +0 -18
  224. package/dist/chunk-X3BJUFSN.js +0 -62
  225. package/dist/chunk-XPOZO76D.js +0 -2
  226. package/dist/chunk-XWC67C3Q.js +0 -2
  227. package/dist/chunk-YNSVAJR6.js +0 -2
package/README.md CHANGED
@@ -301,7 +301,9 @@ It creates `.scipquery.json`:
301
301
 
302
302
  Use `declaredCouplings` for files that intentionally form one maintenance unit.
303
303
  These pairs are treated as structurally linked by `co-change` and health, while
304
- still appearing in file-specific exploration:
304
+ still appearing in file-specific exploration. The cleanup detector example
305
+ keeps dead-code, isolated-callable, and stale-abstraction detectors together
306
+ because they share candidate and evidence policy changes:
305
307
 
306
308
  ```json
307
309
  {
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-XPOZO76D.js";import{a as i}from"./chunk-T633QLYF.js";import{c as s,e as o,k as m}from"./chunk-JM72FNGA.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
2
- //# sourceMappingURL=chunk-E2CCBFLR.js.map
1
+ import{a}from"./chunk-GBEYTDY5.js";import{a as i}from"./chunk-PTQVNJ4Q.js";import{c as s,e as o,k as m}from"./chunk-JM72FNGA.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
2
+ //# sourceMappingURL=chunk-2UYQLFVC.js.map
@@ -0,0 +1,8 @@
1
+ import{f as H,i as O}from"./chunk-FRPEPTYJ.js";import{d as D}from"./chunk-YWOOQ4FF.js";import{b as _,d as T,h as E,i as L}from"./chunk-DQVKIG3D.js";import{a as w}from"./chunk-GBEYTDY5.js";import{c as C,d as F}from"./chunk-JM72FNGA.js";var V=5;function re(e,t={}){let{base:a="HEAD",minContainment:o=.7,minCallees:r=3,minSiteCoverage:n=.4,maxHelpers:c=Number.POSITIVE_INFINITY,limit:m=20,scanLimit:g}=t,f=t.semantic!==!1,s=t.diffPlan??T(e,{base:a}),l={available:s.note!==_,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new w(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),z=t.baseContentAt??E(e.config.projectRoot,a,L(s)),h=X(x,k,$,z);if(h.length===0)return l;let R=h.slice(0,c);h.length>c&&(l.note=`helper scoring capped at ${c} of ${h.length} new symbols`);let j=x.calleeMap(R,{semantic:f}),q=R.map(i=>({def:i,callees:O((j.get(i.symbolId)??[]).map(p=>p.symbol))})),M,B=()=>(M??=H(e,{minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M);for(let{def:i,callees:p}of q){let d=C(i.symbol);if(p.size<r){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:`fewer than ${r} meaningful callees \u2014 too small to score`});continue}let P=B(),N=W(p,P);if(N===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=Y(e,i.symbolId);if(b.length===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}l.helpersChecked+=1;let I=G({candidateIndex:P,changed:k,helperCallees:p,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:o,minSiteCoverage:n,migratedFiles:b});I.length!==0&&(I.sort((u,S)=>A(S.migrationScope)-A(u.migrationScope)||S.containment-u.containment||S.siteCoverage-u.siteCoverage||u.file.localeCompare(S.file)),l.findings.push({helperSymbol:i.symbol,helperShortName:d,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:N,migratedFiles:b.sort(),leftovers:I.slice(0,V)}))}return l.findings.sort((i,p)=>(p.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(p.helperFile)),l.findings=l.findings.slice(0,m),l}function G(e){let t=[],a=J(e.helperSymbol,e.helperFile,e.migratedFiles),o=new Set;for(let r of e.helperCallees)for(let n of e.candidateIndex.candidateIndexesByCallee.get(r)??[])o.add(n);for(let r of o){let n=e.candidateIndex.corpus[r];if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let c=D(e.helperCallees,n.callees);if(c<e.minContainment)continue;let m=[...e.helperCallees].filter(s=>n.callees.has(s)),g=n.callees.size===0?0:m.length/n.callees.size;if(g<e.minSiteCoverage||!m.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let f=K(a,n.symbol,n.file);t.push({symbol:n.symbol,shortName:C(n.symbol),file:n.file,...f,containment:c,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-m.length),sharedCallees:m.map(C).sort()})}return t}function A(e){return e==="same-scope"?2:e==="unknown"?1:0}function J(e,t,a){let o=new Set([...y(t),...v(F(e))]);for(let r of a)for(let n of y(r))o.add(n);return o}function K(e,t,a){let o=new Set([...y(a),...v(F(t))]);if(e.size===0||o.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let r=[...o].filter(n=>e.has(n)).sort();return r.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${r.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var U=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function y(e){return v(e.replace(/\.[^.]+$/,""))}function v(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!U.has(t))}function W(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function X(e,t,a,o){return e.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(r=>{if(!t.has(r.relativePath))return!1;let n=a.get(r.relativePath)??r.relativePath,c=o(n);return c===null||!new RegExp(`\\b${Z(r.leaf)}\\b`).test(c)})}function Y(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents ref_d ON c.document_id = ref_d.id
5
+ WHERE m.symbol_id = ?
6
+ AND m.role != 1
7
+ ${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{re as a};
8
+ //# sourceMappingURL=chunk-2VM46FC5.js.map
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-LGX2Y4BA.js";import{a}from"./chunk-XPOZO76D.js";import{c as i,f as n}from"./chunk-JM72FNGA.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
1
+ import{b as l}from"./chunk-RYXW3KRC.js";import{a}from"./chunk-GBEYTDY5.js";import{c as i,f as n}from"./chunk-JM72FNGA.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-LGX2Y4BA.js";import{a}from"./chunk-XPOZO76D.js";impor
26
26
  AND ${e.localSymbolPredicate}
27
27
  ${e.pathExclusionsFor("d1")}
28
28
  ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
29
- //# sourceMappingURL=chunk-24S6MYOC.js.map
29
+ //# sourceMappingURL=chunk-3DGD6NKW.js.map
@@ -0,0 +1,2 @@
1
+ import{b as Q}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-GBEYTDY5.js";import{b as H,e as U,f as z,g as K}from"./chunk-C5CTSJ6X.js";import{a as X}from"./chunk-UQLFQLAF.js";import{c as Z,d as J,e as q,f as C,l as G}from"./chunk-F6ICF7HL.js";import{e as $}from"./chunk-4KTOV4QN.js";import{b as T}from"./chunk-P5RYBRIO.js";import{h as V,n as x}from"./chunk-4N4WONI4.js";import{c as A,f as M,g as O,h as j,i as B,j as W}from"./chunk-JM72FNGA.js";import{a as k,d as E}from"./chunk-HF25DFSC.js";import{a as _}from"./chunk-DS6QEB3G.js";import{b as P,d as N,e as F}from"./chunk-XUGQU7PM.js";import{a as h}from"./chunk-64MNV6AB.js";import{b as S}from"./chunk-7S5E7KWT.js";var g=new WeakMap;function ee(e,t){let n=k(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=_(e,t);if(!r)return[];let o=P(e,t,r),s=N(e,"definition-exclusions",t,o);if(s){let a=he(s);if(a)return a}let u=n==="rust"?De(e,t):_e(e,t);return F(e,"definition-exclusions",t,o,JSON.stringify(u)),u}function he(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(xe)?null:t}catch{return null}}function xe(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var te=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Re=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Se=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function _e(e,t){let n=_(e,t);if(!n||!Ee(n))return[];let i=E(e,t);if(!i)return[];let r=g.get(i);if(r)return r;let o=!1,s=i.rootNode;for(let a of s.namedChildren){if(a.type!=="expression_statement")continue;let l=a.namedChild(0);if(!l||l.type!=="call_expression")continue;let c=l.namedChild(0);if(!c)continue;let f=c.type==="member_expression"?c.namedChild(c.namedChildCount-1)?.text:c.text;if(f&&te.has(f)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:s.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let a of s.namedChildren){let l=null,c=null;if(a.type==="function_declaration")l=a.namedChild(0)?.text??null,c=a;else if(a.type==="export_statement"){let f=a.namedChild(0);f?.type==="function_declaration"&&(l=f.namedChild(0)?.text??null,c=f)}else if(a.type==="lexical_declaration"){let f=a.namedChild(0);if(f?.type==="variable_declarator"){let m=f.namedChild(0)?.text,b=f.namedChild(1);m&&(b?.type==="arrow_function"||b?.type==="function_expression")&&(l=m,c=f)}}l&&/^use[A-Z]/.test(l)&&c&&u.push({startLine:c.startPosition.row,endLine:c.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...ne(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),g.set(i,u),u}function Ee(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of te)if(e.includes(n)){t=!0;break}return t&&Re.test(e)?!0:e.includes("use")&&Se.test(e)}var Ce=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function ve(e){return Ce.test(e)}function ne(e,t,n){let i=[],r=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,a=-1;for(let l=0;l<u.length;l+=1)if(u[l].startIndex===o.startIndex&&u[l].type===o.type){a=l;break}if(a>0)for(let l=a-1;l>=0;l-=1){let c=u[l];if(n.has(c.type)){if(ve(c.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(c.type==="attribute_item"||c.type==="inner_attribute_item"))break}}for(let s of o.namedChildren)r(s)};return r(e.rootNode),i}function De(e,t){let n=E(e,t);if(!n)return[];let i=g.get(n);if(i)return i;let r=[],o=Le(n);return o?(g.set(n,o),o):(re(n.rootNode,r,!1,!1),r.push(...ne(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...Ae(n.rootNode)),g.set(n,r),r)}function Le(e){return Me(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function re(e,t,n,i){let r=n,o=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?we(e,t,n,i):i&&Te(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Ie(e,t,n):e.type==="mod_item"&&D(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(r=!0);for(let s of e.namedChildren)re(s,t,r,o)}function we(e,t,n,i){let r=D(e),o=null;i?o="trait impl method (dynamic dispatch)":n&&(o="inside #[cfg(test)] mod");for(let s of r){let u=Ne(s);if(u){o=u;break}if(ie(s)){o="#[allow(dead_code)]";break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o})}function Ie(e,t,n){let i=D(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some(ke)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(ie)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function D(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let s=n[o];if(s.type==="attribute_item"||s.type==="inner_attribute_item")r.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return r}var Pe=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function Ne(e){return Pe.find(({re:t})=>t.test(e))?.reason??null}var Fe=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function ke(e){return/#\[\s*derive\s*\(/.test(e)?Fe.some(t=>t.test(e)):!1}function ie(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Te(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ae(e){let t=je(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function Me(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Oe=/^#!?\[\s*serde\s*\(/,Y=/\bwith\s*=\s*"([^"]+)"/g;function je(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Oe.test(n.text))continue;Y.lastIndex=0;let i;for(;(i=Y.exec(n.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&t.add(o)}}return t}function oe(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let o=ee(e,i);return r={ranges:o.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(o.map(s=>s.containerName).filter(s=>!!s))},t.set(i,r),r};return(i,r,o,s)=>{let u=n(i);for(let a of u.ranges)if(r>=a.startLine&&r<=a.endLine)return!0;if(s&&u.containers.has(s))return!0;for(let a of x(o))if(u.containers.has(a))return!0;return!1}}function ct(e,t={}){S(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function se(e,t,n={}){S(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function ce(e,t){return t.isIgnoredPath(e.relativePath)?p("ignored-file"):j(e.symbol)?p("module-like-symbol"):ae(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&ae(e.enclosingSymbol)?p("nested-non-callable-value"):!t.includeTests&&!L(e.relativePath)?p("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?p("excluded-file-region"):B(e.symbol)?p("rust-trait-impl-member"):W(e.symbol)?p("rust-test-module"):!t.includeMembers&&!Be(e)?p("member"):e.endLine-e.startLine+1<t.minLoc?p("below-min-loc"):{accepted:!0}:p("non-value-symbol")}function L(e){return H(e)!=="test"}function p(e){return{accepted:!1,rejectionReason:e}}function ae(e){return O(e)||e.endsWith("().")||e.endsWith(".")}function Be(e){return M(e.symbol)||x(e.symbol).length===0}function le(){return new Map}function ue(e,t,n){let i=new Map;for(let r of Z(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||R(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function fe(e,t,n){let i=new Set;for(let r of J(e,t))e.isIgnored(r.relative_path)||n.has(r.relative_path)||i.add(r.symbol_id);return i}function w(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function I(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,o]of i)if(r!==n&&o.occurrences>0)return!0;return!1}function de(e){return e?.occurrences??0}function R(e,t,n,i,r="source-fallback"){if(i<=0)return;let o=pe(e,t,n);o.occurrences+=i,o.sources.add(r)}function me(e,t,n,i,r){if(i<=0)return;let o=pe(e,t,n);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function pe(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var We=3e3,He=1e3;function Ft(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:s=!1,deadCodeOnly:u=!1,scanLimit:a,semantic:l=!0}=t,c=Q(Ue(e,{scope:n,minLoc:i,includeTests:r,includeMembers:s}),a),f=o?new Set(U(e)):new Set,m=u?le():ue(e,f,c.map(d=>d.symbolId)),b=u?fe(e,c.map(d=>d.symbolId),f):new Set,y=u?c.filter(d=>!b.has(d.symbolId)):c.filter(d=>!I(m,d.symbolId,d.relativePath));u?Je(e,y,m,f):Ze(e,y,m,f);let ye=u?y.filter(d=>!w(m,d.symbolId)):y.filter(d=>!I(m,d.symbolId,d.relativePath));Qe(e,ye,m,{includeTests:r,inactiveBarrelPaths:f,includeSemantic:!u&&l});let ge=u?y.filter(d=>!w(m,d.symbolId)):c;return Ve(e,ze(ge,m))}function Ue(e,t){let n=oe(e),i=[];for(let r of V(e,t.scope))ce(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:s=>e.isIgnored(s),isExcludedRegion:n}).accepted&&i.push(r);return i}function ze(e,t){return e.map(n=>Ke(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function Ke(e,t){let n=t.get(e.symbolId)??new Map,i=de(n.get(e.relativePath)),r=0;for(let[o,s]of n)o!==e.relativePath&&(r+=s.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ve(e,t){let n=[],i=0,r=0,o=0;for(let s of t){if(e.isIgnored(s.relative_path)||z(e,s.relative_path)||K(e,s.symbol,s.relative_path))continue;let u=s.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,o+=s.loc,n.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:A(s.symbol),sameFileRefs:s.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:o},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:o}}function Ze(e,t,n,i){if(t.length===0)return;let r=new v(e),o=new Set(t.map(a=>a.symbolId)),s=new Set(t.map(a=>a.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let a of h(e))u.add(a);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:s,skipPath:a=>i.has(a)},a=>{o.has(a.target.symbolId)&&(Ge(e,a)||R(n,a.target.symbolId,a.sourceFile,Xe(a),"source-fallback"))})}function Je(e,t,n,i){if(t.length===0)return;let r=new v(e),o=qe(t),s=new Set(r.sourceFiles());for(let c of h(e))s.add(c);let u=new Set(o.keys()),a=new Map,l=c=>{let f=a.get(c);return f||(f=G(e,c),a.set(c,f)),f};r.scanSourceReferences({paths:s,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:c=>i.has(c),resolveTargets:({sourceFile:c,name:f,kind:m})=>{let b=o.get(f);return b?$e(c,f,b,l(c),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:c=>{a.delete(c),se(e,c)}},c=>{let f=c.kind==="identifier"&&c.sourceFile===c.target.relativePath?Math.max(0,c.occurrences-1):c.occurrences;c.kind==="identifier"&&be(e,{sourceFile:c.sourceFile,name:c.name,target:c.target,occurrences:f})||R(n,c.target.symbolId,c.sourceFile,f,"source-fallback")})}function qe(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function $e(e,t,n,i,r){let o=n.filter(a=>a.relativePath===e);if(o.length>0)return o;if(!r.permissive&&n.length===1)return[...n];let s=i.get(t);if(s)for(let a of s){let l=n.filter(c=>C(a,c.relativePath));if(l.length>0)return l}let u=new Set;for(let a of i.values())for(let l of a)u.add(l);for(let a of u){let l=n.filter(c=>C(a,c.relativePath));if(l.length>0&&l.length===n.length)return l}return r.permissive?[...n]:[]}function Ge(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&be(e,t)}function Xe(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function be(e,t){return t.occurrences>1?!1:T(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function Qe(e,t,n,i){let r=i.includeSemantic!==!1,o=r&&t.length>=We&&h(e).length>=He,s=(a,l)=>{l===a.relativePath||e.isIgnored(l)||i.inactiveBarrelPaths.has(l)||!i.includeTests&&!L(l)||me(n,a.symbolId,l,1,"caller-map")};if(o)Ye(e,t,s);else for(let a of t){let l=X(e,a,{semantic:r});if(l.length!==0)for(let c of l)s(a,c.file)}if(!o)return;let u=$(e,t);for(let a of t){let l=u.get(a.symbolId);if(l)for(let c of l)s(a,c)}}function Ye(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of q(e,[...i.keys()])){let o=i.get(r.symbol_id);o&&n(o,r.relative_path)}}export{ct as a,Ft as b};
2
+ //# sourceMappingURL=chunk-3Q77KKEY.js.map
@@ -0,0 +1,2 @@
1
+ function o(e){let f=[];if(e.filePattern){let l=e.profiles.find(r=>r.file.includes(e.filePattern));if(!l)return[];for(let r of e.profiles){if(r.file===l.file||e.focusFiles&&!e.focusFiles.has(l.file)&&!e.focusFiles.has(r.file))continue;let i=e.compare(l,r);i&&f.push(i)}}else{if(e.focusFiles?.size===0)return[];let l=e.focusFiles?e.profiles.map((i,n)=>e.focusFiles.has(i.file)?n:-1).filter(i=>i>=0):[],r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let i=0;i<e.profiles.length;i+=1){let n=e.profiles[i];if(e.focusFiles&&!e.focusFiles.has(n.file))for(let s of l){if(s<=i)continue;let t=e.compare(n,e.profiles[s]);t&&f.push(t)}else for(let s=i+1;s<e.profiles.length;s+=1){let t=e.compare(n,e.profiles[s]);t&&f.push(t)}if(f.length>r)break}}return f.sort(e.sort??((l,r)=>r.similarity-l.similarity)),f.slice(0,e.limit)}export{o as a};
2
+ //# sourceMappingURL=chunk-3VD3JMK2.js.map
@@ -1,3 +1,3 @@
1
- import{l as T}from"./chunk-3LQFMQPY.js";import{f as g}from"./chunk-X3BJUFSN.js";import{d as h}from"./chunk-JM72FNGA.js";import{c as B,g as _,i as V}from"./chunk-C6ROZBJA.js";import{a as k}from"./chunk-64MNV6AB.js";import{a as W,c as $}from"./chunk-7S5E7KWT.js";function p(r,e,t){if(r.has(e))return r.get(e);let n=t();return r.set(e,n),n}import J from"path";function de(r,e){return r.getReferences().map(t=>{let n=t.getNode();return Y(n,e)})}function me(r){let e=r;return typeof e.findReferences=="function"?e.findReferences():[]}function z(r,e,t,n){let i=[];for(let o of me(r))for(let s of de(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of t)i.push(o);return M(i)}function K(r,e,t,n){let i=[],o=t?.getStart();for(let s of r.getReferences()){let a=s.getNode();S(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:Y(a,n),node:a}))}return i}function Y(r,e){let t=r.getSourceFile(),n=t.getLineAndColumnAtPos(r.getStart());return{file:S(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function X(r,e,t){let n=r.getSourceFile(),i=y(n,r),o=r.getText(),s=new RegExp(`\\b${ge(o)}\\b`,"g"),a=n.getFullText().split(`
1
+ import{l as T}from"./chunk-OBGRLXWF.js";import{f as g}from"./chunk-4N4WONI4.js";import{d as h}from"./chunk-JM72FNGA.js";import{c as B,g as _,i as V}from"./chunk-XUGQU7PM.js";import{a as k}from"./chunk-64MNV6AB.js";import{a as W,c as $}from"./chunk-7S5E7KWT.js";function p(r,e,t){if(r.has(e))return r.get(e);let n=t();return r.set(e,n),n}import J from"path";function de(r,e){return r.getReferences().map(t=>{let n=t.getNode();return Y(n,e)})}function me(r){let e=r;return typeof e.findReferences=="function"?e.findReferences():[]}function z(r,e,t,n){let i=[];for(let o of me(r))for(let s of de(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of t)i.push(o);return M(i)}function K(r,e,t,n){let i=[],o=t?.getStart();for(let s of r.getReferences()){let a=s.getNode();S(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:Y(a,n),node:a}))}return i}function Y(r,e){let t=r.getSourceFile(),n=t.getLineAndColumnAtPos(r.getStart());return{file:S(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function X(r,e,t){let n=r.getSourceFile(),i=y(n,r),o=r.getText(),s=new RegExp(`\\b${ge(o)}\\b`,"g"),a=n.getFullText().split(`
2
2
  `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let u=a[l]??"";s.lastIndex=0;let d;for(;(d=s.exec(u))!==null;)c.push({file:e,line:l,column:d.index})}return M(c.filter(l=>S(t,J.join(t,l.file))===e))}function R(r){for(let e=r;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function y(r,e){return r.getLineAndColumnAtPos(e.getStart()).line-1}function M(r){let e=new Set,t=[];for(let n of r){let i=`${n.file}:${n.line}:${n.column}`;e.has(i)||(e.add(i),t.push(n))}return t}function S(r,e){let t=J.relative(r||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function ge(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(r,e,t,n){let i=ye(e,n);return i.size===0?new Map:he(r,t,i)}function ye(r,e){let t=new Map;for(let n of g(r,e)){let i=h(n.symbol)??n.leaf;if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push(n)}return t}function he(r,e,t){let n=new Map,i=new Map;return e.forEachDescendant(o=>{for(let s of Se(r,o)){let a=t.get(s);if(!a)continue;let c=y(e,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let u=Math.abs(c-l.startLine),d=i.get(l.symbolId);d!==void 0&&d<=u||(i.set(l.symbolId,u),n.set(l.symbolId,o))}}}),n}function Se(r,e){let t=[],n=i=>{i&&!t.includes(i)&&t.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();n(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();n(i)}return r.Node.isIdentifier(e)&&n(e.getText()),t}var xe=$("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function H(r,e,t,n){let i=Z(r,e),o=G(i.get(n)??[],t);if(o)return o;let s=[];for(let a of i.values())for(let c of a)((c.leaf||h(c.symbol)||"").includes(n)||c.symbol.includes(n))&&s.push(c);return G(s,t)}function Q(r,e){let t=new Map;for(let[n,i]of Z(r,e)){let o=i[0];o&&t.set(n,o)}return t}function Z(r,e){return xe.get(r,e,()=>{let t=new Map;for(let n of g(r,e)){let i=n.leaf||h(n.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push({...n,leaf:i})}for(let n of t.values())n.sort((i,o)=>i.startLine-o.startLine||i.endLine-o.endLine||i.symbolId-o.symbolId);return t})}function G(r,e){let t=null,n=Number.POSITIVE_INFINITY;for(let i of r){let o=Math.abs(i.startLine-e);(o<n||o===n&&t&&i.startLine<t.startLine)&&(t=i,n=o)}return t}import Ie from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function I(r){let e=r.toLowerCase();return x.some(t=>e.endsWith(t))}function ee(r,e){let t=new Map,n=i=>I(i)?p(t,i,()=>{let o=Ie.join(r.config.projectRoot,i);for(let{project:s}of e){let a=s.getSourceFile(o)??s.addSourceFileAtPathIfExists(o)??null;if(a)return{project:s,sourceFile:a}}return null}):null;return{sourceFile:i=>n(i)?.sourceFile??null,sourceFileMatch:n,indexedTypeScriptLikeDocuments:()=>k(r,{extensions:x})}}import m from"path";import{existsSync as F,readdirSync as be,readFileSync as te}from"fs";function ne(r){let e=m.join(r,"package.json");if(!F(e))return[];let t;try{t=JSON.parse(te(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>De(r,i)).flatMap(i=>Ne(r,i))}function De(r,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=m.join(r,e);return F(m.join(s,"package.json"))?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),i=e.slice(t+1).replace(/^\//,""),o=m.join(r,n||".");if(!F(o))return[];try{return be(o).map(s=>m.join(o,s,i)).filter(s=>F(m.join(s,"package.json")))}catch{return[]}}function Ne(r,e){try{let t=JSON.parse(te(m.join(e,"package.json"),"utf8"));if(!t.name)return[];let n=m.relative(r,e).replace(/\\/g,"/");return[{name:t.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function re(r,e){for(let t of r)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function ie(r){return[`${r.sourceRootRelative}/index.ts`,`${r.sourceRootRelative}/index.tsx`,`${r.sourceRootRelative}/index.mts`,`${r.sourceRootRelative}/index.cts`]}import{existsSync as b,readFileSync as ke,readdirSync as Me,statSync as Fe}from"fs";import f from"path";var E=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function j(r,e){let n=e?f.dirname(f.join(r,e)):r,i=f.resolve(r);for(;n.startsWith(i);){for(let s of E){let a=f.join(n,s);if(b(a))return a}let o=f.dirname(n);if(o===n)break;n=o}for(let o of E){let s=f.join(r,o);if(b(s))return s}return null}function oe(r){let e=r.config.projectRoot,t=new Set(ve(e,r.config.semantic?.typescript?.tsconfigs)),n=k(r,{includeIgnored:!1,extensions:x});for(let i of n){let o=j(e,i);o&&t.add(f.resolve(o))}if(t.size===0){let i=j(e);i&&t.add(f.resolve(i))}return[...t].filter(i=>!se(e,i)).sort((i,o)=>i.localeCompare(o))}function ve(r,e=[]){let t=new Set;for(let n of e){let i=f.isAbsolute(n)?n:f.join(r,n);b(i)&&t.add(f.resolve(i))}for(let n of Pe(r))for(let i of E){let o=f.join(n,i);b(o)&&t.add(f.resolve(o))}if(t.size===0){let n=j(r);n&&t.add(f.resolve(n))}return[...t].filter(n=>!se(r,n)).sort((n,i)=>n.localeCompare(i))}function Pe(r){let e=f.join(r,"package.json");if(!b(e))return[];let t;try{t=JSON.parse(ke(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>Te(r,i))}function Te(r,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=f.join(r,e);return C(s)?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),i=e.slice(t+1).replace(/^\//,""),o=f.join(r,n||".");return C(o)?Me(o).map(s=>f.join(o,s,i)).filter(C):[]}function C(r){try{return Fe(r).isDirectory()}catch{return!1}}function se(r,e){let t=f.relative(r,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}import{createRequire as Re}from"module";var Ce=Re(import.meta.url),D;function ae(){if(D!==void 0)return D;try{D=Ce("ts-morph")}catch{D=null}return D}function ce(r,e){return e.map(t=>({tsconfigPath:t,project:new r.Project({tsConfigFilePath:t,skipFileDependencyResolution:!1})}))}function v(r,e,t){return{language:"typescript",availability:()=>({available:!1,reason:r,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function pe(r,e){let t=ae();if(!t)return v("ts-morph is not installed");let n=oe(r);if(n.length===0)return v("no tsconfig found");try{let i=ce(t,n);return new w(r,t,i)}catch(i){return v(i instanceof Error?i.message:String(i),n[0],n)}}var w=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=ne(e.config.projectRoot),this.sourceFiles=ee(e,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return p(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=[];for(let i of t.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,i))n.push(o);return n})}referencesFor(e){return p(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e),n=this.packageImportReferencesForDefinition(e);return t?z(t,e,n,this.db.config.projectRoot):n})}calleesFor(e){return p(this.calleesCache,e.symbolId,()=>p(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return p(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let i=n.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return fe(c)}),o=n.getReturnType().getText(t);return`(${i.join(",")})=>${fe(o)}`})}importUsageForDeclaration(e,t){let n=T(this.db,e,t.getModuleSpecifierValue()),i=le(t);return t.getImportClause()?.isTypeOnly()?i.map(o=>Ee(e,n,o)):i.map(o=>this.valueImportUsageForEntry(e,n,o))}valueImportUsageForEntry(e,t,n){let i=n.identifier?n.identifier.findReferences():[],o=[];for(let l of i)for(let u of K(l,e,n.identifier,this.db.config.projectRoot))o.push(u);let s=o.some(l=>!R(l.node)),a=o.some(l=>R(l.node)),c=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||a,isValueUsed:s,references:o.map(l=>l.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,i]of e)e.set(n,M(i));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let i=this.sourceFiles.sourceFileMatch(n);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,i){let o=re(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of le(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=X(a.identifier,n,this.db.config.projectRoot);l.length>0&&Le(e,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let n=new Map;for(let i of ie(t))this.collectPackageExports(t,i,n,new Set);n.size>0&&e.set(t.name,n)}return this.packageExportIndex=e,e}collectPackageExports(e,t,n,i){if(i.has(t))return;i.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?T(this.db,t,a):t;if(!c||!c.startsWith(`${e.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,n,i);continue}for(let u of l){let d=u.getNameNode().getText(),O=u.getAliasNode()?.getText()??d,U=this.indexedDefinitionByLeaf(c,d);if(!U)continue;let N=n.get(O);N||(N=new Set,n.set(O,N)),N.add(U.symbolId)}}}indexedDefinitionByLeaf(e,t){return p(this.indexedDefinitionLeafCache,e,()=>Q(this.db,e)).get(t)??null}nodeForDefinition(e){return p(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return p(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?q(this.tsMorph,this.db,t,e):new Map})}definitionFromSymbol(e){let t=e.getDeclarations();for(let n of t){let i=n.getSourceFile(),o=S(this.db.config.projectRoot,i.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=y(i,n),a=H(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let t=this.sourceFiles.sourceFile(e);if(!t)return new Map;let n=g(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(n.length===0)return new Map;let i=new Map;t.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(t,n,o);s&&je(i,s.callerId,s.target)});for(let[o,s]of i)i.set(o,Ae(s));return i}semanticCalleeForCallNode(e,t,n){let i=we(t,y(e,n));if(!i)return null;let o=n.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:i.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function le(r){let e=[],t=r.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let n=r.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let i of r.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Ee(r,e,t){return{importer:r,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function je(r,e,t){let n=r.get(e);n||(n=[],r.set(e,n)),n.push(t)}function we(r,e){let t=null;for(let n of r)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function Le(r,e,t){for(let n of e){let i=r.get(n)??[];i.push(...t),r.set(n,i)}}function Ae(r){let e=new Set,t=[];for(let n of r){let i=`${n.symbol}|${n.file}|${n.line}`;e.has(i)||(e.add(i),t.push(n))}return t}function fe(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var L=new WeakMap;W({name:"semantic-provider",groups:["semantic-provider"],clearAll:r=>L.delete(r)});function A(r,e){let t=`${r.config.projectRoot}:typescript-workspace`,n=L.get(r);n||(n=new Map,L.set(r,n));let i=n.get(t);if(i)return i;let o=pe(r,e);return n.set(t,o),o}function Tt(r,e){let t=P(r,e);return t?t.importUsage(e):[]}function ue(r,e){let t=P(r,e.relativePath);return t?t.referencesFor(e):[]}function Rt(r,e){let t=new Map,n=B(r),i=[];for(let o of e){let s=Oe(r,o,n,i);for(let a of s){if(a.file===o.relativePath||r.isIgnored(a.file))continue;let c=t.get(o.symbolId);c||(c=new Set,t.set(o.symbolId,c)),c.add(a.file)}}return i.length>0&&A(r).availability().available&&V(r,i),t}function Oe(r,e,t,n){if(!t||!I(e.relativePath))return ue(r,e);let i=_(r,e.relativePath,e.symbol,t);if(i!==null){let s=Ue(i);if(s)return s}let o=ue(r,e);return n.push({relativePath:e.relativePath,symbol:e.symbol,projectFingerprint:t,payload:JSON.stringify(o)}),o}function Ue(r){try{return JSON.parse(r)}catch{return null}}function Ct(r,e){let t=new Map;for(let n of e){let i=P(r,n.relativePath);if(!i)continue;let o=i.calleesFor(n);o.length>0&&t.set(n.symbolId,o)}return t}function Et(r,e){let t=P(r,e.relativePath);return t?t.signatureFor(e):null}function P(r,e){if(!I(e))return null;let t=A(r,e);return t.availability().available?t:null}export{I as a,A as b,Tt as c,ue as d,Rt as e,Ct as f,Et as g};
3
- //# sourceMappingURL=chunk-RSKOYTSY.js.map
3
+ //# sourceMappingURL=chunk-4KTOV4QN.js.map
@@ -0,0 +1,102 @@
1
+ import{a as N,b as m,c as E,d as M,e as p,g as F}from"./chunk-JM72FNGA.js";import{c as R}from"./chunk-72KY2ZFO.js";import{a as f}from"./chunk-DS6QEB3G.js";import{b,c as g,d as h,e as D,j as _}from"./chunk-XUGQU7PM.js";import{a as I}from"./chunk-64MNV6AB.js";import{c as S}from"./chunk-7S5E7KWT.js";function ce(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
+ JOIN documents d ON der.document_id = d.id
5
+ WHERE ${n.where}
6
+ ${e.pathExclusionsFor("d")}
7
+ ${O(n.orderBy)}
8
+ ${k(n.limit)}`,...n.params??[])}function de(e,n){return e.all(`SELECT
9
+ gs.id,
10
+ gs.symbol,
11
+ c.document_id,
12
+ MIN(c.start_line) AS start_line,
13
+ MAX(c.end_line) AS end_line,
14
+ d.relative_path,
15
+ gs.display_name,
16
+ gs.documentation
17
+ FROM global_symbols gs
18
+ JOIN mentions m ON m.symbol_id = gs.id
19
+ JOIN chunks c ON m.chunk_id = c.id
20
+ JOIN documents d ON c.document_id = d.id
21
+ WHERE m.role = 1
22
+ AND ${n.where}
23
+ ${e.pathExclusionsFor("d")}
24
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
25
+ ${O(n.orderBy)}
26
+ ${k(n.limit)}`,...n.params??[])}function O(e){return e?`ORDER BY ${e}`:""}function k(e){return typeof e=="number"?`LIMIT ${e}`:""}function $(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function C(e){if(!e)return null;let n=w(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let r=e.slice(t+1);return(w(r)??r).replace(/\n/g," ")}function w(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function v(e){if(m(e.symbol)!==null)return!1;let t=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(t)}function L(e,n,t={}){let r=new Map;for(let o of n)e.length>0&&!v(o)||r.set(o.id,o);for(let o of e)r.set(o.id,o);let i=[...r.values()];return t.sort?i.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):i}var H=S("file-definitions",{clearGroups:["definition-catalog"]}),A=new WeakMap;function x(e,n){return H.get(e,n,()=>{let t=j(e,n);if(t)return t;let r=L(z(e,n),G(e,n),{sort:!0}),i=P(e,n,r.map(B)),o=g(e),s=f(e,n);return o&&s&&D(e,"file-definitions",n,b(e,n,s),JSON.stringify({projectFingerprint:o,definitions:i.map(l=>({...l}))})),i})}function j(e,n){let t=g(e);if(!t)return null;let r=f(e,n);if(!r)return null;let i=h(e,"file-definitions",n,b(e,n,r));return i?W(i,t,n):null}function W(e,n,t){try{let r=JSON.parse(e);if(!_(r)||r.projectFingerprint!==n||!Array.isArray(r.definitions))return null;let i=[];for(let o of r.definitions){let s=Y(o,t);if(!s)return null;i.push(s)}return i}catch{return null}}function Y(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.endLine!="number"||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function z(e,n){return e.all(`SELECT
27
+ gs.id,
28
+ gs.symbol,
29
+ der.document_id,
30
+ der.start_line,
31
+ der.end_line,
32
+ d.relative_path,
33
+ gs.display_name,
34
+ gs.kind,
35
+ gs.documentation,
36
+ gs.enclosing_symbol
37
+ FROM global_symbols gs
38
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
39
+ JOIN documents d ON der.document_id = d.id
40
+ WHERE d.relative_path = ?
41
+ ${e.symbolNoiseFor("gs")}
42
+ ORDER BY der.start_line, der.end_line`,n)}function G(e,n){return e.all(`SELECT
43
+ gs.id,
44
+ gs.symbol,
45
+ c.document_id,
46
+ MIN(c.start_line) AS start_line,
47
+ MAX(c.end_line) AS end_line,
48
+ d.relative_path,
49
+ gs.display_name,
50
+ gs.kind,
51
+ gs.documentation,
52
+ gs.enclosing_symbol
53
+ FROM global_symbols gs
54
+ JOIN mentions m ON m.symbol_id = gs.id
55
+ JOIN chunks c ON m.chunk_id = c.id
56
+ JOIN documents d ON c.document_id = d.id
57
+ WHERE d.relative_path = ?
58
+ AND m.role = 1
59
+ ${e.symbolNoiseFor("gs")}
60
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
61
+ ORDER BY start_line, end_line`,n)}function B(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:M(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:F(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function De(e,n={}){return K(e,n.scope)}function K(e,n){return I(e,{scope:n,includeIgnored:!1}).flatMap(t=>x(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function Ie(e,n){let t=T(U(e,n.scope,n.sqlPrefilter)),r=T(X(e,n.scope,n.sqlPrefilter)),i=new Set([...t.keys(),...r.keys()]),o=[];for(let s of[...i].sort()){if(e.isIgnored(s))continue;let l=L(t.get(s)??[],r.get(s)??[],{sort:!0}).filter(a=>n.symbolMatches(a.symbol));l.length!==0&&o.push(...P(e,s,l.map(B)))}return o}function U(e,n,t){let r=n?"AND d.relative_path LIKE ?":"",i=t==="callable"?`AND ${J("gs")}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
62
+ gs.id,
63
+ gs.symbol,
64
+ der.document_id,
65
+ der.start_line,
66
+ der.end_line,
67
+ d.relative_path,
68
+ gs.display_name,
69
+ gs.kind,
70
+ gs.documentation,
71
+ gs.enclosing_symbol
72
+ FROM global_symbols gs
73
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
74
+ JOIN documents d ON der.document_id = d.id
75
+ WHERE 1 = 1
76
+ ${e.pathExclusionsFor("d")}
77
+ ${r}
78
+ ${i}
79
+ ${e.symbolNoiseFor("gs")}
80
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function X(e,n,t){let r=n?"AND d.relative_path LIKE ?":"",i=t==="callable"?`AND ${J("gs")}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
81
+ gs.id,
82
+ gs.symbol,
83
+ c.document_id,
84
+ MIN(c.start_line) AS start_line,
85
+ MAX(c.end_line) AS end_line,
86
+ d.relative_path,
87
+ gs.display_name,
88
+ gs.kind,
89
+ gs.documentation,
90
+ gs.enclosing_symbol
91
+ FROM global_symbols gs
92
+ JOIN mentions m ON m.symbol_id = gs.id
93
+ JOIN chunks c ON m.chunk_id = c.id
94
+ JOIN documents d ON c.document_id = d.id
95
+ WHERE m.role = 1
96
+ ${e.pathExclusionsFor("d")}
97
+ ${r}
98
+ ${i}
99
+ ${e.symbolNoiseFor("gs")}
100
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
101
+ ORDER BY d.relative_path, start_line, end_line`,...o)}function J(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function T(e){let n=new Map;for(let t of e){let r=n.get(t.relative_path);r?r.push(t):n.set(t.relative_path,[t])}return n}function Re(e,n,t={}){if(n.length===0)return[];let r=n.flatMap(i=>x(e,i)).filter(i=>!e.isIgnored(i.relativePath));return t.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),t.sort&&(r=r.sort((i,o)=>i.relativePath.localeCompare(o.relativePath)||i.startLine-o.startLine||i.endLine-o.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:E(i.symbol),signature:$(C(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function Z(e){let n=new Map,t=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of t)for(let i=r.startLine;i<=r.endLine;i+=1)n.has(i)||n.set(i,r);return n}function Ne(e,n){let t=A.get(e);return t||(t=Z(e),A.set(e,t)),t.get(n)??null}function Ee(e,n){let t=x(e,n.relative_path).find(r=>r.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,endLine:t.endLine,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function P(e,n,t){let r=f(e,n),i=R(e,n);return i?ie(t,i,r):r?V(t,r):t}function V(e,n){let t=n.split(/\r?\n/),r=q(e,t),i=ee(e,r),o=ne(i,t);return te(e,o)}function q(e,n){let t=e.some(i=>y(i.symbol))?se(n):null,r=new Map;for(let i of e)r.set(i.symbolId,oe(n,t,i));return r}function ee(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,r)=>t.startLine-r.startLine||t.definition.startLine-r.definition.startLine||t.definition.symbol.localeCompare(r.definition.symbol))}function ne(e,n){let t=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],o=e[r+1],s=o?Math.max(i.startLine,o.startLine-1):n.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:le(n,i.definition,i.startLine,s)})}return t}function te(e,n){return e.map(t=>{let r=n.get(t.symbolId);return r?{...t,startLine:r.startLine,endLine:r.endLine}:t})}function ie(e,n,t=null){let r=new Map;for(let i of n){let o=r.get(i.name);o?o.push(i):r.set(i.name,[i])}return e.map(i=>{if(!re(i)||!i.leaf)return Q(i,t);let o=r.get(i.leaf);if(!o||o.length===0)return Q(i,t);let s=o[0],l=Math.abs(s.startLine-i.startLine);for(let a=1;a<o.length;a+=1){let c=o[a],d=Math.abs(c.startLine-i.startLine);d<l&&(s=c,l=d)}return{...i,startLine:s.startLine,endLine:s.endLine}})}function re(e){return y(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function Q(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>r.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function oe(e,n,t){if(!y(t.symbol))return t.startLine;let r=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return r;let i=n.get(t.leaf);if(!i||i.length===0)return r;let o=null;for(let s of i){let l=Math.abs(s-t.startLine);(!o||l<o.distance)&&(o={line:s,distance:l})}return o?.line??r}function se(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(l,a)=>{let c=o.get(l);if(!c){o.set(l,[a]);return}c[c.length-1]!==a&&c.push(a)};for(let l=0;l<e.length;l+=1){let a=e[l]??"";for(let d of a.matchAll(n))d[1]&&s(d[1],l);for(let d of a.matchAll(t))d[1]&&s(d[1],l);let c=a.match(r);c?.[1]&&s(c[1],l);for(let d of a.matchAll(i))d[1]&&s(d[1],l)}return o}function le(e,n,t,r){let i=Math.max(t,Math.min(e.length-1,r)),o=Math.max(t,Math.min(i,n.endLine)),s=0,l=0,a=!1;for(let c=t;c<=i;c+=1){let d=ae(e[c]??"");for(let u of d)u==="{"?(s+=1,a=!0):u==="}"?s=Math.max(0,s-1):u==="("?l+=1:u===")"&&(l=Math.max(0,l-1));if(a&&s===0||!a&&l===0&&c>=o)return c}return o}function ae(e){let n="",t=null,r=!1;for(let i=0;i<e.length;i+=1){let o=e[i],s=e[i+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-i);break}if(t){if(r){r=!1,n+=" ";continue}if(o==="\\"){r=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function y(e){return e.includes("().")}function Me(e){let n=N(e);if("kind"in n)return[];let t=[];for(let r=n.descriptors.length-2;r>=0;r-=1){let i=n.descriptors[r];i?.suffix==="type"&&i.name&&t.push(i.name)}return t}export{ce as a,de as b,$ as c,C as d,L as e,x as f,De as g,K as h,Ie as i,Re as j,Z as k,Ne as l,Ee as m,Me as n};
102
+ //# sourceMappingURL=chunk-4N4WONI4.js.map
@@ -1,2 +1,2 @@
1
- import{c as i}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-YNSVAJR6.js";import{a}from"./chunk-ZMU6IWDK.js";import{a as r}from"./chunk-T633QLYF.js";import{c as o}from"./chunk-JM72FNGA.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
2
- //# sourceMappingURL=chunk-EBIQY3RK.js.map
1
+ import{c as i}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-UQLFQLAF.js";import{a}from"./chunk-SULEXAHO.js";import{a as r}from"./chunk-PTQVNJ4Q.js";import{c as o}from"./chunk-JM72FNGA.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
2
+ //# sourceMappingURL=chunk-56P7PDST.js.map
@@ -1,2 +1,2 @@
1
- import{b}from"./chunk-LGX2Y4BA.js";import{i as f}from"./chunk-X3BJUFSN.js";import{l as d}from"./chunk-JM72FNGA.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
- //# sourceMappingURL=chunk-BWL2ECGQ.js.map
1
+ import{b}from"./chunk-RYXW3KRC.js";import{j as f}from"./chunk-4N4WONI4.js";import{l as d}from"./chunk-JM72FNGA.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-5NVUWIAN.js.map
@@ -1,7 +1,7 @@
1
- import{b as k}from"./chunk-FVA3NH4P.js";import{a as D}from"./chunk-XPOZO76D.js";import{f as y,g as v}from"./chunk-ANIOISCE.js";import{p as S}from"./chunk-AETMKBZR.js";import{f as L}from"./chunk-X3BJUFSN.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
1
+ import{b as k}from"./chunk-3Q77KKEY.js";import{a as D}from"./chunk-GBEYTDY5.js";import{f as y,g as v}from"./chunk-C5CTSJ6X.js";import{p as S}from"./chunk-F6ICF7HL.js";import{f as L}from"./chunk-4N4WONI4.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
4
  JOIN documents d ON d.id = der.document_id
5
5
  WHERE gs.symbol = ?
6
6
  LIMIT 1`,n);return s?L(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=L(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
- //# sourceMappingURL=chunk-BEUQVBE3.js.map
7
+ //# sourceMappingURL=chunk-5VG7RKEF.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,f as S}from"./chunk-KRGBLZT2.js";import{b as d}from"./chunk-ANIOISCE.js";import{a as h}from"./chunk-2YI45TNM.js";import{existsSync as R}from"fs";import{join as $}from"path";function U(e){return C.test(e)}var C=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function X(e,t,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:c=20}=n,l=b(e),r=t!==void 0,g=S(e,{minTogether:r?Math.min(s,2):s,minConfidence:r?0:o,maxFilesPerCommit:c});if(!l||!g)return{available:!1,commitsAnalyzed:0,findings:[]};let A=h(e),E=x(e),k=L(e,A,E),w=n.includeLinked===!0||r,u=[];for(let i of g){if(C.test(i.fileA)||C.test(i.fileB)||!y(e,i.fileA)||!y(e,i.fileB)||r&&!i.fileA.includes(t)&&!i.fileB.includes(t)||!r&&(d(i.fileA)==="test"||d(i.fileB)==="test"||j(i.fileA,i.fileB)))continue;let m=k(i.fileA,i.fileB);if(!w&&m)continue;let f=v(i.fileA,i.fileB),p=F(i,f,m);if(u.push({...i,structurallyLinked:m,partnerClass:f.partnerClass,partnerClassReasons:f.reasons,...p?{declaredCouplingSuggestion:p}:{}}),u.length>=a)break}return{available:!0,commitsAnalyzed:l.commits.length,findings:u}}function y(e,t){return R($(e.config.projectRoot,t))}function v(e,t){let n=P(e),s=P(t),o=[],a=r=>{o.includes(r)||o.push(r)},c=(r,g)=>n.tags.has(r)&&s.tags.has(g)||n.tags.has(g)&&s.tags.has(r);if(c("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(c("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(c("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(c("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let l=q(n.tokens,s.tokens).filter(r=>!G.has(r));return T(e,t)||l.length>=2?(a(T(e,t)?"both files live in the same directory":`files share feature tokens: ${l.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function F(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!M.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${Z(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function L(e,t=h(e),n=x(e)){return(s,o)=>_(t,n,s,o)}function j(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let o=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return o!==""&&o===a}function x(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function _(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(o=>o.has(n)&&o.has(s))}var I=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,N=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,D=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,O=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,B=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,M=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),G=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function P(e){let t=e.replace(/\\/g,"/"),n=new Set;return I.test(t)&&n.add("doc"),N.test(t)&&n.add("config"),D.test(t)&&n.add("schema"),O.test(t)&&n.add("script"),B.test(t)&&n.add("model"),z.test(t)&&n.add("view"),d(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:H(t)}}function T(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),o=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return o!==""&&o===a}function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function q(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function Z(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{U as a,X as b,v as c,F as d,L as e};
2
- //# sourceMappingURL=chunk-C6BYNIH4.js.map
1
+ import{a as b,f as S}from"./chunk-BSN22NRK.js";import{b as d}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-VUKC6F77.js";import{existsSync as R}from"fs";import{join as $}from"path";function U(e){return C.test(e)}var C=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function X(e,t,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:c=20}=n,l=b(e),r=t!==void 0,g=S(e,{minTogether:r?Math.min(s,2):s,minConfidence:r?0:o,maxFilesPerCommit:c});if(!l||!g)return{available:!1,commitsAnalyzed:0,findings:[]};let A=h(e),E=x(e),k=L(e,A,E),w=n.includeLinked===!0||r,u=[];for(let i of g){if(C.test(i.fileA)||C.test(i.fileB)||!y(e,i.fileA)||!y(e,i.fileB)||r&&!i.fileA.includes(t)&&!i.fileB.includes(t)||!r&&(d(i.fileA)==="test"||d(i.fileB)==="test"||j(i.fileA,i.fileB)))continue;let m=k(i.fileA,i.fileB);if(!w&&m)continue;let f=v(i.fileA,i.fileB),p=F(i,f,m);if(u.push({...i,structurallyLinked:m,partnerClass:f.partnerClass,partnerClassReasons:f.reasons,...p?{declaredCouplingSuggestion:p}:{}}),u.length>=a)break}return{available:!0,commitsAnalyzed:l.commits.length,findings:u}}function y(e,t){return R($(e.config.projectRoot,t))}function v(e,t){let n=P(e),s=P(t),o=[],a=r=>{o.includes(r)||o.push(r)},c=(r,g)=>n.tags.has(r)&&s.tags.has(g)||n.tags.has(g)&&s.tags.has(r);if(c("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(c("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(c("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(c("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let l=q(n.tokens,s.tokens).filter(r=>!G.has(r));return T(e,t)||l.length>=2?(a(T(e,t)?"both files live in the same directory":`files share feature tokens: ${l.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function F(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!M.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${Z(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function L(e,t=h(e),n=x(e)){return(s,o)=>_(t,n,s,o)}function j(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let o=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return o!==""&&o===a}function x(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function _(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(o=>o.has(n)&&o.has(s))}var I=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,N=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,D=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,O=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,B=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,M=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),G=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function P(e){let t=e.replace(/\\/g,"/"),n=new Set;return I.test(t)&&n.add("doc"),N.test(t)&&n.add("config"),D.test(t)&&n.add("schema"),O.test(t)&&n.add("script"),B.test(t)&&n.add("model"),z.test(t)&&n.add("view"),d(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:H(t)}}function T(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),o=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return o!==""&&o===a}function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function q(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function Z(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{U as a,X as b,v as c,F as d,L as e};
2
+ //# sourceMappingURL=chunk-65AU3HFZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as oe}from"./chunk-FG4NT6VY.js";import{a as ne}from"./chunk-VOYOYC5T.js";import{a as te}from"./chunk-FHWEEQVO.js";import{a as ie}from"./chunk-EKECQP6Z.js";import{a as re}from"./chunk-2H57MJLI.js";import{a as Z}from"./chunk-XWC67C3Q.js";import{a as ee}from"./chunk-KLXVEBVC.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-I274B3B3.js";import{a as X}from"./chunk-X3Z4MLVL.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{c as Y}from"./chunk-4TMJDHC6.js";import{a as j}from"./chunk-5GVOJOBL.js";import{a as G}from"./chunk-63MSELOP.js";import{a as q}from"./chunk-JYSAYZNX.js";import{a as W}from"./chunk-VAXDTQHE.js";import{a as T,b as U}from"./chunk-FVA3NH4P.js";import{b as N}from"./chunk-C6BYNIH4.js";import{b as I,c as z}from"./chunk-KRGBLZT2.js";import{a as K}from"./chunk-J6ADQKQA.js";import{a as O}from"./chunk-AA7L7GKI.js";import{f as A,g as k}from"./chunk-ANIOISCE.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ke(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:We(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:qe(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:je(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Ge(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Xe(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Qe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Je(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Ke(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ze(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:et(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ye(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:tt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:rt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:it(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:at(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:st(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ot(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:nt(e,t)})};function jt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Ue(e,r.scope,t,i);return M(o)})}function Gt(e,r,t={}){return Oe(e,[r],t)[0]}function Oe(e,r,t={}){return he(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(a=>me[a](e,t.scope,n,i))})}function he(e,r,t){let i=Q(e),o=ct(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Yt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Ue(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function We(e,r,t){return s(e,t,"dead",()=>{let i=U(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(dt(e,i.symbols))})}function qe(e,r,t){return s(e,t,"isolated",()=>{let i=j(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(pt(e,i))})}function je(e,r,t){return s(e,t,"cycles",()=>O(e,{scope:r}).filter(o=>o.kind==="real").length)}function Ge(e,r,t){return s(e,t,"similar",()=>Y(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"extract-candidates",()=>q(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Xe(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Qe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Je(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return mt(i)})}function Ke(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ze(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,gt)})}function et(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function tt(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=J(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=G(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,Ct)})}function it(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=X(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ot(e,r){return s(e,r,"git-evidence",()=>{let t=I(e);if(!t)return null;let i=N(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:z(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function nt(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function at(e,r,t){return s(e,t,"drift",()=>{let i=W(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function st(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=K(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function ct(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ut(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){lt(t);try{return i()}finally{ut(e,r)}}function lt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function pt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function ht(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function gt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function ft(e){return e.actionTier==="signal"?.25:1}function Ct(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ne as a,jt as b,Gt as c,Oe as d,Yt as e};
2
- //# sourceMappingURL=chunk-NWFSC356.js.map
1
+ import{a as oe}from"./chunk-FG4NT6VY.js";import{a as ne}from"./chunk-VOYOYC5T.js";import{a as te}from"./chunk-QPU7EXAW.js";import{a as ie}from"./chunk-LZHUWKGD.js";import{a as re}from"./chunk-HHN2B5KA.js";import{a as Z}from"./chunk-FAYI6KZ5.js";import{a as ee}from"./chunk-RVWSAMTT.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-QVI3NR7E.js";import{a as X}from"./chunk-AW2QHPLL.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{c as Y}from"./chunk-FRPEPTYJ.js";import{a as j}from"./chunk-A6TANQNV.js";import{a as G}from"./chunk-KX5PLFZ5.js";import{a as q}from"./chunk-ZU6PROUY.js";import{a as W}from"./chunk-CZ425R2B.js";import{a as T,b as U}from"./chunk-3Q77KKEY.js";import{b as N}from"./chunk-65AU3HFZ.js";import{b as I,c as z}from"./chunk-BSN22NRK.js";import{a as K}from"./chunk-Y6E3JHC4.js";import{a as O}from"./chunk-QYB5P7GL.js";import{f as A,g as k}from"./chunk-C5CTSJ6X.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ke(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:We(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:qe(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:je(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Ge(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Xe(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Qe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Je(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Ke(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ze(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:et(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ye(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:tt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:rt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:it(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:at(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:st(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ot(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:nt(e,t)})};function jt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Ue(e,r.scope,t,i);return M(o)})}function Gt(e,r,t={}){return Oe(e,[r],t)[0]}function Oe(e,r,t={}){return he(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(a=>me[a](e,t.scope,n,i))})}function he(e,r,t){let i=Q(e),o=ct(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Yt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Ue(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function We(e,r,t){return s(e,t,"dead",()=>{let i=U(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(dt(e,i.symbols))})}function qe(e,r,t){return s(e,t,"isolated",()=>{let i=j(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(pt(e,i))})}function je(e,r,t){return s(e,t,"cycles",()=>O(e,{scope:r}).filter(o=>o.kind==="real").length)}function Ge(e,r,t){return s(e,t,"similar",()=>Y(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"extract-candidates",()=>q(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Xe(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Qe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Je(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return mt(i)})}function Ke(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ze(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,gt)})}function et(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function tt(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=J(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=G(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,Ct)})}function it(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=X(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ot(e,r){return s(e,r,"git-evidence",()=>{let t=I(e);if(!t)return null;let i=N(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:z(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function nt(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function at(e,r,t){return s(e,t,"drift",()=>{let i=W(e,{scope:r,...p.drift,includePatternDeviations:!1}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function st(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=K(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function ct(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ut(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){lt(t);try{return i()}finally{ut(e,r)}}function lt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function pt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function ht(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function gt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function ft(e){return e.actionTier==="signal"?.25:1}function Ct(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ne as a,jt as b,Gt as c,Oe as d,Yt as e};
2
+ //# sourceMappingURL=chunk-6LNQOOTB.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-YZA6PPZL.js";import{a as m,b as d,c as _,d as g}from"./chunk-BTCASU5J.js";import{a as x,i as N,j as S}from"./chunk-DS6QEB3G.js";import{b as h,d as L,e as A}from"./chunk-C6ROZBJA.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=x(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?_(t)?.language??null:m(e)}function Q(e,t,r,n){let c=h(e,t,n),u=L(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return A(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=N(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
- //# sourceMappingURL=chunk-6TDOT7B3.js.map
1
+ import{a as C}from"./chunk-YZA6PPZL.js";import{a as m,b as d,c as _,d as g}from"./chunk-HF25DFSC.js";import{a as x,i as N,j as S}from"./chunk-DS6QEB3G.js";import{b as h,d as L,e as A}from"./chunk-XUGQU7PM.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=x(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?_(t)?.language??null:m(e)}function Q(e,t,r,n){let c=h(e,t,n),u=L(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return A(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=N(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
+ //# sourceMappingURL=chunk-72KY2ZFO.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-XPOZO76D.js";import{a as f}from"./chunk-YNSVAJR6.js";import{a as c}from"./chunk-ZMU6IWDK.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
- //# sourceMappingURL=chunk-7KJBH4IP.js.map
1
+ import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-GBEYTDY5.js";import{a as f}from"./chunk-UQLFQLAF.js";import{a as c}from"./chunk-SULEXAHO.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
+ //# sourceMappingURL=chunk-736BLPHR.js.map
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-PFOCOG57.js";import{a as d}from"./chunk-GBEYTDY5.js";import{a as c}from"./chunk-F6ICF7HL.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as u}from"./chunk-72KY2ZFO.js";import{a as o}from"./chunk-HF25DFSC.js";function F(r,t={}){let{scope:l,limit:s=30,scanLimit:b}=t,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:t.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>y(e.relativePath)),scanLimit:b,evaluate:e=>{let n=u(r,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let L=c(r,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||h(L.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function y(r){let t=o(r);return t==="typescript"||t==="tsx"||t==="javascript"}function h(r,t,l){return r?r.some(s=>s>t&&s<=l):!1}export{F as a};
2
+ //# sourceMappingURL=chunk-7JRRXGVZ.js.map
@@ -1,7 +1,7 @@
1
- import{a as u}from"./chunk-XPOZO76D.js";import{a as b}from"./chunk-T633QLYF.js";import{u as l}from"./chunk-3LQFMQPY.js";import{c as m}from"./chunk-JM72FNGA.js";import{readFileSync as p}from"fs";import{join as h}from"path";function O(e,n,r={}){let t=b(e,n);if(!t)return null;let c=new u(e),o=P(d(e,t.relativePath,t.startLine,t.endLine),y(e,t.relativePath)),s=t.endLine-t.startLine+1,a=c.calleeMap([t],{additive:!0,semantic:r.semantic}).get(t.symbolId)??[],f=new Set(a.map(g=>g.symbol));return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s,branches:o,cyclomaticEstimate:o+1,calleeCount:f.size,fanIn:S(e,t.symbolId),fanOut:L(a,t.relativePath)}}function y(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function d(e,n,r,t){try{return p(h(e.config.projectRoot,n),"utf-8").split(`
1
+ import{a as u}from"./chunk-GBEYTDY5.js";import{a as b}from"./chunk-PTQVNJ4Q.js";import{u as l}from"./chunk-OBGRLXWF.js";import{c as m}from"./chunk-JM72FNGA.js";import{readFileSync as p}from"fs";import{join as h}from"path";function O(e,n,r={}){let t=b(e,n);if(!t)return null;let c=new u(e),o=P(d(e,t.relativePath,t.startLine,t.endLine),y(e,t.relativePath)),s=t.endLine-t.startLine+1,a=c.calleeMap([t],{additive:!0,semantic:r.semantic}).get(t.symbolId)??[],f=new Set(a.map(g=>g.symbol));return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s,branches:o,cyclomaticEstimate:o+1,calleeCount:f.size,fanIn:S(e,t.symbolId),fanOut:L(a,t.relativePath)}}function y(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function d(e,n,r,t){try{return p(h(e.config.projectRoot,n),"utf-8").split(`
2
2
  `).slice(r,t+1).join(`
3
3
  `)}catch{return""}}function S(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
5
5
  JOIN chunks c ON m.chunk_id = c.id
6
6
  WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function L(e,n){return new Set(e.filter(r=>r.file!==n).map(r=>r.symbol)).size}function P(e,n){let r=l(e),t=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of c){let s=r.match(o);s&&(t+=s.length)}if(n==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}return t}export{O as a};
7
- //# sourceMappingURL=chunk-RHKMQNFI.js.map
7
+ //# sourceMappingURL=chunk-7UQWUVRG.js.map