scip-query 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +14 -7
  2. package/dist/{chunk-FCC3XJTI.js → chunk-26LSAIEP.js} +2 -2
  3. package/dist/{chunk-SG35Y7J2.js → chunk-2HEJQBMS.js} +2 -2
  4. package/dist/chunk-3FG3VLK3.js +65 -0
  5. package/dist/{chunk-DE5ZBHMK.js → chunk-3J463LOK.js} +2 -2
  6. package/dist/{chunk-XVDASCN7.js → chunk-3QJ2NOYG.js} +2 -2
  7. package/dist/{chunk-AJ5PWKD4.js → chunk-3T53QAUS.js} +2 -2
  8. package/dist/chunk-435YC4OF.js +2 -0
  9. package/dist/chunk-4LBOHXT7.js +6 -0
  10. package/dist/chunk-5IM4IQ6N.js +2 -0
  11. package/dist/{chunk-BDBRZPX3.js → chunk-5NRGSXZQ.js} +2 -2
  12. package/dist/chunk-5V76WMMZ.js +5 -0
  13. package/dist/{chunk-HMKJTAZD.js → chunk-5VU2RVKI.js} +2 -2
  14. package/dist/{chunk-NTDA4A2D.js → chunk-5W22HCSF.js} +2 -2
  15. package/dist/{chunk-IBGBI3VU.js → chunk-67UXTIFZ.js} +2 -2
  16. package/dist/{chunk-SDX6MDBL.js → chunk-6ALIV5SZ.js} +2 -2
  17. package/dist/{chunk-K5FQFCSN.js → chunk-6CTMG3IF.js} +2 -2
  18. package/dist/{chunk-BQ3INTYT.js → chunk-6XP3KWHC.js} +2 -2
  19. package/dist/chunk-7DKDFRXQ.js +7 -0
  20. package/dist/{chunk-LX4H4LLG.js → chunk-7NEBSLI3.js} +2 -2
  21. package/dist/chunk-AEMTUHQ7.js +2 -0
  22. package/dist/{chunk-Y7LOQSWY.js → chunk-AVLUWGXG.js} +2 -2
  23. package/dist/chunk-AZQ3ENHU.js +2 -0
  24. package/dist/{chunk-ZXKURFVB.js → chunk-AZTWY4OT.js} +2 -2
  25. package/dist/{chunk-BE6EQIWY.js → chunk-CHW7433E.js} +2 -2
  26. package/dist/chunk-CW5K3KIF.js +12 -0
  27. package/dist/{chunk-ZSRXMNMK.js → chunk-F6F2QUIH.js} +3 -3
  28. package/dist/{chunk-D7KLLMPB.js → chunk-FJV7QT4G.js} +2 -2
  29. package/dist/chunk-FPDWFGBQ.js +19 -0
  30. package/dist/chunk-G2SX5EHW.js +2 -0
  31. package/dist/{chunk-RWE6FHG3.js → chunk-GK6VXKLY.js} +2 -2
  32. package/dist/{chunk-STOGKRJH.js → chunk-HS5LX75F.js} +2 -2
  33. package/dist/{chunk-D7YBWSON.js → chunk-HS65NNKP.js} +2 -2
  34. package/dist/{chunk-DHYIJHXZ.js → chunk-LKCPNPHH.js} +2 -2
  35. package/dist/{chunk-JS2RNIC7.js → chunk-MQ5FKM2F.js} +2 -2
  36. package/dist/{chunk-WTSTDJZ7.js → chunk-NFOSOUH6.js} +2 -2
  37. package/dist/{chunk-4QJ7LVW5.js → chunk-NLWXQMKR.js} +2 -2
  38. package/dist/{chunk-YIPCV7M7.js → chunk-ORD3HEWI.js} +2 -2
  39. package/dist/{chunk-2RLP74AO.js → chunk-OU2D2T4A.js} +2 -2
  40. package/dist/{chunk-NXMYYHDO.js → chunk-P6IUCZA3.js} +2 -2
  41. package/dist/{chunk-2DSS2NGF.js → chunk-PU7P5NPE.js} +2 -2
  42. package/dist/chunk-QSTMORTI.js +2 -0
  43. package/dist/{chunk-QXE6EDY2.js → chunk-RC2PKZSS.js} +2 -2
  44. package/dist/chunk-S65VVU3R.js +2 -0
  45. package/dist/{chunk-IYFZS4PV.js → chunk-SPMLGXCE.js} +5 -5
  46. package/dist/{chunk-GXVB36TG.js → chunk-T26XHATT.js} +2 -2
  47. package/dist/chunk-TWYHFB5K.js +2 -0
  48. package/dist/{chunk-XAZTIDST.js → chunk-TXADWK4I.js} +2 -2
  49. package/dist/chunk-YRUHPGC3.js +7 -0
  50. package/dist/chunk-ZJM2HD2Z.js +2 -0
  51. package/dist/chunk-ZORIMKQO.js +2 -0
  52. package/dist/cli.js +218 -169
  53. package/dist/{db-BSTtBG_H.d.ts → db-DKhNQ75l.d.ts} +15 -1
  54. package/dist/index.d.ts +36 -3
  55. package/dist/index.js +60 -12
  56. package/dist/queries/affected.d.ts +1 -1
  57. package/dist/queries/affected.js +1 -1
  58. package/dist/queries/bottlenecks.d.ts +1 -1
  59. package/dist/queries/bottlenecks.js +1 -1
  60. package/dist/queries/by-kind.d.ts +1 -1
  61. package/dist/queries/by-kind.js +1 -1
  62. package/dist/queries/call-graph.d.ts +1 -1
  63. package/dist/queries/call-graph.js +1 -1
  64. package/dist/queries/change-surface.d.ts +1 -1
  65. package/dist/queries/change-surface.js +1 -1
  66. package/dist/queries/code.d.ts +1 -1
  67. package/dist/queries/code.js +1 -1
  68. package/dist/queries/complexity-hotspots.d.ts +1 -1
  69. package/dist/queries/complexity-hotspots.js +1 -1
  70. package/dist/queries/complexity.d.ts +1 -1
  71. package/dist/queries/complexity.js +1 -1
  72. package/dist/queries/convergence.d.ts +1 -1
  73. package/dist/queries/convergence.js +1 -1
  74. package/dist/queries/coupling.d.ts +1 -1
  75. package/dist/queries/coupling.js +1 -1
  76. package/dist/queries/cycles.d.ts +1 -1
  77. package/dist/queries/cycles.js +1 -1
  78. package/dist/queries/dataflow.d.ts +1 -1
  79. package/dist/queries/dataflow.js +1 -1
  80. package/dist/queries/dead.d.ts +1 -1
  81. package/dist/queries/dead.js +1 -1
  82. package/dist/queries/deep-chains.d.ts +1 -1
  83. package/dist/queries/deep-chains.js +1 -1
  84. package/dist/queries/deps.d.ts +1 -1
  85. package/dist/queries/deps.js +1 -1
  86. package/dist/queries/diff-impact.d.ts +1 -1
  87. package/dist/queries/diff-impact.js +1 -1
  88. package/dist/queries/drift.d.ts +1 -1
  89. package/dist/queries/drift.js +1 -1
  90. package/dist/queries/extract-candidates.d.ts +1 -1
  91. package/dist/queries/extract-candidates.js +1 -1
  92. package/dist/queries/fan.d.ts +1 -1
  93. package/dist/queries/fan.js +1 -1
  94. package/dist/queries/files.d.ts +1 -1
  95. package/dist/queries/health.d.ts +1 -1
  96. package/dist/queries/health.js +1 -1
  97. package/dist/queries/hierarchy.d.ts +1 -1
  98. package/dist/queries/hierarchy.js +1 -1
  99. package/dist/queries/hotspots.d.ts +1 -1
  100. package/dist/queries/hotspots.js +1 -1
  101. package/dist/queries/imports.d.ts +1 -1
  102. package/dist/queries/imports.js +1 -1
  103. package/dist/queries/index.d.ts +1 -1
  104. package/dist/queries/index.js +1 -1
  105. package/dist/queries/isolated.d.ts +1 -1
  106. package/dist/queries/isolated.js +1 -1
  107. package/dist/queries/members.d.ts +1 -1
  108. package/dist/queries/members.js +1 -1
  109. package/dist/queries/methods.d.ts +1 -1
  110. package/dist/queries/methods.js +1 -1
  111. package/dist/queries/outline.d.ts +1 -1
  112. package/dist/queries/outline.js +1 -1
  113. package/dist/queries/passthrough-candidates.d.ts +1 -1
  114. package/dist/queries/passthrough-candidates.js +1 -1
  115. package/dist/queries/redundant-reexports.d.ts +1 -1
  116. package/dist/queries/redundant-reexports.js +1 -1
  117. package/dist/queries/refs.d.ts +1 -1
  118. package/dist/queries/refs.js +1 -1
  119. package/dist/queries/similar-chains.d.ts +1 -1
  120. package/dist/queries/similar-chains.js +1 -1
  121. package/dist/queries/similar-files.d.ts +1 -1
  122. package/dist/queries/similar-files.js +1 -1
  123. package/dist/queries/similar-signatures.d.ts +1 -1
  124. package/dist/queries/similar-signatures.js +1 -1
  125. package/dist/queries/similar.d.ts +1 -1
  126. package/dist/queries/similar.js +1 -1
  127. package/dist/queries/slice.d.ts +1 -1
  128. package/dist/queries/slice.js +1 -1
  129. package/dist/queries/stale-abstractions.d.ts +2 -1
  130. package/dist/queries/stale-abstractions.js +1 -1
  131. package/dist/queries/stats.d.ts +1 -1
  132. package/dist/queries/surface.d.ts +1 -1
  133. package/dist/queries/surface.js +1 -1
  134. package/dist/queries/symbols.d.ts +1 -1
  135. package/dist/queries/symbols.js +1 -1
  136. package/dist/queries/system.d.ts +1 -1
  137. package/dist/queries/system.js +1 -1
  138. package/dist/queries/trace.d.ts +1 -1
  139. package/dist/queries/trace.js +1 -1
  140. package/dist/queries/wrapper-candidates.d.ts +1 -1
  141. package/dist/queries/wrapper-candidates.js +1 -1
  142. package/dist/reindex-worker.js +63 -5
  143. package/package.json +15 -16
  144. package/skills/concrete-plan/SKILL.md +51 -25
  145. package/skills/scip-debloat/SKILL.md +3 -6
  146. package/skills/scip-language-playbook/SKILL.md +2 -0
  147. package/dist/chunk-5IADAU5B.js +0 -7
  148. package/dist/chunk-7754WFFV.js +0 -18
  149. package/dist/chunk-7VOF4ZG6.js +0 -2
  150. package/dist/chunk-7Z4COVMC.js +0 -2
  151. package/dist/chunk-EEF3YEHW.js +0 -2
  152. package/dist/chunk-F2LLHRRZ.js +0 -2
  153. package/dist/chunk-GNXRLK5G.js +0 -2
  154. package/dist/chunk-JH3A7HTU.js +0 -2
  155. package/dist/chunk-K6GBKEQE.js +0 -6
  156. package/dist/chunk-KO7YJRWP.js +0 -12
  157. package/dist/chunk-PZ6ESKRH.js +0 -7
  158. package/dist/chunk-RJ7SPBJ5.js +0 -5
  159. package/dist/chunk-TINPMWJK.js +0 -2
  160. package/dist/chunk-UJB62HV3.js +0 -2
  161. package/dist/chunk-VEUMRDHW.js +0 -2
  162. package/dist/chunk-WCDXJGYT.js +0 -65
  163. package/dist/chunk-Y7H6D2EV.js +0 -2
@@ -1,4 +1,4 @@
1
- import{a as m}from"./chunk-WTSTDJZ7.js";function c(e,n,o){let d=m(e,n)??n,s=m(e,o)??o,t=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
1
+ import{a as m}from"./chunk-NFOSOUH6.js";function c(e,n,o){let d=m(e,n)??n,s=m(e,o)??o,t=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
2
2
  FROM global_symbols gs
3
3
  WHERE (
4
4
  -- Defined in file1, referenced in file2
@@ -53,4 +53,4 @@ import{a as m}from"./chunk-WTSTDJZ7.js";function c(e,n,o){let d=m(e,n)??n,s=m(e,
53
53
  GROUP BY def_d.id, ref_d.id
54
54
  ORDER BY shared DESC
55
55
  LIMIT ?`,o).filter(i=>!e.isIgnored(i.file1)&&!e.isIgnored(i.file2)).map(i=>({file1:i.file1,file2:i.file2,sharedSymbols:i.shared}))}export{c as a,r as b};
56
- //# sourceMappingURL=chunk-ZXKURFVB.js.map
56
+ //# sourceMappingURL=chunk-AZTWY4OT.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-LX4H4LLG.js";import{p as l}from"./chunk-IYFZS4PV.js";import{b as m,d as o,h as i}from"./chunk-TINPMWJK.js";function f(r,a){let t=n(r,a);return t?l(r,t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>i(t.symbol,e.symbol)).sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine).map(e=>({symbol:e.symbol,shortName:m(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{f as a};
2
- //# sourceMappingURL=chunk-BE6EQIWY.js.map
1
+ import{a as n}from"./chunk-7NEBSLI3.js";import{p as l}from"./chunk-SPMLGXCE.js";import{b as m,d as o,j as i}from"./chunk-5IM4IQ6N.js";function f(r,a){let t=n(r,a);return t?l(r,t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>i(t.symbol,e.symbol)).sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine).map(e=>({symbol:e.symbol,shortName:m(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{f as a};
2
+ //# sourceMappingURL=chunk-CHW7433E.js.map
@@ -0,0 +1,12 @@
1
+ import{a as y,b as A}from"./chunk-QSTMORTI.js";import{d as C,e as B,f as $,g as W,h as H}from"./chunk-AEMTUHQ7.js";import{c as M}from"./chunk-F6F2QUIH.js";import{a as w,b as D,c as O,f as k}from"./chunk-3FG3VLK3.js";import{f as T,g as I,q as x,v as N}from"./chunk-SPMLGXCE.js";import{b as L,f as R,g as E,h as P,i as F}from"./chunk-5IM4IQ6N.js";function se(t,a={}){let{scope:p,minLoc:c=1,includeTests:o=!1,skipBarrels:m=!1,includeMembers:s=!1}=a,n=m?new Set(C(t)):new Set,i=t.all(`SELECT
2
+ m.symbol_id,
3
+ d.relative_path,
4
+ COUNT(*) AS ref_count
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents d ON c.document_id = d.id
8
+ WHERE m.role != 1
9
+ ${t.pathExclusionsFor("d")}
10
+ GROUP BY m.symbol_id, d.relative_path`),f=new Map;for(let e of i){if(t.isIgnored(e.relative_path)||n.has(e.relative_path))continue;let r=f.get(e.symbol_id);r||(r=new Map,f.set(e.symbol_id,r)),r.set(e.relative_path,e.ref_count)}V(t,f,n);let u=G(t),g=x(t,{scope:p}).filter(e=>!t.isIgnored(e.relativePath)).filter(e=>!E(e.symbol)).filter(e=>b(e.symbol)).filter(e=>e.isFunctionLike||!e.enclosingSymbol||!b(e.enclosingSymbol)).filter(e=>o||Y(e.relativePath)).filter(e=>o||!u(e.relativePath,e.startLine,e.symbol,e.parentTypeName)).filter(e=>!P(e.symbol)).filter(e=>!F(e.symbol)).filter(e=>s||b(e.symbol)).filter(e=>e.endLine-e.startLine+1>=c).map(e=>{let r=f.get(e.symbolId)??new Map,U=r.get(e.relativePath)??0,v=0;for(let[j,J]of r)j!==e.relativePath&&(v+=J);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:U,cross_file_refs:v}}).filter(e=>e.cross_file_refs===0).sort((e,r)=>r.loc-e.loc||e.relative_path.localeCompare(r.relative_path)||e.start_line-r.start_line),l=0,d=0,_=0,S=g.filter(e=>!t.isIgnored(e.relative_path)).filter(e=>!B(t,e.relative_path)).filter(e=>!$(t,e.symbol,e.relative_path)).map(e=>{let r=e.same_file_refs===0?"dead-code":"file-internal";return r==="dead-code"?l++:d++,_+=e.loc,{relativePath:e.relative_path,startLine:e.start_line,endLine:e.end_line,loc:e.loc,symbol:e.symbol,shortName:L(e.symbol),sameFileRefs:e.same_file_refs,kind:r}});return{symbols:S,totalCount:S.length,deadCodeCount:l,fileInternalCount:d,totalLoc:_}}function V(t,a,p){let c=t.all(`SELECT relative_path FROM documents
11
+ WHERE 1 = 1 ${t.pathExclusionsFor("documents")}`),o=new Set(c.map(n=>n.relative_path)),m=new Set(M(t));for(let n of o)m.add(n);let s=(n,i,f)=>{if(f<=0)return;let u=a.get(n);u||(u=new Map,a.set(n,u)),u.set(i,(u.get(i)??0)+f)};for(let n of m){if(!T(n)&&!I(n)||t.isIgnored(n)||p.has(n))continue;let i=k(t,n);for(let[h,g]of i){let l=A(t,n,h);if(l.length!==0)for(let d of l){let _=d.relativePath===n?Math.max(0,g.length-1):g.length;s(d.symbolId,n,_)}}let f=O(t,n);for(let h of f){let g=y(t,n,h);for(let l of g)l.relativePath!==n&&s(l.symbolId,n,1)}let u=D(t,n);for(let h of u){let g=y(t,n,h);for(let l of g)s(l.symbolId,n,1)}}}function G(t){let a=new Map,p=c=>{let o=a.get(c);if(o)return o;let m=w(t,c);return o={ranges:m.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(m.map(s=>s.containerName).filter(s=>!!s))},a.set(c,o),o};return(c,o,m,s)=>{let n=p(c);for(let i of n.ranges)if(o>=i.startLine&&o<=i.endLine)return!0;if(s&&n.containers.has(s))return!0;for(let i of N(m))if(n.containers.has(i))return!0;return!1}}function Y(t){return[...new Set([...W,...H])].every(p=>!q(t,p))}function q(t,a){return new RegExp(`^${a.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/%/g,".*").replace(/_/g,".")}$`).test(t)}function b(t){return R(t)||t.endsWith("().")||t.endsWith(".")}export{se as a};
12
+ //# sourceMappingURL=chunk-CW5K3KIF.js.map
@@ -1,5 +1,5 @@
1
- import{a as u}from"./chunk-IYFZS4PV.js";import{readdirSync as l}from"fs";import{extname as d,join as p}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"];var S=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function v(o,i={}){let s=i.includeIndexed??!0,r=i.includeAuxiliary??!0,t=i.extensions?new Set(i.extensions.map(n=>n.toLowerCase())):new Set(x.map(n=>n.toLowerCase())),c=`${s?"1":"0"}|${r?"1":"0"}|${[...t].sort().join(",")}`;return f.get(o,c,()=>{let n=new Set;if(s){let e=o.all(`SELECT relative_path
1
+ import{a as u}from"./chunk-SPMLGXCE.js";import{readdirSync as l}from"fs";import{extname as d,join as p}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],v=[".vue"],S=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function _(o,i={}){let s=i.includeIndexed??!0,r=i.includeAuxiliary??!0,t=i.extensions?new Set(i.extensions.map(n=>n.toLowerCase())):new Set(x.map(n=>n.toLowerCase())),c=`${s?"1":"0"}|${r?"1":"0"}|${[...t].sort().join(",")}`;return f.get(o,c,()=>{let n=new Set;if(s){let e=o.all(`SELECT relative_path
2
2
  FROM documents
3
3
  WHERE 1 = 1
4
- ${o.pathExclusionsFor("documents")}`);for(let a of e)o.isIgnored(a.relative_path)||t.has(d(a.relative_path).toLowerCase())&&n.add(a.relative_path)}if(r)for(let e of g(o.config.projectRoot,t))o.isIgnored(e)||n.add(e);return[...n].sort()})}var f=u("source-files");function g(o,i){let s=new Set,r=t=>{let c=t?p(o,t):o,n=[];try{n=l(c,{withFileTypes:!0})}catch{return}for(let e of n)if(!S.has(e.name)){if(e.isDirectory()){r(t?`${t}/${e.name}`:e.name);continue}i.has(d(e.name).toLowerCase())&&s.add(t?`${t}/${e.name}`:e.name)}};return r(""),s}export{v as a};
5
- //# sourceMappingURL=chunk-ZSRXMNMK.js.map
4
+ ${o.pathExclusionsFor("documents")}`);for(let a of e)o.isIgnored(a.relative_path)||t.has(d(a.relative_path).toLowerCase())&&n.add(a.relative_path)}if(r)for(let e of g(o.config.projectRoot,t))o.isIgnored(e)||n.add(e);return[...n].sort()})}var f=u("source-files");function g(o,i){let s=new Set,r=t=>{let c=t?p(o,t):o,n=[];try{n=l(c,{withFileTypes:!0})}catch{return}for(let e of n)if(!S.has(e.name)){if(e.isDirectory()){r(t?`${t}/${e.name}`:e.name);continue}i.has(d(e.name).toLowerCase())&&s.add(t?`${t}/${e.name}`:e.name)}};return r(""),s}export{v as a,S as b,_ as c};
5
+ //# sourceMappingURL=chunk-F6F2QUIH.js.map
@@ -1,2 +1,2 @@
1
- import{f as S,j as M}from"./chunk-WCDXJGYT.js";import{a as g,b as I}from"./chunk-LX4H4LLG.js";import{p as d,t as p}from"./chunk-IYFZS4PV.js";import{b as u}from"./chunk-TINPMWJK.js";function N(s,f,n={}){let{maxDepth:a=5,scope:b}=n,c=g(s,f);if(!c)return[];let i=[],y=new Set([c.symbolId]),r=new Set,l=[c];for(let e=1;e<=a&&l.length!==0;e++){let t=[];for(let m of l)for(let o of w(s,m,b)){let h=`${o.file}|${o.shortName}`;if(o.symbolId!==null){if(y.has(o.symbolId))continue;y.add(o.symbolId)}else if(r.has(h))continue;r.add(h),i.push({symbol:o.symbol,shortName:o.shortName,file:o.file,depth:e}),o.symbolId!==null&&o.symbolMatch&&t.push(o.symbolMatch)}l=t}return i.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),i}function w(s,f,n){let a=S(s,f,{limit:500}).filter(e=>!s.isIgnored(e.file)).filter(e=>!n||e.file.includes(n)),b=new Set(a.map(e=>e.file)),c=M(s).get(f.symbolId)??new Set,i=[];for(let e of c){if(b.has(e)||s.isIgnored(e)||n&&!e.includes(n))continue;let t=d(s,e),m=t.length>0?p(t,t[0].startLine):null;i.push({symbol:m?.symbol??e,file:e})}let y=[...a,...i],r=[],l=new Set;for(let e of y){let t=I(s,e.symbol);if(!t){let o=`${e.file}|${e.symbol}`;if(l.has(o))continue;l.add(o),r.push({symbolId:null,symbol:e.symbol,shortName:u(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===f.symbolId||s.isIgnored(t.relativePath))continue;let m=`${t.symbolId}|${t.relativePath}`;l.has(m)||(l.add(m),r.push({symbolId:t.symbolId,symbol:t.symbol,shortName:u(t.symbol),file:t.relativePath,symbolMatch:t}))}return r}export{N as a};
2
- //# sourceMappingURL=chunk-D7KLLMPB.js.map
1
+ import{i as S,m as M}from"./chunk-3FG3VLK3.js";import{a as g,b as I}from"./chunk-7NEBSLI3.js";import{p as d,t as p}from"./chunk-SPMLGXCE.js";import{b as u}from"./chunk-5IM4IQ6N.js";function N(s,f,n={}){let{maxDepth:a=5,scope:b}=n,c=g(s,f);if(!c)return[];let i=[],y=new Set([c.symbolId]),r=new Set,l=[c];for(let e=1;e<=a&&l.length!==0;e++){let t=[];for(let m of l)for(let o of w(s,m,b)){let h=`${o.file}|${o.shortName}`;if(o.symbolId!==null){if(y.has(o.symbolId))continue;y.add(o.symbolId)}else if(r.has(h))continue;r.add(h),i.push({symbol:o.symbol,shortName:o.shortName,file:o.file,depth:e}),o.symbolId!==null&&o.symbolMatch&&t.push(o.symbolMatch)}l=t}return i.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),i}function w(s,f,n){let a=S(s,f,{limit:500}).filter(e=>!s.isIgnored(e.file)).filter(e=>!n||e.file.includes(n)),b=new Set(a.map(e=>e.file)),c=M(s).get(f.symbolId)??new Set,i=[];for(let e of c){if(b.has(e)||s.isIgnored(e)||n&&!e.includes(n))continue;let t=d(s,e),m=t.length>0?p(t,t[0].startLine):null;i.push({symbol:m?.symbol??e,file:e})}let y=[...a,...i],r=[],l=new Set;for(let e of y){let t=I(s,e.symbol);if(!t){let o=`${e.file}|${e.symbol}`;if(l.has(o))continue;l.add(o),r.push({symbolId:null,symbol:e.symbol,shortName:u(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===f.symbolId||s.isIgnored(t.relativePath))continue;let m=`${t.symbolId}|${t.relativePath}`;l.has(m)||(l.add(m),r.push({symbolId:t.symbolId,symbol:t.symbol,shortName:u(t.symbol),file:t.relativePath,symbolMatch:t}))}return r}export{N as a};
2
+ //# sourceMappingURL=chunk-FJV7QT4G.js.map
@@ -0,0 +1,19 @@
1
+ import{b as v}from"./chunk-QSTMORTI.js";import{a as $}from"./chunk-AEMTUHQ7.js";import{b as y,f as S,g as I}from"./chunk-3FG3VLK3.js";import{e as k}from"./chunk-6XP3KWHC.js";import{f as _}from"./chunk-SPMLGXCE.js";import g from"path";function J(t,r){let{scope:s}=r??{},l=I(t,s),n=O(t,s),c=[];for(let[e,a]of l){if(m(e))continue;let u=n.get(e)??new Set;for(let o of a)if(!m(o)&&!u.has(o)){if(E(o)||R(t,e,o))continue;c.push({file:e,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}let i=D(l);for(let[e,a]of l){if(m(e))continue;let u=h(e);for(let o of a){if(m(o))continue;let f=h(o);if(u===f)continue;i.get(`${u}->${f}`)==="violation"&&c.push({file:e,kind:"layer-violation",description:`Imports from ${f}/ (${o}) \u2014 may cross architectural boundary`,dep:o,detail:`${u}/ should not depend on ${f}/`})}}let p=new Map;for(let e of l.keys()){let a=g.dirname(e);p.has(a)||p.set(a,[]),p.get(a).push(e)}for(let[e,a]of p){let u=a.filter(f=>!m(f));if(u.length<5)continue;let o=new Map;for(let f of u)for(let d of l.get(f)??[])m(d)||o.set(d,(o.get(d)??0)+1);for(let f of u)for(let d of l.get(f)??[])m(d)||(o.get(d)??0)===1&&g.dirname(d)!==e&&g.dirname(d)!==g.dirname(e)&&c.push({file:f,kind:"pattern-deviation",description:`Only file in ${e}/ that depends on ${d}`,dep:d})}return{results:c,unusedImports:c.filter(e=>e.kind==="unused-import").length,layerViolations:c.filter(e=>e.kind==="layer-violation").length,patternDeviations:c.filter(e=>e.kind==="pattern-deviation").length}}function O(t,r){let s=r?`AND d1.relative_path LIKE '%${r}%'`:"",l=t.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d1 ON c.document_id = d1.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ JOIN documents d2 ON sym_def.document_id = d2.id
14
+ WHERE d1.id != d2.id
15
+ AND m.role != 1
16
+ ${t.pathExclusionsFor("d1","d2")}
17
+ ${s}`),n=new Map;for(let i of l)t.isIgnored(i.from_file)||t.isIgnored(i.to_file)||(n.has(i.from_file)||n.set(i.from_file,new Set),n.get(i.from_file).add(i.to_file));let c=t.all(`SELECT relative_path FROM documents
18
+ WHERE 1 = 1 ${t.pathExclusionsFor("documents")}`);for(let i of c){if(t.isIgnored(i.relative_path)||!_(i.relative_path))continue;let p=S(t,i.relative_path),e=n.get(i.relative_path);for(let a of p.keys()){let u=v(t,i.relative_path,a);for(let o of u)o.relativePath!==i.relative_path&&(t.isIgnored(o.relativePath)||(e||(e=new Set,n.set(i.relative_path,e)),e.add(o.relativePath)))}if(_(i.relative_path)==="rust"){let a=y(t,i.relative_path);for(let u of a){let o=v(t,i.relative_path,u);for(let f of o)f.relativePath!==i.relative_path&&(t.isIgnored(f.relativePath)||(e||(e=new Set,n.set(i.relative_path,e)),e.add(f.relativePath)))}}}return n}function D(t){let r=new Map,s=new Set;for(let[n,c]of t){if(m(n))continue;let i=h(n);s.add(i);for(let p of c){if(m(p))continue;let e=h(p);if(i===e)continue;s.add(e);let a=`${i}->${e}`;r.set(a,(r.get(a)??0)+1)}}let l=new Map;for(let[n,c]of r)l.set(n,c<=2?"violation":"ok");return l}function h(t){let s=t.replace(/\\/g,"/").split("/").filter(Boolean);return s.length<=1?"(root)":s.length>=3&&["src","lib","app","server","client"].includes(s[0])?`${s[0]}/${s[1]}`:s[0]}function E(t){return t.includes("types")||t.endsWith(".d.ts")}function R(t,r,s){let l=k(t,r).filter(n=>n.sourcePath===s);return l.length===0?!1:l.every(n=>n.kind==="side-effect"||n.kind==="namespace"&&n.usedMembers.length===0&&!n.used)}function m(t){let r=$(t);return!!(r==="entry"||r==="barrel"||r==="test"||r==="worker"||N(g.basename(t)))}function N(t){return!!(t==="index.ts"||t==="index.js"||t==="cli.ts"||t==="main.ts"||t==="main.rs"||t.includes("worker.")||t.includes("postinstall.")||t==="health.ts"||t==="health.js")}export{J as a};
19
+ //# sourceMappingURL=chunk-FPDWFGBQ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as x}from"./chunk-AEMTUHQ7.js";import{k}from"./chunk-3FG3VLK3.js";import{e as w,r as v}from"./chunk-SPMLGXCE.js";import{b,f as C,i as L}from"./chunk-5IM4IQ6N.js";function A(i,F={}){let{scope:I,minLoc:P=10,minCallees:z=6,limit:D=20}=F,y=v(i,I).filter(e=>!i.isIgnored(e.relativePath)).filter(e=>h(e)>=P&&C(e.symbol)).filter(e=>!(e.relativePath.split("/").pop()??"").includes("types")).filter(e=>x(e.relativePath)!=="test").filter(e=>!L(e.symbol)).filter(e=>!w(i,e.relativePath,e.startLine)).sort((e,r)=>h(r)-h(e)),E=k(i,y),d=[];for(let e of y){let r=E.get(e.symbolId)??[],c=new Set(r.map(t=>t.symbol));if(c.size<z)continue;let l=new Map;for(let t of c)l.set(t,new Set);let a=new Map;for(let t of r)a.has(t.chunkId)||a.set(t.chunkId,new Set),a.get(t.chunkId).add(t.symbol);for(let t of a.values()){let s=[...t];for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)l.get(s[o]).add(s[n]),l.get(s[n]).add(s[o])}let f=new Set,m=[];for(let t of c){if(f.has(t))continue;let s=new Set,o=[t];for(;o.length>0;){let n=o.pop();if(!f.has(n)){f.add(n),s.add(n);for(let u of l.get(n)??[])f.has(u)||o.push(u)}}m.push(s)}if(m.length<2)continue;let S=m.filter(t=>t.size>=3).map(t=>{let s=new Set;for(let p of m)if(p!==t)for(let g of p)s.add(g);let o=0;for(let p of t)for(let g of l.get(p)??[])s.has(g)&&o++;let n=t.size*s.size,u=n>0?1-o/n:1;return{callees:[...t].map(b),isolation:u}}).filter(t=>t.isolation>.5).sort((t,s)=>s.isolation-t.isolation);S.length>0&&d.push({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),totalCallees:c.size,clusters:S})}return d.sort((e,r)=>r.clusters.length-e.clusters.length||r.loc-e.loc),d.slice(0,D)}function h(i){return i.endLine-i.startLine+1}export{A as a};
2
+ //# sourceMappingURL=chunk-G2SX5EHW.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-LX4H4LLG.js";import{a as g,b as m}from"./chunk-TINPMWJK.js";function S(n,d){let c=f(n,d);if(!c)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as f}from"./chunk-7NEBSLI3.js";import{a as g,b as m}from"./chunk-5IM4IQ6N.js";function S(n,d){let c=f(n,d);if(!c)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,a=new Set([t.symbol]);for(;e&&!a.has(e)&&r<20;){a.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let h=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:h,shortName:h,depth:p})}return b}export{S as a};
3
- //# sourceMappingURL=chunk-RWE6FHG3.js.map
3
+ //# sourceMappingURL=chunk-GK6VXKLY.js.map
@@ -1,4 +1,4 @@
1
- import{b as S}from"./chunk-VEUMRDHW.js";import{g as d}from"./chunk-WCDXJGYT.js";import{a as g}from"./chunk-LX4H4LLG.js";import{d as u,n as m,o as f}from"./chunk-IYFZS4PV.js";import{b as s,f as a}from"./chunk-TINPMWJK.js";function _(n,o){let e=g(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=f(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=u(n,o);if(!t)return null;let l=t.split(`
1
+ import{c as S}from"./chunk-QSTMORTI.js";import{j as d}from"./chunk-3FG3VLK3.js";import{a as g}from"./chunk-7NEBSLI3.js";import{d as u,n as m,o as f}from"./chunk-SPMLGXCE.js";import{b as s,f as a}from"./chunk-5IM4IQ6N.js";function _(n,o){let e=g(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=f(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=u(n,o);if(!t)return null;let l=t.split(`
2
2
  `).slice(e,i+1).join(`
3
3
  `).trimEnd();return l.length>0?l:null}function b(n,o,e){let i=m(n);if(i&&!h(i))return i;let t=(o??"").trim();return t?a(e)&&!t.endsWith("()")?`${t}()`:t:s(e)}function h(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{_ as a};
4
- //# sourceMappingURL=chunk-STOGKRJH.js.map
4
+ //# sourceMappingURL=chunk-HS5LX75F.js.map
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-WTSTDJZ7.js";import{p as a}from"./chunk-IYFZS4PV.js";import{b as d,e as l}from"./chunk-TINPMWJK.js";function u(t,n){let s=m(t,n);if(s.length===0)return[];let i=s.map(()=>"?").join(", "),c=t.all(`SELECT DISTINCT d1.relative_path, gs.symbol
1
+ import{b as m}from"./chunk-NFOSOUH6.js";import{p as a}from"./chunk-SPMLGXCE.js";import{b as d,e as l}from"./chunk-5IM4IQ6N.js";function u(t,n){let s=m(t,n);if(s.length===0)return[];let i=s.map(()=>"?").join(", "),c=t.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 m}from"./chunk-WTSTDJZ7.js";import{p as a}from"./chunk-IYFZS4PV.js";
26
26
  AND ${t.localSymbolPredicate}
27
27
  ${t.pathExclusionsFor("d1")}
28
28
  ORDER BY d1.relative_path`,...s,...s,...s),p=s.flatMap(e=>a(t,e).filter(o=>l(o.symbol)).map(o=>({relative_path:e,symbol:o.symbol}))),r=new Set;return[...c,...p].filter(e=>!t.isIgnored(e.relative_path)).filter(e=>{let o=`${e.relative_path}|${e.symbol}`;return r.has(o)?!1:(r.add(o),!0)}).map(e=>({consumer:e.relative_path,symbol:e.symbol,shortName:d(e.symbol)}))}export{u as a};
29
- //# sourceMappingURL=chunk-D7YBWSON.js.map
29
+ //# sourceMappingURL=chunk-HS65NNKP.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-WTSTDJZ7.js";function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
1
+ import{a as s}from"./chunk-NFOSOUH6.js";function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
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
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-WTSTDJZ7.js";function r(e,d){let i=s(e,d);return i?e.
30
30
  WHERE d2.relative_path = ?
31
31
  AND d1.relative_path != ?
32
32
  ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{r as a,a as b};
33
- //# sourceMappingURL=chunk-DHYIJHXZ.js.map
33
+ //# sourceMappingURL=chunk-LKCPNPHH.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-LX4H4LLG.js";import{p as l}from"./chunk-IYFZS4PV.js";import{c as r,e as a}from"./chunk-TINPMWJK.js";import{basename as p}from"path";function M(t,c){let o=m(t,c);if(!o)return[];let s=r(o.symbol),i=l(t,o.relativePath).filter(e=>a(e.symbol)),n=i.filter(e=>e.parentTypeName===s||e.symbol.includes(s));return(n.length>0?n:f(p(o.relativePath))===s?i.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:r(e.symbol)}))}function f(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
- //# sourceMappingURL=chunk-JS2RNIC7.js.map
1
+ import{a as m}from"./chunk-7NEBSLI3.js";import{p as l}from"./chunk-SPMLGXCE.js";import{c as r,e as a}from"./chunk-5IM4IQ6N.js";import{basename as p}from"path";function M(t,c){let o=m(t,c);if(!o)return[];let s=r(o.symbol),i=l(t,o.relativePath).filter(e=>a(e.symbol)),n=i.filter(e=>e.parentTypeName===s||e.symbol.includes(s));return(n.length>0?n:f(p(o.relativePath))===s?i.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:r(e.symbol)}))}function f(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
+ //# sourceMappingURL=chunk-MQ5FKM2F.js.map
@@ -1,6 +1,6 @@
1
- import{a as c}from"./chunk-LX4H4LLG.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as f,join as g}from"path";function S(e,r){let t=u(e,r,{allowMultiple:!1})[0]?.relativePath;return t||v(e,r)}function M(e,r){return u(e,r,{allowMultiple:!0}).map(t=>t.relativePath)}function v(e,r){if(!r)return null;let t=r.replace(/\\/g,"/").replace(/^\.\//,""),a=f(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,n=g(e.config.projectRoot,a);return m(n)?a:null}function u(e,r,t){let a=h(r);if(!a)return[];let i=e.all(`SELECT relative_path
1
+ import{a as c}from"./chunk-7NEBSLI3.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as f,join as g}from"path";function S(e,r){let t=u(e,r,{allowMultiple:!1})[0]?.relativePath;return t||v(e,r)}function M(e,r){return u(e,r,{allowMultiple:!0}).map(t=>t.relativePath)}function v(e,r){if(!r)return null;let t=r.replace(/\\/g,"/").replace(/^\.\//,""),a=f(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,n=g(e.config.projectRoot,a);return m(n)?a:null}function u(e,r,t){let a=h(r);if(!a)return[];let i=e.all(`SELECT relative_path
2
2
  FROM documents
3
3
  WHERE 1 = 1
4
4
  ${e.pathExclusionsFor("documents")}
5
5
  ORDER BY relative_path`).filter(o=>!e.isIgnored(o.relative_path)).map(o=>({relativePath:o.relative_path,score:d(o.relative_path,a)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=c(e,r);return!o||e.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let s=i.filter(o=>o.score>=800);return s.length>0?t.allowMultiple?s:[s[0]]:t.allowMultiple?i:[i[0]]}function d(e,r){let t=h(e),a=p(t),n=p(r),i=0;return t===r&&(i+=1200),t.endsWith(`/${r}`)&&(i+=1100),a===n&&(i+=900),t.startsWith(`${r}/`)&&(i+=850),t.includes(r)&&(i+=250),i}function h(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,M as b};
6
- //# sourceMappingURL=chunk-WTSTDJZ7.js.map
6
+ //# sourceMappingURL=chunk-NFOSOUH6.js.map
@@ -1,2 +1,2 @@
1
- import{c as d}from"./chunk-LORWXBOO.js";import{d as a}from"./chunk-WCDXJGYT.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
- //# sourceMappingURL=chunk-4QJ7LVW5.js.map
1
+ import{c as d}from"./chunk-LORWXBOO.js";import{g as a}from"./chunk-3FG3VLK3.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
+ //# sourceMappingURL=chunk-NLWXQMKR.js.map
@@ -1,4 +1,4 @@
1
- import{b as E}from"./chunk-GNXRLK5G.js";import{e as h,f as _}from"./chunk-BQ3INTYT.js";import{p as b}from"./chunk-IYFZS4PV.js";import{b as m,d as p}from"./chunk-TINPMWJK.js";function C(e,s={}){let{scope:n,limit:i}=s,l=n?`AND barrel_d.relative_path LIKE '%${n}%'`:"",o=e.all(`SELECT DISTINCT
1
+ import{c as E}from"./chunk-AEMTUHQ7.js";import{e as h,f as _}from"./chunk-6XP3KWHC.js";import{p as b}from"./chunk-SPMLGXCE.js";import{b as m,d as p}from"./chunk-5IM4IQ6N.js";function C(e,s={}){let{scope:n,limit:i}=s,l=n?`AND barrel_d.relative_path LIKE '%${n}%'`:"",o=e.all(`SELECT DISTINCT
2
2
  barrel_d.id AS barrel_doc_id,
3
3
  barrel_d.relative_path AS barrel_path,
4
4
  gs.id AS symbol_id,
@@ -67,4 +67,4 @@ import{b as E}from"./chunk-GNXRLK5G.js";import{e as h,f as _}from"./chunk-BQ3INT
67
67
  WHERE 1 = 1
68
68
  ${e.pathExclusionsFor("documents")}
69
69
  ORDER BY relative_path`),l=new Set;for(let o of i)if(!(e.isIgnored(o.relative_path)||o.relative_path===n))for(let a of h(e,o.relative_path))a.sourcePath===s&&l.add(o.relative_path);return l.size}function N(e,s){let n=b(e,s);return n.find(i=>p(i.symbol)==="method")??n[0]??null}function R(e){let s=new Set,n=[];for(let i of e){let l=`${i.barrelFile}|${i.symbol}|${i.originalFile}`;s.has(l)||(s.add(l),n.push(i))}return n}export{C as a};
70
- //# sourceMappingURL=chunk-YIPCV7M7.js.map
70
+ //# sourceMappingURL=chunk-ORD3HEWI.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-WTSTDJZ7.js";import{s as u}from"./chunk-IYFZS4PV.js";import{i as f}from"./chunk-TINPMWJK.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[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 i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
- //# sourceMappingURL=chunk-2RLP74AO.js.map
1
+ import{b as p}from"./chunk-NFOSOUH6.js";import{s as u}from"./chunk-SPMLGXCE.js";import{k as f}from"./chunk-5IM4IQ6N.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[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 i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-OU2D2T4A.js.map
@@ -1,4 +1,4 @@
1
- import{b as g}from"./chunk-TINPMWJK.js";import{execFileSync as r}from"child_process";function N(e,a={}){let{base:m="HEAD"}=a,o;try{o=b(e.config.projectRoot,m)}catch{return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"Unable to compute git diff."}}}if(o.length===0)return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"No changed files found."}};let i=[],n=[];for(let t of o){let s=e.get(`SELECT id, relative_path FROM documents
1
+ import{b as g}from"./chunk-5IM4IQ6N.js";import{execFileSync as r}from"child_process";function N(e,a={}){let{base:m="HEAD"}=a,o;try{o=b(e.config.projectRoot,m)}catch{return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"Unable to compute git diff."}}}if(o.length===0)return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"No changed files found."}};let i=[],n=[];for(let t of o){let s=e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path LIKE ?
3
3
  LIMIT 1`,`%${t}`);s&&!e.isIgnored(s.relative_path)&&(i.push(s.relative_path),n.push(s.id))}if(n.length===0)return{changedFiles:o,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:o.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}};let u=n.map(()=>"?").join(","),p=e.all(`SELECT DISTINCT gs.id AS symbol_id, gs.symbol, d.relative_path
4
4
  FROM mentions m
@@ -21,4 +21,4 @@ import{b as g}from"./chunk-TINPMWJK.js";import{execFileSync as r}from"child_proc
21
21
  AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
22
22
  ${e.pathExclusionsFor("ref_d")}`,t.symbol_id,...i);for(let c of y)e.isIgnored(c.relative_path)||(l.has(c.relative_path)||l.set(c.relative_path,new Set),l.get(c.relative_path).add(h))}let f=[...l.entries()].map(([t,s])=>({file:t,consumedSymbols:s.size})).sort((t,s)=>s.consumedSymbols-t.consumedSymbols);return{changedFiles:i,changedSymbols:d,affectedConsumers:f,summary:{totalChangedFiles:i.length,totalChangedSymbols:d.length,totalAffectedFiles:f.length}}}function b(e,a){let m=r("git",["diff","--name-only",a],{encoding:"utf-8",cwd:e,timeout:1e4}),o=r("git",["diff","--name-only","--cached",a],{encoding:"utf-8",cwd:e,timeout:1e4}),i=r("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([m,o,i].flatMap(n=>n.split(`
23
23
  `)).map(n=>n.trim()).filter(n=>n.length>0))]}export{N as a};
24
- //# sourceMappingURL=chunk-NXMYYHDO.js.map
24
+ //# sourceMappingURL=chunk-P6IUCZA3.js.map
@@ -1,4 +1,4 @@
1
- import{a as u}from"./chunk-WTSTDJZ7.js";import{p as c}from"./chunk-IYFZS4PV.js";import{b as a}from"./chunk-TINPMWJK.js";function _(t,d){let s=u(t,d);if(!s)return null;let n=t.get(`SELECT id, relative_path FROM documents
1
+ import{a as u}from"./chunk-NFOSOUH6.js";import{p as c}from"./chunk-SPMLGXCE.js";import{b as a}from"./chunk-5IM4IQ6N.js";function _(t,d){let s=u(t,d);if(!s)return null;let n=t.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${t.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,s);if(!n||t.isIgnored(n.relative_path))return null;let f=c(t,n.relative_path).sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine),m=[],l=0;for(let e of f){let o=t.get(`SELECT COUNT(DISTINCT c.document_id) AS consumer_count
@@ -7,4 +7,4 @@ import{a as u}from"./chunk-WTSTDJZ7.js";import{p as c}from"./chunk-IYFZS4PV.js";
7
7
  WHERE m.symbol_id = ?
8
8
  AND m.role != 1
9
9
  AND c.document_id != ?`,e.symbolId,n.id)?.consumer_count??0,r;o>10?r="high":o>0?r="medium":r="low",l+=o,m.push({symbol:e.symbol,shortName:a(e.symbol),startLine:e.startLine,endLine:e.endLine,externalConsumers:o,riskLevel:r})}return{file:n.relative_path,symbols:m,totalExternalConsumers:l}}export{_ as a};
10
- //# sourceMappingURL=chunk-2DSS2NGF.js.map
10
+ //# sourceMappingURL=chunk-PU7P5NPE.js.map
@@ -0,0 +1,2 @@
1
+ import{c as u}from"./chunk-F6F2QUIH.js";import{d as I,e as x,l as p}from"./chunk-3FG3VLK3.js";import{e as R}from"./chunk-6XP3KWHC.js";import{c as h}from"./chunk-7NEBSLI3.js";import{d as b,p as S,t as y}from"./chunk-SPMLGXCE.js";import{c as d}from"./chunk-5IM4IQ6N.js";function g(o,c,n){let e=p(o).get(n);if(!e||e.length===0)return[];if(e.length===1)return[l(e[0])];let i=e.filter(f=>f.file===c);if(i.length>0)return i.map(l);let t=P(o,c),r=t.get(n);if(r)for(let f of r){let s=e.filter(m=>D(f,m.file));if(s.length>0)return s.map(l)}let a=new Set;for(let f of t.values())for(let s of f)a.add(s);for(let f of a){let s=e.filter(m=>D(f,m.file));if(s.length>0&&s.length===e.length)return s.map(l)}return[]}function j(o,c,n){let e=g(o,c,n);if(e.length>0)return e;let i=p(o).get(n);return!i||i.length===0?[]:i.map(l)}function C(o,c){let n=h(o,c);if(!n)return[];let e=d(n.symbol);if(!e)return[];let i=new Map;for(let t of u(o)){let r=b(o,t);if(!r||r.indexOf(e)===-1||t!==n.relativePath&&!g(o,t,e).some(s=>s.symbolId===n.symbolId))continue;let a=I(o,t,e,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});a.length>0&&i.set(t,a)}return w(o,i)}function E(o,c){let n=new Map;for(let t of c){if(!t.leaf)continue;let r=n.get(t.leaf)??[];r.push(t),n.set(t.leaf,r)}if(n.size===0)return new Map;let e=new Set(c.map(t=>t.symbolId)),i=new Map;for(let t of u(o)){let r=x(o,t);if(r.size!==0){for(let a of r)if(n.has(a))for(let f of g(o,t,a)){if(!e.has(f.symbolId)||t===f.relativePath)continue;let s=i.get(f.symbolId);s||(s=new Set,i.set(f.symbolId,s)),s.add(t)}}}return i}function P(o,c){let n=new Map;for(let e of R(o,c)){if(!e.sourcePath)continue;let i=e.localName??e.importedName;if(i){let t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(e.sourcePath)}if(e.kind==="namespace")for(let t of e.usedMembers){let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(e.sourcePath)}}return n}function D(o,c){let n=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return n(o)===n(c)}function l(o){return{symbolId:o.symbolId,symbol:o.symbol,relativePath:o.file}}function w(o,c){let n=[],e=new Set;for(let[i,t]of c){let r=S(o,i);for(let a of t){let f=y(r,a),s=`${i}|${a}|${f?.symbol??""}`;e.has(s)||(e.add(s),n.push({file:i,line:a,enclosingSymbol:f?.symbol??null}))}}return n}export{g as a,j as b,C as c,E as d};
2
+ //# sourceMappingURL=chunk-QSTMORTI.js.map
@@ -1,6 +1,6 @@
1
- import{a as f}from"./chunk-WTSTDJZ7.js";import{a as p}from"./chunk-LX4H4LLG.js";import{b as g}from"./chunk-TINPMWJK.js";import{readFileSync as v}from"fs";import{join as d}from"path";function _(e,u,l={}){let{context:a=0}=l,r=u.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(r)return y(e,r[1],parseInt(r[2],10),parseInt(r[3],10),a);let t=p(e,u);if(!t)return null;let n=e.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath),m=d(e.config.projectRoot,t.relativePath),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
1
+ import{a as f}from"./chunk-NFOSOUH6.js";import{a as p}from"./chunk-7NEBSLI3.js";import{b as g}from"./chunk-5IM4IQ6N.js";import{readFileSync as v}from"fs";import{join as d}from"path";function _(e,u,l={}){let{context:a=0}=l,r=u.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(r)return y(e,r[1],parseInt(r[2],10),parseInt(r[3],10),a);let t=p(e,u);if(!t)return null;let n=e.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath),m=d(e.config.projectRoot,t.relativePath),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
2
2
  `),s=Math.max(0,t.startLine-a),c=Math.min(i.length-1,t.endLine+a),h=i.slice(s,c+1).join(`
3
3
  `);return{symbol:t.symbol,shortName:g(t.symbol),relativePath:t.relativePath,startLine:s,endLine:c,language:n?.language??null,source:h}}function y(e,u,l,a,r){let t=f(e,u);if(!t)return null;let n=e.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",t);if(!n)return null;let m=d(e.config.projectRoot,n.relative_path),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
4
4
  `),s=Math.max(0,l-1-r),c=Math.min(i.length-1,a-1+r),h=i.slice(s,c+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${l}-${a}`,shortName:`${n.relative_path}:${l}-${a}`,relativePath:n.relative_path,startLine:s,endLine:c,language:n.language,source:h}}export{_ as a};
6
- //# sourceMappingURL=chunk-QXE6EDY2.js.map
6
+ //# sourceMappingURL=chunk-RC2PKZSS.js.map
@@ -0,0 +1,2 @@
1
+ import{a as C}from"./chunk-AEMTUHQ7.js";import{k as b,m as f}from"./chunk-3FG3VLK3.js";import{r as u}from"./chunk-SPMLGXCE.js";import{b as n,e as c,i as y}from"./chunk-5IM4IQ6N.js";function R(o,r){let{scope:s,minLoc:t=10,limit:M=30}=r??{},{definitions:d,callerMap:S,calleeMap:L}=g(o,s);return d.map(e=>{let a=e.endLine-e.startLine+1,i=S.get(e.symbolId)?.size??0,p=L.get(e.symbolId)??[],h=p.filter(l=>l.file!==e.relativePath),m=new Set(h.map(l=>`${l.symbol}|${l.file}`)).size,x=new Set(p.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:n(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:a,fanIn:i,fanOut:m,calleeCount:x,score:Math.round(a/50*(i/5)*Math.max(m/5,1)*100)/100}}).filter(e=>e.loc>=t).sort((e,a)=>a.score-e.score||a.loc-e.loc).slice(0,M)}function g(o,r){let s=u(o,r).filter(t=>c(t.symbol)&&!o.isIgnored(t.relativePath)).filter(t=>C(t.relativePath)!=="test").filter(t=>!y(t.symbol));return{definitions:s,callerMap:f(o,s),calleeMap:b(o,s)}}export{R as a};
2
+ //# sourceMappingURL=chunk-S65VVU3R.js.map
@@ -1,5 +1,5 @@
1
- import{a as D,b as v,c as k,d as A,f as M}from"./chunk-TINPMWJK.js";function b(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i){let o=e(t);if(o.has(r))return o.get(r);let l=i();return o.set(r,l),l},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}function he(a){let n=new WeakMap;return{get(e,t){let r=n.get(e);if(r)return r.value;let i=t();return n.set(e,{value:i}),i},invalidate(e){n.delete(e)},has(e){return n.has(e)}}}function I(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i,o){let l=e(t),s=l.get(r);if(s&&s.source===i)return s.value;let u=o();return l.set(r,{source:i,value:u}),u},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)}}}import{existsSync as H,readFileSync as Y}from"fs";import{join as K}from"path";var U=b("source-text");function m(a,n){let e=n.replace(/\\/g,"/");return U.get(a,e,()=>{let t=K(a.config.projectRoot,e);return H(t)?Y(t,"utf-8"):""})}var z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift)?/i;function Ce(a,n,e){if(e<=0)return!1;let t=m(a,n);if(!t)return!1;let r=t.split(`
2
- `);for(let i=e-1;i>=0&&i>=e-5;i-=1){let o=(r[i]??"").trim();if(o!==""){if(z.test(o))return!0;if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return!1}}return!1}import{extname as R}from"path";import{createRequire as G}from"module";var p=G(import.meta.url),y=null,N=!1;function P(){if(N)return null;if(y)return y;try{return y=p("tree-sitter"),y}catch{return N=!0,null}}var q={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},w=new Map,x=new Set;function O(a){if(x.has(a))return null;let n=w.get(a);if(n)return n;let e;try{switch(a){case"rust":e=p("tree-sitter-rust");break;case"typescript":e=p("tree-sitter-typescript").typescript;break;case"tsx":e=p("tree-sitter-typescript").tsx;break;case"javascript":e=p("tree-sitter-javascript");break;case"python":e=p("tree-sitter-python");break;case"java":e=p("tree-sitter-java");break;case"kotlin":e=p("tree-sitter-kotlin");break;case"scala":e=p("tree-sitter-scala");break;case"ruby":e=p("tree-sitter-ruby");break;case"c":e=p("tree-sitter-c");break;case"cpp":e=p("tree-sitter-cpp");break;case"csharp":e=p("tree-sitter-c-sharp");break;case"php":e=p("tree-sitter-php").php;break;case"vb":{let t=p("tree-sitter-vb-dotnet");e=t.language??t;break}}}catch{return x.add(a),null}return w.set(a,e),e}var T=new Map;function V(a){let n=T.get(a);if(n)return n;let e=O(a);if(!e)return null;let t=P();if(!t)return null;let r=new t;try{r.setLanguage(e)}catch{return x.add(a),null}return T.set(a,r),r}function h(a){return q[R(a).toLowerCase()]??null}function J(a){return R(a).toLowerCase()===".vue"}var j=I("ast-trees");function L(a,n){if(J(n))return Z(a,n);let e=h(n);if(!e)return null;let t=m(a,n);return t?j.get(a,n,t,()=>{let r=V(e);return r?r.parse(t):null}):null}function Z(a,n){let e=m(a,n);return e?j.get(a,n,e,()=>{let t=X(e);if(!t)return null;let r=V(t.language);if(!r)return null;let i=`
1
+ import{a as x,b as v,c as k,d as A,f as M}from"./chunk-5IM4IQ6N.js";function b(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i){let o=e(t);if(o.has(r))return o.get(r);let l=i();return o.set(r,l),l},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}function he(a){let n=new WeakMap;return{get(e,t){let r=n.get(e);if(r)return r.value;let i=t();return n.set(e,{value:i}),i},invalidate(e){n.delete(e)},has(e){return n.has(e)}}}function N(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i,o){let l=e(t),s=l.get(r);if(s&&s.source===i)return s.value;let u=o();return l.set(r,{source:i,value:u}),u},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)}}}import{existsSync as H,readFileSync as Y}from"fs";import{join as K}from"path";var U=b("source-text");function m(a,n){let e=n.replace(/\\/g,"/");return U.get(a,e,()=>{let t=K(a.config.projectRoot,e);return H(t)?Y(t,"utf-8"):""})}var z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift)?/i;function Ce(a,n,e){if(e<=0)return!1;let t=m(a,n);if(!t)return!1;let r=t.split(`
2
+ `);for(let i=e-1;i>=0&&i>=e-5;i-=1){let o=(r[i]??"").trim();if(o!==""){if(z.test(o))return!0;if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return!1}}return!1}import{extname as R}from"path";import{createRequire as G}from"module";var p=G(import.meta.url),y=null,I=!1;function P(){if(I)return null;if(y)return y;try{return y=p("tree-sitter"),y}catch{return I=!0,null}}var q={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},w=new Map,S=new Set;function O(a){if(S.has(a))return null;let n=w.get(a);if(n)return n;let e;try{switch(a){case"rust":e=p("tree-sitter-rust");break;case"typescript":e=p("tree-sitter-typescript").typescript;break;case"tsx":e=p("tree-sitter-typescript").tsx;break;case"javascript":e=p("tree-sitter-javascript");break;case"python":e=p("tree-sitter-python");break;case"java":e=p("tree-sitter-java");break;case"kotlin":e=p("tree-sitter-kotlin");break;case"scala":e=p("tree-sitter-scala");break;case"ruby":e=p("tree-sitter-ruby");break;case"c":e=p("tree-sitter-c");break;case"cpp":e=p("tree-sitter-cpp");break;case"csharp":e=p("tree-sitter-c-sharp");break;case"php":e=p("tree-sitter-php").php;break;case"vb":{let t=p("tree-sitter-vb-dotnet");e=t.language??t;break}}}catch{return S.add(a),null}return w.set(a,e),e}var T=new Map;function V(a){let n=T.get(a);if(n)return n;let e=O(a);if(!e)return null;let t=P();if(!t)return null;let r=new t;try{r.setLanguage(e)}catch{return S.add(a),null}return T.set(a,r),r}function h(a){return q[R(a).toLowerCase()]??null}function J(a){return R(a).toLowerCase()===".vue"}var j=N("ast-trees");function C(a,n){if(J(n))return Z(a,n);let e=h(n);if(!e)return null;let t=m(a,n);return t?j.get(a,n,t,()=>{let r=V(e);return r?r.parse(t):null}):null}function Z(a,n){let e=m(a,n);return e?j.get(a,n,e,()=>{let t=X(e);if(!t)return null;let r=V(t.language);if(!r)return null;let i=`
3
3
  `.repeat(t.startLine)+t.body;return r.parse(i)}):null}function X(a){let n=[],e=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let s of a.matchAll(e))typeof s.index=="number"&&n.push({tagOpen:s[1]??"",body:s[2]??"",openIdx:s.index+(s[0].length-(s[2]?.length??0)-9)});if(n.length===0)return null;let t=n.find(s=>/\bsetup\b/.test(s.tagOpen))??n[0],i=t.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),o=i==="ts"||i==="typescript"?"typescript":i==="tsx"?"tsx":"javascript",l=ee(a,t.openIdx);return{body:t.body,startLine:l,language:o}}function ee(a,n){let e=0;for(let t=0;t<n&&t<a.length;t++)a.charCodeAt(t)===10&&e++;return e}var g=new Map;function te(a,n){let e=`${a}::${n}`;if(g.has(e))return g.get(e)??null;let t=O(a);if(!t)return g.set(e,null),null;let r=P();if(!r)return g.set(e,null),null;let i=null;try{i=new r.Query(t,n)}catch{i=null}return g.set(e,i),i}var ne={rust:`
4
4
  (function_item name: (identifier) @name) @def
5
5
  (function_signature_item name: (identifier) @name) @def
@@ -40,7 +40,7 @@ import{a as D,b as v,c as k,d as A,f as M}from"./chunk-TINPMWJK.js";function b(a
40
40
  (new_expression constructor: (_) @target) @call
41
41
  `,python:`
42
42
  (call function: (_) @target) @call
43
- `},ie=new WeakMap;function Ie(a,n){return Q(a,n,ie,ae,e=>{let t=[];for(let r of e){let i=null,o=null;for(let s of r.captures)s.name==="target"?i=s.node:s.name==="call"&&(o=s.node);if(!i||!o)continue;let l=S(i);l&&t.push({calleeLeaf:l,line:o.startPosition.row})}return t})}function Ne(a,n){return se(a,n,oe,()=>new Map,(e,t,r)=>{let i=(s,u)=>{if(s===u)return;let c=r.get(s);c||(c=new Set,r.set(s,c)),c.add(u)},o=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),l=(s,u)=>{let c=d=>{o.has(d.type)&&d.text!==u&&i(d.text,u);for(let f of d.children)c(f)};for(let d of s.children)c(d)};if(t==="rust")for(let s of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let u=s.namedChildren.find(d=>d.type==="type_identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="field_declaration_list"||d.type==="enum_variant_list"||d.type==="ordered_field_declaration_list");c&&l(c,u),s.type==="type_item"&&l(s,u)}else if(t==="python")for(let s of e.rootNode.descendantsOfType("class_definition")){let u=s.namedChildren.find(d=>d.type==="identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="block");if(c)for(let d of c.descendantsOfType("type"))for(let f of d.descendantsOfType("identifier"))f.text!==u&&i(f.text,u)}else for(let s of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let u=s.namedChildren.find(c=>c.type==="type_identifier")?.text;u&&l(s,u)}})??new Map}function se(a,n,e,t,r){let i=h(n);if(!i)return null;let o=L(a,n);if(!o)return null;let l=e.get(o);if(l)return l;let s=t();return r(o,i,s),e.set(o,s),s}function Q(a,n,e,t,r){let i=h(n);if(!i)return null;let o=t[i];if(!o)return null;let l=L(a,n);if(!l)return null;let s=e.get(l);if(s)return s;let u=te(i,o);if(!u)return null;let c=r(u.matches(l.rootNode));return e.set(l,c),c}var oe=new WeakMap,E=new WeakMap;function we(a,n,e,t){let r=h(n);if(!r)return null;let i=L(a,n);if(!i)return null;let o=E.get(i);return o||(o=le(i,r),E.set(i,o)),o.get(`${e}:${t}`)??null}function le(a,n){let e=n==="rust"?new Set(["function_item","function_signature_item"]):n==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,r=i=>{if(e.has(i.type)){let o=i.namedChildren.find(s=>s.type==="parameters"||s.type==="formal_parameters"),l=0;if(o)for(let s of o.namedChildren)s.type==="comment"||s.type==="line_comment"||s.type==="block_comment"||(l+=1);t.set(`${i.startPosition.row}:${i.endPosition.row}`,{paramCount:l})}for(let o of i.children)r(o)};return r(a.rootNode),t}function S(a){switch(a.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return a.text;case"field_expression":case"member_expression":case"attribute":{let n=a.namedChild(a.namedChildCount-1);return n?S(n):null}case"scoped_identifier":{let n=a.childForFieldName("name")??a.namedChild(a.namedChildCount-1);return n?S(n):null}case"super":case"self":case"this":return null;default:return null}}function $(a){return!a||!a.trim()?null:a.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 W(a){if(!a)return null;let n=a.indexOf("|");return n===-1?a.replace(/\n/g," "):a.slice(n+1).replace(/\n/g," ")}var ce=b("file-definitions");function C(a,n){return ce.get(a,n,()=>{let e=a.all(`SELECT
43
+ `},ie=new WeakMap;function Ne(a,n){return Q(a,n,ie,ae,e=>{let t=[];for(let r of e){let i=null,o=null;for(let s of r.captures)s.name==="target"?i=s.node:s.name==="call"&&(o=s.node);if(!i||!o)continue;let l=L(i);l&&t.push({calleeLeaf:l,line:o.startPosition.row})}return t})}function Ie(a,n){return se(a,n,oe,()=>new Map,(e,t,r)=>{let i=(s,u)=>{if(s===u)return;let c=r.get(s);c||(c=new Set,r.set(s,c)),c.add(u)},o=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),l=(s,u)=>{let c=d=>{o.has(d.type)&&d.text!==u&&i(d.text,u);for(let f of d.children)c(f)};for(let d of s.children)c(d)};if(t==="rust")for(let s of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let u=s.namedChildren.find(d=>d.type==="type_identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="field_declaration_list"||d.type==="enum_variant_list"||d.type==="ordered_field_declaration_list");c&&l(c,u),s.type==="type_item"&&l(s,u)}else if(t==="python")for(let s of e.rootNode.descendantsOfType("class_definition")){let u=s.namedChildren.find(d=>d.type==="identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="block");if(c)for(let d of c.descendantsOfType("type"))for(let f of d.descendantsOfType("identifier"))f.text!==u&&i(f.text,u)}else for(let s of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let u=s.namedChildren.find(c=>c.type==="type_identifier")?.text;u&&l(s,u)}})??new Map}function se(a,n,e,t,r){let i=h(n);if(!i)return null;let o=C(a,n);if(!o)return null;let l=e.get(o);if(l)return l;let s=t();return r(o,i,s),e.set(o,s),s}function Q(a,n,e,t,r){let i=h(n);if(!i)return null;let o=t[i];if(!o)return null;let l=C(a,n);if(!l)return null;let s=e.get(l);if(s)return s;let u=te(i,o);if(!u)return null;let c=r(u.matches(l.rootNode));return e.set(l,c),c}var oe=new WeakMap,E=new WeakMap;function we(a,n,e,t){let r=h(n);if(!r)return null;let i=C(a,n);if(!i)return null;let o=E.get(i);return o||(o=le(i,r),E.set(i,o)),o.get(`${e}:${t}`)??null}function le(a,n){let e=n==="rust"?new Set(["function_item","function_signature_item"]):n==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,r=i=>{if(e.has(i.type)){let o=i.namedChildren.find(s=>s.type==="parameters"||s.type==="formal_parameters"),l=0;if(o)for(let s of o.namedChildren)s.type==="comment"||s.type==="line_comment"||s.type==="block_comment"||(l+=1);t.set(`${i.startPosition.row}:${i.endPosition.row}`,{paramCount:l})}for(let o of i.children)r(o)};return r(a.rootNode),t}function L(a){switch(a.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return a.text;case"field_expression":case"member_expression":case"attribute":{let n=a.namedChild(a.namedChildCount-1);return n?L(n):null}case"scoped_identifier":{let n=a.childForFieldName("name")??a.namedChild(a.namedChildCount-1);return n?L(n):null}case"super":case"self":case"this":return null;default:return null}}function $(a){return!a||!a.trim()?null:a.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 W(a){if(!a)return null;let n=a.indexOf("|");return n===-1?a.replace(/\n/g," "):a.slice(n+1).replace(/\n/g," ")}var ce=b("file-definitions");function D(a,n){return ce.get(a,n,()=>{let e=a.all(`SELECT
44
44
  gs.id,
45
45
  gs.symbol,
46
46
  der.document_id,
@@ -80,5 +80,5 @@ import{a as D,b as v,c as k,d as A,f as M}from"./chunk-TINPMWJK.js";function b(a
80
80
  WHERE 1 = 1
81
81
  ${a.pathExclusionsFor("documents")}
82
82
  ${e}
83
- ORDER BY relative_path`).flatMap(t=>C(a,t.relative_path)).filter(t=>!a.isIgnored(t.relativePath))}function Qe(a,n,e={}){if(n.length===0)return[];let t=n.flatMap(r=>C(a,r)).filter(r=>!a.isIgnored(r.relativePath));return e.onlyDocumented&&(t=t.filter(r=>r.documentation!==null&&r.documentation!=="")),e.sort&&(t=t.sort((r,i)=>r.relativePath.localeCompare(i.relativePath)||r.startLine-i.startLine||r.endLine-i.endLine)),t.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:$(W(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function $e(a,n){let e=null;for(let t of a)t.startLine>n||t.endLine<n||(!e||t.endLine-t.startLine<e.endLine-e.startLine)&&(e=t);return e}function We(a,n){let e=C(a,n.relative_path).find(t=>t.symbolId===n.id);return e?{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function de(a,n,e){let t=F(a,n);if(t)return pe(e,t);let r=m(a,n);if(!r)return e;let i=r.split(/\r?\n/),o=e.some(c=>_(c.symbol))?me(i):null,l=new Map;for(let c of e)l.set(c.symbolId,fe(i,o,c));let s=new Map,u=e.filter(c=>_(c.symbol)).map(c=>({definition:c,startLine:l.get(c.symbolId)??c.startLine})).sort((c,d)=>c.startLine-d.startLine||c.definition.startLine-d.definition.startLine||c.definition.symbol.localeCompare(d.definition.symbol));for(let c=0;c<u.length;c+=1){let d=u[c],f=u[c+1],B=f?Math.max(d.startLine,f.startLine-1):i.length-1;s.set(d.definition.symbolId,{startLine:d.startLine,endLine:ge(i,d.definition,d.startLine,B)})}return e.map(c=>{let d=s.get(c.symbolId);return d?{...c,startLine:d.startLine,endLine:d.endLine}:c})}function pe(a,n){let e=new Map;for(let t of n){let r=e.get(t.name);r?r.push(t):e.set(t.name,[t])}return a.map(t=>{if(!_(t.symbol)||!t.leaf)return t;let r=e.get(t.leaf);if(!r||r.length===0)return t;let i=r[0],o=Math.abs(i.startLine-t.startLine);for(let l=1;l<r.length;l+=1){let s=r[l],u=Math.abs(s.startLine-t.startLine);u<o&&(i=s,o=u)}return{...t,startLine:i.startLine,endLine:i.endLine}})}function fe(a,n,e){if(!_(e.symbol))return e.startLine;let t=Math.max(0,Math.min(e.startLine,a.length-1));if(!n)return t;let r=n.get(e.leaf);if(!r||r.length===0)return t;let i=null;for(let o of r){let l=Math.abs(o-e.startLine);(!i||l<i.distance)&&(i={line:o,distance:l})}return i?.line??t}function me(a){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,e=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,t=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,i=new Map,o=(l,s)=>{let u=i.get(l);if(!u){i.set(l,[s]);return}u[u.length-1]!==s&&u.push(s)};for(let l=0;l<a.length;l+=1){let s=a[l]??"";for(let c of s.matchAll(n))c[1]&&o(c[1],l);for(let c of s.matchAll(e))c[1]&&o(c[1],l);let u=s.match(t);u?.[1]&&o(u[1],l);for(let c of s.matchAll(r))c[1]&&o(c[1],l)}return i}function ge(a,n,e,t){let r=Math.max(e,Math.min(a.length-1,t)),i=Math.max(e,Math.min(r,n.endLine)),o=0,l=0,s=!1;for(let u=e;u<=r;u+=1){let c=be(a[u]??"");for(let d of c)d==="{"?(o+=1,s=!0):d==="}"?o=Math.max(0,o-1):d==="("?l+=1:d===")"&&(l=Math.max(0,l-1));if(s&&o===0||!s&&l===0&&u>=i)return u}return i}function be(a){let n="",e=null,t=!1;for(let r=0;r<a.length;r+=1){let i=a[r],o=a[r+1];if(!e&&i==="/"&&o==="/"){n+=" ".repeat(a.length-r);break}if(e){if(t){t=!1,n+=" ";continue}if(i==="\\"){t=!0,n+=" ";continue}i===e&&(e=null),n+=" ";continue}if(i==='"'||i==="'"||i==="`"){e=i,n+=" ";continue}n+=i}return n}function _(a){return a.includes("().")}function ye(a){let n=D(a);if("kind"in n)return null;for(let e=n.descriptors.length-2;e>=0;e--){let t=n.descriptors[e];if(t?.suffix==="type")return t.name}return null}export{b as a,he as b,I as c,m as d,Ce as e,h as f,J as g,L as h,Ie as i,Ne as j,se as k,we as l,S as m,$ as n,W as o,C as p,Fe as q,ue as r,Qe as s,$e as t,We as u};
84
- //# sourceMappingURL=chunk-IYFZS4PV.js.map
83
+ ORDER BY relative_path`).flatMap(t=>D(a,t.relative_path)).filter(t=>!a.isIgnored(t.relativePath))}function Qe(a,n,e={}){if(n.length===0)return[];let t=n.flatMap(r=>D(a,r)).filter(r=>!a.isIgnored(r.relativePath));return e.onlyDocumented&&(t=t.filter(r=>r.documentation!==null&&r.documentation!=="")),e.sort&&(t=t.sort((r,i)=>r.relativePath.localeCompare(i.relativePath)||r.startLine-i.startLine||r.endLine-i.endLine)),t.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:$(W(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function $e(a,n){let e=null;for(let t of a)t.startLine>n||t.endLine<n||(!e||t.endLine-t.startLine<e.endLine-e.startLine)&&(e=t);return e}function We(a,n){let e=D(a,n.relative_path).find(t=>t.symbolId===n.id);return e?{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function de(a,n,e){let t=F(a,n);if(t)return pe(e,t);let r=m(a,n);if(!r)return e;let i=r.split(/\r?\n/),o=e.some(c=>_(c.symbol))?me(i):null,l=new Map;for(let c of e)l.set(c.symbolId,fe(i,o,c));let s=new Map,u=e.filter(c=>_(c.symbol)).map(c=>({definition:c,startLine:l.get(c.symbolId)??c.startLine})).sort((c,d)=>c.startLine-d.startLine||c.definition.startLine-d.definition.startLine||c.definition.symbol.localeCompare(d.definition.symbol));for(let c=0;c<u.length;c+=1){let d=u[c],f=u[c+1],B=f?Math.max(d.startLine,f.startLine-1):i.length-1;s.set(d.definition.symbolId,{startLine:d.startLine,endLine:ge(i,d.definition,d.startLine,B)})}return e.map(c=>{let d=s.get(c.symbolId);return d?{...c,startLine:d.startLine,endLine:d.endLine}:c})}function pe(a,n){let e=new Map;for(let t of n){let r=e.get(t.name);r?r.push(t):e.set(t.name,[t])}return a.map(t=>{if(!_(t.symbol)||!t.leaf)return t;let r=e.get(t.leaf);if(!r||r.length===0)return t;let i=r[0],o=Math.abs(i.startLine-t.startLine);for(let l=1;l<r.length;l+=1){let s=r[l],u=Math.abs(s.startLine-t.startLine);u<o&&(i=s,o=u)}return{...t,startLine:i.startLine,endLine:i.endLine}})}function fe(a,n,e){if(!_(e.symbol))return e.startLine;let t=Math.max(0,Math.min(e.startLine,a.length-1));if(!n)return t;let r=n.get(e.leaf);if(!r||r.length===0)return t;let i=null;for(let o of r){let l=Math.abs(o-e.startLine);(!i||l<i.distance)&&(i={line:o,distance:l})}return i?.line??t}function me(a){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,e=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,t=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,i=new Map,o=(l,s)=>{let u=i.get(l);if(!u){i.set(l,[s]);return}u[u.length-1]!==s&&u.push(s)};for(let l=0;l<a.length;l+=1){let s=a[l]??"";for(let c of s.matchAll(n))c[1]&&o(c[1],l);for(let c of s.matchAll(e))c[1]&&o(c[1],l);let u=s.match(t);u?.[1]&&o(u[1],l);for(let c of s.matchAll(r))c[1]&&o(c[1],l)}return i}function ge(a,n,e,t){let r=Math.max(e,Math.min(a.length-1,t)),i=Math.max(e,Math.min(r,n.endLine)),o=0,l=0,s=!1;for(let u=e;u<=r;u+=1){let c=be(a[u]??"");for(let d of c)d==="{"?(o+=1,s=!0):d==="}"?o=Math.max(0,o-1):d==="("?l+=1:d===")"&&(l=Math.max(0,l-1));if(s&&o===0||!s&&l===0&&u>=i)return u}return i}function be(a){let n="",e=null,t=!1;for(let r=0;r<a.length;r+=1){let i=a[r],o=a[r+1];if(!e&&i==="/"&&o==="/"){n+=" ".repeat(a.length-r);break}if(e){if(t){t=!1,n+=" ";continue}if(i==="\\"){t=!0,n+=" ";continue}i===e&&(e=null),n+=" ";continue}if(i==='"'||i==="'"||i==="`"){e=i,n+=" ";continue}n+=i}return n}function _(a){return a.includes("().")}function ye(a){let n=x(a);if("kind"in n)return null;for(let e=n.descriptors.length-2;e>=0;e--){let t=n.descriptors[e];if(t?.suffix==="type")return t.name}return null}function Be(a){let n=x(a);if("kind"in n)return[];let e=[];for(let t=n.descriptors.length-2;t>=0;t-=1){let r=n.descriptors[t];r?.suffix==="type"&&r.name&&e.push(r.name)}return e}export{b as a,he as b,N as c,m as d,Ce as e,h as f,J as g,C as h,Ne as i,Ie as j,se as k,we as l,L as m,$ as n,W as o,D as p,Fe as q,ue as r,Qe as s,$e as t,We as u,Be as v};
84
+ //# sourceMappingURL=chunk-SPMLGXCE.js.map
@@ -1,4 +1,4 @@
1
- import{a as l}from"./chunk-WTSTDJZ7.js";import{d as r}from"./chunk-WCDXJGYT.js";import{a as c}from"./chunk-LX4H4LLG.js";import{b as d}from"./chunk-TINPMWJK.js";function f(e,t){let o=c(e,t);if(!o)return[];let i=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
1
+ import{a as l}from"./chunk-NFOSOUH6.js";import{g as r}from"./chunk-3FG3VLK3.js";import{a as c}from"./chunk-7NEBSLI3.js";import{b as d}from"./chunk-5IM4IQ6N.js";function f(e,t){let o=c(e,t);if(!o)return[];let i=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  WHERE m.symbol_id = ?
@@ -59,4 +59,4 @@ import{a as l}from"./chunk-WTSTDJZ7.js";import{d as r}from"./chunk-WCDXJGYT.js";
59
59
  GROUP BY d.id
60
60
  ORDER BY symbol_count DESC
61
61
  LIMIT ?`,o).filter(s=>!e.isIgnored(s.relative_path)).map(s=>({name:s.relative_path,count:s.symbol_count}))}export{f as a,y as b,b as c,I as d};
62
- //# sourceMappingURL=chunk-GXVB36TG.js.map
62
+ //# sourceMappingURL=chunk-T26XHATT.js.map
@@ -0,0 +1,2 @@
1
+ import{k as x}from"./chunk-3FG3VLK3.js";import{e as C,f as S,h as L,r as _}from"./chunk-SPMLGXCE.js";import{b as y,f as d,h as g,i as b}from"./chunk-5IM4IQ6N.js";function P(i,r,a,t){let s=S(r);if(!s)return!0;let n=L(i,r);if(!n)return!0;let l=w.get(n);return l||(l=T(n,s),w.set(n,l)),l.get(`${a}:${t}`)??!0}var w=new WeakMap;function T(i,r){let a=r==="rust"?new Set(["function_item","function_signature_item"]):r==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,s=n=>{a.has(n.type)&&t.set(`${n.startPosition.row}:${n.endPosition.row}`,N(n,r));for(let l of n.children)s(l)};return s(i.rootNode),t}function N(i,r){let a=i.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!a)return!1;let t=a.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(t.length!==1)return!1;let s=t[0],n=null;if(s.type==="return_statement"||s.type==="expression_statement"?n=s.namedChild(0)??null:r==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(n=s),!n)return!1;let l=r==="python"?"call":"call_expression";if(n.type!==l)return!1;let c=n.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!c)return!1;let o=c.namedChildren.filter(e=>e.type!=="comment"),f=i.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!f)return!1;let p=[];for(let e of f.namedChildren)if(e.type==="identifier")p.push(e.text);else{let m=e.namedChildren.find(u=>u.type==="identifier");m&&p.push(m.text)}if(o.length!==p.length)return!1;for(let e=0;e<p.length;e+=1){let m=o[e];if(m.type!=="identifier"||m.text!==p[e])return!1}return!0}function j(i,r){let{scope:a,maxLoc:t=15,limit:s=30}=r??{},n=D(i,a,t),l=x(i,n),c=[];for(let o of n){if(C(i,o.relativePath,o.startLine))continue;let f=l.get(o.symbolId)??[],p=f.some(u=>d(u.symbol))?f.filter(u=>d(u.symbol)):f,e=new Map;for(let u of p)e.has(u.symbol)||e.set(u.symbol,u);if(e.size!==1||!P(i,o.relativePath,o.startLine,o.endLine))continue;let[,m]=[...e.entries()][0];c.push({symbol:o.symbol,shortName:y(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:h(o),forwardsTo:m.symbol,forwardsToShort:y(m.symbol),forwardsToFile:m.file})}return c.sort((o,f)=>o.loc-f.loc||o.file.localeCompare(f.file)),c.slice(0,s)}function D(i,r,a){return _(i,r).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>d(t.symbol)).filter(t=>!g(t.symbol)).filter(t=>!b(t.symbol)).filter(t=>h(t)>=3&&h(t)<=a)}function h(i){return i.endLine-i.startLine+1}export{j as a};
2
+ //# sourceMappingURL=chunk-TWYHFB5K.js.map
@@ -1,2 +1,2 @@
1
- import{d,q as b}from"./chunk-IYFZS4PV.js";import{b as g}from"./chunk-TINPMWJK.js";function I(n,e={}){let{scope:i,minLoc:u=1,limit:l}=e,p=new Map;for(let t of b(n,{scope:i})){if(!t.isFunctionLike||n.isIgnored(t.relativePath))continue;let s=t.endLine-t.startLine+1;if(s<u)continue;let f=x(n,t);if(!f)continue;let a={symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s},r=p.get(f);r?r.push(a):p.set(f,[a])}let c=[];for(let[t,s]of p)s.length<2||c.push({signature:t,functions:s});return c.sort((t,s)=>{let f=s.functions.length-t.functions.length;if(f!==0)return f;let a=t.functions.reduce((o,m)=>o+m.loc,0);return s.functions.reduce((o,m)=>o+m.loc,0)-a}),l?c.slice(0,l):c}function x(n,e){let i=S(e.documentation),u=i?L(i):null;return u||D($(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function S(n){if(!n||!n.includes("|"))return null;let e=n.slice(n.indexOf("|")+1).replace(/\n/g," ").trim();return e.length>0?e:null}function $(n,e,i,u,l){let p=d(n,e);if(!p)return null;let c=p.split(/\r?\n/),t=v(c,i,u,l);for(let s of t){let f=Math.min(c.length-1,Math.max(s,s+4)),a="";for(let r=s;r<=f;r+=1){let o=c[r]?.trim();if(o&&(a=a?`${a} ${o}`:o,y(a)))return a}if(a&&a.includes("("))return a}return null}function y(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||w(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function L(n){if(!n||!n.trim())return null;let e=n.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(),i=e.indexOf("(");return i===-1||(e=e.slice(i),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function D(n,e){if(!n||!n.trim())return null;let i=n.replace(/\s+/g," ").trim(),u=i.indexOf("(");if(u===-1)return null;let l=i.slice(0,u),c=new RegExp(`\\b${h(e)}\\b`,"i").exec(l);c&&typeof c.index=="number"&&(l=l.slice(0,c.index)),l=l.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let t=i.slice(u).replace(/\s*\{[\s\S]*$/,"").replace(/\s*=>[\s\S]*$/,"").replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!t.startsWith("("))return null;let s=`${l?`${l} `:""}${t}`.replace(/\s+/g,"").toLowerCase();return s.length>=3?s:null}function v(n,e,i,u){let l=h(u),p=new RegExp(`\\b${l}\\b\\s*\\(`,"i"),c=new RegExp(`\\bdef\\s+${l}\\b`,"i"),t=[],s=new Set,f=Math.max(0,Math.min(e,n.length-1)),a=Math.max(f,Math.min(n.length-1,Math.max(i,e+4)));for(let r=f;r<=a;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}for(let r=0;r<n.length;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}return t}function w(n){let e=0;for(let i of n)i==="("&&(e+=1),i===")"&&(e-=1);return e}function h(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{I as a};
2
- //# sourceMappingURL=chunk-XAZTIDST.js.map
1
+ import{d,q as b}from"./chunk-SPMLGXCE.js";import{b as g}from"./chunk-5IM4IQ6N.js";function I(n,e={}){let{scope:i,minLoc:u=1,limit:l}=e,p=new Map;for(let t of b(n,{scope:i})){if(!t.isFunctionLike||n.isIgnored(t.relativePath))continue;let s=t.endLine-t.startLine+1;if(s<u)continue;let f=x(n,t);if(!f)continue;let a={symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s},r=p.get(f);r?r.push(a):p.set(f,[a])}let c=[];for(let[t,s]of p)s.length<2||c.push({signature:t,functions:s});return c.sort((t,s)=>{let f=s.functions.length-t.functions.length;if(f!==0)return f;let a=t.functions.reduce((o,m)=>o+m.loc,0);return s.functions.reduce((o,m)=>o+m.loc,0)-a}),l?c.slice(0,l):c}function x(n,e){let i=S(e.documentation),u=i?L(i):null;return u||D($(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function S(n){if(!n||!n.includes("|"))return null;let e=n.slice(n.indexOf("|")+1).replace(/\n/g," ").trim();return e.length>0?e:null}function $(n,e,i,u,l){let p=d(n,e);if(!p)return null;let c=p.split(/\r?\n/),t=v(c,i,u,l);for(let s of t){let f=Math.min(c.length-1,Math.max(s,s+4)),a="";for(let r=s;r<=f;r+=1){let o=c[r]?.trim();if(o&&(a=a?`${a} ${o}`:o,y(a)))return a}if(a&&a.includes("("))return a}return null}function y(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||w(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function L(n){if(!n||!n.trim())return null;let e=n.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(),i=e.indexOf("(");return i===-1||(e=e.slice(i),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function D(n,e){if(!n||!n.trim())return null;let i=n.replace(/\s+/g," ").trim(),u=i.indexOf("(");if(u===-1)return null;let l=i.slice(0,u),c=new RegExp(`\\b${h(e)}\\b`,"i").exec(l);c&&typeof c.index=="number"&&(l=l.slice(0,c.index)),l=l.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let t=i.slice(u).replace(/\s*\{[\s\S]*$/,"").replace(/\s*=>[\s\S]*$/,"").replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!t.startsWith("("))return null;let s=`${l?`${l} `:""}${t}`.replace(/\s+/g,"").toLowerCase();return s.length>=3?s:null}function v(n,e,i,u){let l=h(u),p=new RegExp(`\\b${l}\\b\\s*\\(`,"i"),c=new RegExp(`\\bdef\\s+${l}\\b`,"i"),t=[],s=new Set,f=Math.max(0,Math.min(e,n.length-1)),a=Math.max(f,Math.min(n.length-1,Math.max(i,e+4)));for(let r=f;r<=a;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}for(let r=0;r<n.length;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}return t}function w(n){let e=0;for(let i of n)i==="("&&(e+=1),i===")"&&(e-=1);return e}function h(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{I as a};
2
+ //# sourceMappingURL=chunk-TXADWK4I.js.map
@@ -0,0 +1,7 @@
1
+ import{d as x}from"./chunk-QSTMORTI.js";import{a as w}from"./chunk-AEMTUHQ7.js";import{f as k,g as P,m as R}from"./chunk-3FG3VLK3.js";import{e as D,p as v,r as _,t as N}from"./chunk-SPMLGXCE.js";import{b as S,c as C,f as M,i as h}from"./chunk-5IM4IQ6N.js";import{basename as p,extname as g}from"path";function Z(e,t){let{scope:i,maxLoc:n=15,limit:s=30}=t??{},o=H(P(e,i)),l=j(e,i,n),c=G(R(e,l),x(e,l)),y=[];for(let r of l){if(D(e,r.relativePath,r.startLine))continue;let b=p(r.relativePath,g(r.relativePath)),L=[...c.get(r.symbolId)??[]].filter(m=>m!==r.relativePath).filter(m=>p(m,g(m))!==b).filter(m=>{let u=w(m);return u!=="barrel"&&u!=="entry"&&u!=="test"});if(L.length!==1)continue;let f=L[0],F=e.get(`SELECT c.start_line, c.end_line
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d ON c.document_id = d.id
5
+ WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
+ LIMIT 1`,r.symbolId,f);if(!F)continue;let O=v(e,f),T=J(e,f,r.symbol,F.start_line,F.end_line),a=N(O,T);if(a&&h(a.symbol))continue;let d,W=a?.symbol??"",A=a?.isFunctionLike?S(a.symbol):p(f);if(a?.isFunctionLike&&a.symbolId!==r.symbolId){let m=[...c.get(a.symbolId)??[]].filter(u=>u!==a.relativePath);d=m.length>0?m.length:E(o,f)}else d=E(o,f);d<=3||y.push({symbol:r.symbol,shortName:S(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:I(r),singleCaller:W,singleCallerShort:A,callerFanIn:d})}return y.sort((r,b)=>b.callerFanIn-r.callerFanIn||b.loc-r.loc),y.slice(0,s)}function I(e){return e.endLine-e.startLine+1}function j(e,t,i){return _(e,t).filter(n=>!e.isIgnored(n.relativePath)).filter(n=>M(n.symbol)).filter(n=>!h(n.symbol)).filter(n=>I(n)<=i&&I(n)>=2)}function J(e,t,i,n,s){let o=C(i);if(!o)return n;let l=k(e,t).get(o);if(!l||l.length===0)return n;for(let c of l)if(c>=n&&c<=s)return c;return n}function G(...e){let t=new Map;for(let i of e)for(let[n,s]of i){let o=t.get(n);o||(o=new Set,t.set(n,o));for(let l of s)o.add(l)}return t}function H(e){let t=new Map;for(let[i,n]of e){t.has(i)||t.set(i,t.get(i)??0);for(let s of n)t.set(s,(t.get(s)??0)+1)}return t}function E(e,t){let i=e.get(t)??0;if(i>0)return i;let n=p(t,g(t)),s=0;for(let[o,l]of e)o!==t&&p(o,g(o))===n&&l>s&&(s=l);return s}export{Z as a};
7
+ //# sourceMappingURL=chunk-YRUHPGC3.js.map
@@ -0,0 +1,2 @@
1
+ import{a as W}from"./chunk-YRUHPGC3.js";import{b as I}from"./chunk-4LBOHXT7.js";import{a as q}from"./chunk-5V76WMMZ.js";import{a as j}from"./chunk-N3Z2SJCR.js";import{a as B}from"./chunk-AZQ3ENHU.js";import{a as E}from"./chunk-TWYHFB5K.js";import{a as z}from"./chunk-FPDWFGBQ.js";import{a as V}from"./chunk-G2SX5EHW.js";import{a as A}from"./chunk-435YC4OF.js";import{a as k}from"./chunk-CW5K3KIF.js";import{a as F}from"./chunk-S65VVU3R.js";import{e as y,f as R}from"./chunk-AEMTUHQ7.js";function ht(e,N={}){let{scope:n}=N,c=j(e),T=k(e,{scope:n,minLoc:3,skipBarrels:!0}),w=B(e,{scope:n,minLoc:3}),P=A(e,{scope:n}),U=I(e,{scope:n,minSimilarity:.6,limit:50,minCallees:4}),m=V(e,{scope:n,minLoc:15,minCallees:5,limit:50}),l=W(e,{scope:n,maxLoc:15,limit:50}),a=E(e,{scope:n,maxLoc:15,limit:50}),x=q(e,{scope:n,minLoc:3,limit:50}),s=z(e,{scope:n}),C=F(e,{scope:n,minLoc:10,limit:10}),S=T.symbols.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)&&t.kind==="dead-code"),u=S.length,$=S.reduce((t,o)=>t+o.loc,0),h=w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).length,p=x.length,v=s.unusedImports+s.layerViolations,d=U.length,r=[];u>0&&r.push({category:"Dead code",description:`${u} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:u,locRecoverable:$}),h>0&&r.push({category:"Isolated symbols",description:`${h} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:h,locRecoverable:w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).reduce((t,o)=>t+o.loc,0)});let b=P.filter(t=>t.kind==="real");if(b.length>0&&r.push({category:"Circular dependencies",description:`${b.length} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:b.length,locRecoverable:0}),d>0&&r.push({category:"Similar functions",description:`${d} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:d,locRecoverable:0}),m.length>0&&r.push({category:"Extraction candidates",description:`${m.length} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:m.length,locRecoverable:0}),l.length>0&&r.push({category:"Wrapper functions",description:`${l.length} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:l.length,locRecoverable:l.reduce((t,o)=>t+o.loc,0)}),a.length>0&&r.push({category:"Passthrough functions",description:`${a.length} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:a.length,locRecoverable:a.reduce((t,o)=>t+o.loc,0)}),p>0){let t=x.filter(M=>M.consumers===0).length,o=p-t,g=[];t>0&&g.push(`${t} unused`),o>0&&g.push(`${o} single-consumer (not in types file)`),r.push({category:"Stale abstractions",description:`${g.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:p,locRecoverable:x.reduce((M,_)=>M+_.loc,0)})}if(v>0||s.patternDeviations>0){let t=[];s.unusedImports>0&&t.push(`${s.unusedImports} unused imports`),s.layerViolations>0&&t.push(`${s.layerViolations} layer violations`),s.patternDeviations>0&&t.push(`${s.patternDeviations} unique deps`),r.push({category:"Structural drift",description:t.join(", "),effort:s.layerViolations>0?"medium":"low",impact:s.layerViolations>0?"medium":"low",count:v,locRecoverable:0})}let D={high:3,medium:2,low:1},L={low:3,medium:2,high:1};r.sort((t,o)=>{let g=D[t.impact]*L[t.effort];return D[o.impact]*L[o.effort]-g});let G=Math.max(c.documents,1),f=Math.max(c.symbols,1),i=100,J=u/f;i-=Math.min(20,Math.round(J*200));let K=h/f;i-=Math.min(10,Math.round(K*200));let H=P.filter(t=>t.kind==="real").length;i-=Math.min(15,H*5);let O=d/f*1e3;i-=Math.min(10,Math.round(O));let Q=m.length/f*1e3;i-=Math.min(5,Math.round(Q/2)),i-=Math.min(3,l.length),i-=Math.min(3,a.length);let X=p/Math.max(f*.1,1);i-=Math.min(8,Math.round(X*10));let Y=v/G;i-=Math.min(5,Math.round(Y*50));let Z=C.filter(t=>t.score>50).length;return i-=Math.min(5,Z*2),i=Math.max(0,Math.min(100,i)),{score:i,overview:{documents:c.documents,symbols:c.symbols,indexSizeBytes:c.indexSizeBytes},findings:{deadSymbols:u,deadLoc:$,isolatedSymbols:h,isolatedLoc:w.filter(t=>!y(e,t.relativePath)).reduce((t,o)=>t+o.loc,0),cycles:H,similarPairs:d,extractionCandidates:m.length,wrappers:l.length,passthroughs:a.length,staleTypes:p,driftedFiles:v,complexityHotspotCount:C.length},actions:r,topComplexity:C.slice(0,5).map(t=>({symbol:t.shortName,score:t.score}))}}export{ht as a};
2
+ //# sourceMappingURL=chunk-ZJM2HD2Z.js.map
@@ -0,0 +1,2 @@
1
+ import{b as e}from"./chunk-NFOSOUH6.js";import{s as o}from"./chunk-SPMLGXCE.js";function l(t,r){let s=e(t,r);return o(t,s).map(({relativePath:a,...m})=>m)}export{l as a};
2
+ //# sourceMappingURL=chunk-ZORIMKQO.js.map