scip-query 0.6.3 → 0.6.4

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 (93) hide show
  1. package/dist/{chunk-DXXROCSQ.js → chunk-2DQK2IDZ.js} +2 -2
  2. package/dist/{chunk-DX5YEUX4.js → chunk-4HCKXL7T.js} +2 -2
  3. package/dist/{chunk-YSEQFGGH.js → chunk-4Q2D5BMS.js} +2 -2
  4. package/dist/{chunk-J22I2FWD.js → chunk-5NSYCQWM.js} +2 -2
  5. package/dist/{chunk-IUNRL2AQ.js → chunk-5OVBASGY.js} +2 -2
  6. package/dist/{chunk-GSVIC6KN.js → chunk-6QKHOBC6.js} +2 -2
  7. package/dist/{chunk-HUEIPY4M.js → chunk-6U5UHIRD.js} +2 -2
  8. package/dist/{chunk-6TRXTRCW.js → chunk-6UJ5PXER.js} +2 -2
  9. package/dist/{chunk-Q2MCCKWZ.js → chunk-AQFXC7CF.js} +2 -2
  10. package/dist/{chunk-VZE4SOJG.js → chunk-AW3QJT4O.js} +2 -2
  11. package/dist/{chunk-KOGVTPGE.js → chunk-BSONDC3H.js} +2 -2
  12. package/dist/{chunk-TRBNQ273.js → chunk-CGAO6FHN.js} +2 -2
  13. package/dist/{chunk-S6IGA6KK.js → chunk-ECT6SOBO.js} +2 -2
  14. package/dist/{chunk-RKZBRDFK.js → chunk-FFE3RZ65.js} +2 -2
  15. package/dist/{chunk-ID7TO4P6.js → chunk-FT4WPAEX.js} +2 -2
  16. package/dist/{chunk-TVJMEDHH.js → chunk-G6HYVVRV.js} +2 -2
  17. package/dist/{chunk-CH47OLNL.js → chunk-GALIM3IE.js} +2 -2
  18. package/dist/{chunk-6QXYWGE5.js → chunk-GVVKLMXG.js} +2 -2
  19. package/dist/{chunk-VKYLXCV6.js → chunk-HVM6SQPQ.js} +2 -2
  20. package/dist/{chunk-56LPZC3S.js → chunk-IDCWMWWP.js} +2 -2
  21. package/dist/{chunk-EUHHVFTI.js → chunk-IJO2HZFL.js} +2 -2
  22. package/dist/{chunk-EARGTC7U.js → chunk-INPQVQ6O.js} +2 -2
  23. package/dist/{chunk-HLILTI7S.js → chunk-IVT2U2BV.js} +2 -2
  24. package/dist/{chunk-MDUIJELV.js → chunk-JSBWVSES.js} +2 -2
  25. package/dist/{chunk-MMKNCPHB.js → chunk-LAXFZ3UW.js} +2 -2
  26. package/dist/chunk-MFVPKCS5.js +2 -0
  27. package/dist/{chunk-H4IWC7KJ.js → chunk-MWCN46ZX.js} +2 -2
  28. package/dist/{chunk-VQXXSUQF.js → chunk-NKU7Z242.js} +2 -2
  29. package/dist/{chunk-DM56ECPZ.js → chunk-OOMAS234.js} +2 -2
  30. package/dist/{chunk-UGUBEKK5.js → chunk-PM3GTZ4I.js} +2 -2
  31. package/dist/{chunk-5KWWENJZ.js → chunk-QID23O53.js} +2 -2
  32. package/dist/{chunk-QRULHDMO.js → chunk-QL5MJOVA.js} +8 -8
  33. package/dist/{chunk-UDKLKBPQ.js → chunk-QWFK4QOQ.js} +2 -2
  34. package/dist/{chunk-ORBQ3HJD.js → chunk-RBYC6PHE.js} +2 -2
  35. package/dist/{chunk-EJXPKSWV.js → chunk-TS7E5XBZ.js} +2 -2
  36. package/dist/{chunk-RXGCTLHY.js → chunk-TUC6IWTY.js} +2 -2
  37. package/dist/{chunk-MSNW2AR2.js → chunk-USMVRM6F.js} +2 -2
  38. package/dist/{chunk-NB3GIT4Z.js → chunk-VTZPTRKS.js} +2 -2
  39. package/dist/{chunk-LUYN4IWJ.js → chunk-WUYKGQSK.js} +2 -2
  40. package/dist/{chunk-OBPP5RRE.js → chunk-X7LOLGYY.js} +2 -2
  41. package/dist/{chunk-C6PQLWHR.js → chunk-XGOEZVMA.js} +2 -2
  42. package/dist/{chunk-RAJHIEBM.js → chunk-Y6NOLG4X.js} +2 -2
  43. package/dist/{chunk-VZHI3TUX.js → chunk-YVQ7CIKO.js} +2 -2
  44. package/dist/{chunk-TPOYTT6O.js → chunk-ZE3BTHTS.js} +2 -2
  45. package/dist/{chunk-H7BWAMFI.js → chunk-ZIFKQQW2.js} +2 -2
  46. package/dist/{chunk-RPRIZ43D.js → chunk-ZOR6FW74.js} +2 -2
  47. package/dist/{chunk-2OXZVIED.js → chunk-ZPZLVFJQ.js} +2 -2
  48. package/dist/{chunk-F2TGKDMW.js → chunk-ZZ3F6P3X.js} +2 -2
  49. package/dist/cli.js +74 -74
  50. package/dist/index.js +1 -1
  51. package/dist/queries/affected.js +1 -1
  52. package/dist/queries/bottlenecks.js +1 -1
  53. package/dist/queries/by-kind.js +1 -1
  54. package/dist/queries/call-graph.js +1 -1
  55. package/dist/queries/change-surface.js +1 -1
  56. package/dist/queries/code.js +1 -1
  57. package/dist/queries/complexity-hotspots.js +1 -1
  58. package/dist/queries/complexity.js +1 -1
  59. package/dist/queries/convergence.js +1 -1
  60. package/dist/queries/coupling.js +1 -1
  61. package/dist/queries/cycles.js +1 -1
  62. package/dist/queries/dataflow.js +1 -1
  63. package/dist/queries/dead.js +1 -1
  64. package/dist/queries/deep-chains.js +1 -1
  65. package/dist/queries/deps.js +1 -1
  66. package/dist/queries/drift.js +1 -1
  67. package/dist/queries/extract-candidates.js +1 -1
  68. package/dist/queries/fan.js +1 -1
  69. package/dist/queries/health.js +1 -1
  70. package/dist/queries/hierarchy.js +1 -1
  71. package/dist/queries/hotspots.js +1 -1
  72. package/dist/queries/imports.js +1 -1
  73. package/dist/queries/index.js +1 -1
  74. package/dist/queries/isolated.js +1 -1
  75. package/dist/queries/members.js +1 -1
  76. package/dist/queries/methods.js +1 -1
  77. package/dist/queries/outline.js +1 -1
  78. package/dist/queries/passthrough-candidates.js +1 -1
  79. package/dist/queries/redundant-reexports.js +1 -1
  80. package/dist/queries/refs.js +1 -1
  81. package/dist/queries/similar-chains.js +1 -1
  82. package/dist/queries/similar-files.js +1 -1
  83. package/dist/queries/similar-signatures.js +1 -1
  84. package/dist/queries/similar.js +1 -1
  85. package/dist/queries/slice.js +1 -1
  86. package/dist/queries/stale-abstractions.js +1 -1
  87. package/dist/queries/surface.js +1 -1
  88. package/dist/queries/symbols.js +1 -1
  89. package/dist/queries/system.js +1 -1
  90. package/dist/queries/trace.js +1 -1
  91. package/dist/queries/wrapper-candidates.js +1 -1
  92. package/package.json +1 -1
  93. package/dist/chunk-5OV6CUTY.js +0 -2
@@ -1,4 +1,4 @@
1
- import{b as v}from"./chunk-F2TGKDMW.js";import{a as $}from"./chunk-5KWWENJZ.js";import{b as y,f as S,g as I}from"./chunk-ID7TO4P6.js";import{e as k}from"./chunk-VQXXSUQF.js";import{f as _}from"./chunk-QRULHDMO.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
1
+ import{b as v}from"./chunk-ZZ3F6P3X.js";import{a as $}from"./chunk-QID23O53.js";import{b as y,f as S,g as I}from"./chunk-FT4WPAEX.js";import{e as k}from"./chunk-NKU7Z242.js";import{f as _}from"./chunk-QL5MJOVA.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
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
@@ -16,4 +16,4 @@ import{b as v}from"./chunk-F2TGKDMW.js";import{a as $}from"./chunk-5KWWENJZ.js";
16
16
  ${t.pathExclusionsFor("d1","d2")}
17
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
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-DXXROCSQ.js.map
19
+ //# sourceMappingURL=chunk-2DQK2IDZ.js.map
@@ -1,6 +1,6 @@
1
- import{a as c}from"./chunk-H4IWC7KJ.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-MWCN46ZX.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-DX5YEUX4.js.map
6
+ //# sourceMappingURL=chunk-4HCKXL7T.js.map
@@ -1,2 +1,2 @@
1
- import{a as p,b as d}from"./chunk-5KWWENJZ.js";import{g as B}from"./chunk-ID7TO4P6.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],l=new Set,a=new Set,f=[];function g(t,o){if(o>c)return;if(a.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),y=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=y.join(" -> ");b.has(S)||(b.add(S),i.push({path:y,kind:R(y)}))}return}if(l.has(t))return;l.add(t),a.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)g(h,o+1);f.pop(),a.delete(t)}let b=new Set;for(let t of n.keys())l.has(t)||g(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":d(e)||d(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let l=n[n.length-1],a=i[i.length-1];if(l&&l===a)return!0}return!1}export{w as a};
2
- //# sourceMappingURL=chunk-YSEQFGGH.js.map
1
+ import{a as p,b as d}from"./chunk-QID23O53.js";import{g as B}from"./chunk-FT4WPAEX.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],l=new Set,a=new Set,f=[];function g(t,o){if(o>c)return;if(a.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),y=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=y.join(" -> ");b.has(S)||(b.add(S),i.push({path:y,kind:R(y)}))}return}if(l.has(t))return;l.add(t),a.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)g(h,o+1);f.pop(),a.delete(t)}let b=new Set;for(let t of n.keys())l.has(t)||g(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":d(e)||d(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let l=n[n.length-1],a=i[i.length-1];if(l&&l===a)return!0}return!1}export{w as a};
2
+ //# sourceMappingURL=chunk-4Q2D5BMS.js.map
@@ -1,6 +1,6 @@
1
- import{a as w,b as h,d as R,e as N}from"./chunk-LORWXBOO.js";import{a as P}from"./chunk-5KWWENJZ.js";import{h as T,k as j}from"./chunk-ID7TO4P6.js";import{a as A}from"./chunk-H4IWC7KJ.js";import{d as D,e as L,l as z,q as $,r as B}from"./chunk-QRULHDMO.js";import{b,c as q,f as F,i as x}from"./chunk-5IM4IQ6N.js";function ae(i,e,r={}){let{minSimilarity:s=.4,limit:l=20}=r,o=U(i,e);if(!o)return[];if(!F(o.symbol))return[];let n=K(i,o,s);return n.length>0?n.slice(0,l):G(i,e,{minSimilarity:s,limit:l})}function K(i,e,r){let s=E(i,{minCallees:3,excludeSymbol:e.symbol}),l=R([e,...s].map(n=>n.callees)),o=[];for(let n of s){if(n.callees.size<3)continue;let t=I(e,n,l,{minSimilarity:r,requireSignificantShared:1,requireSharedCount:0});t&&o.push(t)}return o.sort((n,t)=>t.similarity-n.similarity),o}function I(i,e,r,s){let{similarity:l,significantShared:o}=N(i.callees,e.callees,r);if(l<s.minSimilarity)return null;let n=w(i.callees,e.callees).size;if(o.length<s.requireSignificantShared&&n<s.requireSharedCount)return null;let t=o.length>0?o:[...w(i.callees,e.callees)];return{symbolA:i.symbol,shortNameA:b(i.symbol),fileA:i.file,symbolB:e.symbol,shortNameB:b(e.symbol),fileB:e.file,similarity:l,sharedCallees:t.map(b),uniqueToA:[...h(i.callees,e.callees)].map(b),uniqueToB:[...h(e.callees,i.callees)].map(b)}}function me(i,e={}){let{minSimilarity:r=.5,limit:s=20,scope:l,minCallees:o=4,crossFileOnly:n=!1}=e,t=E(i,{minCallees:o,scope:l}),c=R(t.map(a=>a.callees)),u=new Map;for(let a of t)for(let m of a.callees)u.set(m,(u.get(m)??0)+1);let f=Math.max(8,Math.ceil(Math.sqrt(t.length))),S=new Map;for(let a=0;a<t.length;a+=1)for(let m of t[a].callees){if((u.get(m)??0)>f)continue;let g=S.get(m);g||(g=[],S.set(m,g)),g.push(a)}let C=[],v=new Set;e:for(let a=0;a<t.length;a+=1){let m=t[a],g=new Set;for(let k of m.callees){let y=S.get(k);if(y)for(let p of y)p>a&&g.add(p)}for(let k of g){let y=`${a}|${k}`;if(v.has(y))continue;v.add(y);let p=t[k];if(n&&m.file===p.file)continue;if(m.paramCount>=0&&p.paramCount>=0){let _=Math.abs(m.paramCount-p.paramCount),W=Math.max(2,Math.ceil(Math.max(m.paramCount,p.paramCount)*.5));if(_>W)continue}let M=I(m,p,c,{minSimilarity:r,requireSignificantShared:2,requireSharedCount:4});if(M&&(C.push(M),C.length>s*5))break e}}return C.sort((a,m)=>m.similarity-a.similarity),C.slice(0,s)}function U(i,e){let r=A(i,e);if(!r)return null;let s=T(i,r);return{symbol:r.symbol,file:r.relativePath,callees:new Set(s.map(l=>l.symbol)),paramCount:z(i,r.relativePath,r.startLine,r.endLine)?.paramCount??-1}}function E(i,e){let{minCallees:r,scope:s,excludeSymbol:l}=e,o=B(i,s).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>t.isFunctionLike).filter(t=>l===void 0||t.symbol!==l).filter(t=>t.endLine-t.startLine+1>=5).filter(t=>P(t.relativePath)!=="test").filter(t=>!x(t.symbol)).filter(t=>!L(i,t.relativePath,t.startLine)),n=j(i,o);return o.map(t=>({symbol:t.symbol,file:t.relativePath,callees:new Set((n.get(t.symbolId)??[]).map(c=>c.symbol)),paramCount:z(i,t.relativePath,t.startLine,t.endLine)?.paramCount??-1})).filter(t=>t.callees.size>=r)}function G(i,e,r){let s=H(i,e);if(!s||s.tokens.size<3)return[];let l=r.minSimilarity>=.5?r.minSimilarity:.3,o=[];for(let n of Q(i)){if(n.symbol===s.symbol||n.tokens.size<3)continue;let t=w(s.tokens,n.tokens);if(t.size<2)continue;let c=new Set([...s.tokens,...n.tokens]),u=c.size>0?t.size/c.size:0;u<l||o.push({symbolA:s.symbol,shortNameA:b(s.symbol),fileA:s.file,symbolB:n.symbol,shortNameB:b(n.symbol),fileB:n.file,similarity:u,sharedCallees:[...t].sort(),uniqueToA:[...h(s.tokens,n.tokens)].sort(),uniqueToB:[...h(n.tokens,s.tokens)].sort()})}return o.sort((n,t)=>t.similarity-n.similarity||n.shortNameB.localeCompare(t.shortNameB)),o.slice(0,r.limit)}function H(i,e){let r=A(i,e);if(!r||!F(r.symbol))return null;let s=J(i,r);return s?{symbol:r.symbol,file:r.relativePath,tokens:s}:null}function J(i,e){let r=q(e.symbol),s=O(i,e.relativePath,e.startLine,e.endLine,r),l=Z(s,r);return l.size>0?l:null}function Q(i){return $(i).filter(e=>e.isFunctionLike).filter(e=>P(e.relativePath)!=="test").filter(e=>!x(e.symbol)).map(e=>({symbol:e.symbol,file:e.relativePath,tokens:Z(O(i,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)})).filter(e=>e.tokens.size>0)}function O(i,e,r,s,l){let o=D(i,e);if(!o)return"";let n=o.split(`
1
+ import{a as w,b as h,d as R,e as N}from"./chunk-LORWXBOO.js";import{a as P}from"./chunk-QID23O53.js";import{h as T,k as j}from"./chunk-FT4WPAEX.js";import{a as A}from"./chunk-MWCN46ZX.js";import{d as D,e as L,l as z,q as $,r as B}from"./chunk-QL5MJOVA.js";import{b,c as q,f as F,i as x}from"./chunk-5IM4IQ6N.js";function ae(i,e,r={}){let{minSimilarity:s=.4,limit:l=20}=r,o=U(i,e);if(!o)return[];if(!F(o.symbol))return[];let n=K(i,o,s);return n.length>0?n.slice(0,l):G(i,e,{minSimilarity:s,limit:l})}function K(i,e,r){let s=E(i,{minCallees:3,excludeSymbol:e.symbol}),l=R([e,...s].map(n=>n.callees)),o=[];for(let n of s){if(n.callees.size<3)continue;let t=I(e,n,l,{minSimilarity:r,requireSignificantShared:1,requireSharedCount:0});t&&o.push(t)}return o.sort((n,t)=>t.similarity-n.similarity),o}function I(i,e,r,s){let{similarity:l,significantShared:o}=N(i.callees,e.callees,r);if(l<s.minSimilarity)return null;let n=w(i.callees,e.callees).size;if(o.length<s.requireSignificantShared&&n<s.requireSharedCount)return null;let t=o.length>0?o:[...w(i.callees,e.callees)];return{symbolA:i.symbol,shortNameA:b(i.symbol),fileA:i.file,symbolB:e.symbol,shortNameB:b(e.symbol),fileB:e.file,similarity:l,sharedCallees:t.map(b),uniqueToA:[...h(i.callees,e.callees)].map(b),uniqueToB:[...h(e.callees,i.callees)].map(b)}}function me(i,e={}){let{minSimilarity:r=.5,limit:s=20,scope:l,minCallees:o=4,crossFileOnly:n=!1}=e,t=E(i,{minCallees:o,scope:l}),c=R(t.map(a=>a.callees)),u=new Map;for(let a of t)for(let m of a.callees)u.set(m,(u.get(m)??0)+1);let f=Math.max(8,Math.ceil(Math.sqrt(t.length))),S=new Map;for(let a=0;a<t.length;a+=1)for(let m of t[a].callees){if((u.get(m)??0)>f)continue;let g=S.get(m);g||(g=[],S.set(m,g)),g.push(a)}let C=[],v=new Set;e:for(let a=0;a<t.length;a+=1){let m=t[a],g=new Set;for(let k of m.callees){let y=S.get(k);if(y)for(let p of y)p>a&&g.add(p)}for(let k of g){let y=`${a}|${k}`;if(v.has(y))continue;v.add(y);let p=t[k];if(n&&m.file===p.file)continue;if(m.paramCount>=0&&p.paramCount>=0){let _=Math.abs(m.paramCount-p.paramCount),W=Math.max(2,Math.ceil(Math.max(m.paramCount,p.paramCount)*.5));if(_>W)continue}let M=I(m,p,c,{minSimilarity:r,requireSignificantShared:2,requireSharedCount:4});if(M&&(C.push(M),C.length>s*5))break e}}return C.sort((a,m)=>m.similarity-a.similarity),C.slice(0,s)}function U(i,e){let r=A(i,e);if(!r)return null;let s=T(i,r);return{symbol:r.symbol,file:r.relativePath,callees:new Set(s.map(l=>l.symbol)),paramCount:z(i,r.relativePath,r.startLine,r.endLine)?.paramCount??-1}}function E(i,e){let{minCallees:r,scope:s,excludeSymbol:l}=e,o=B(i,s).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>t.isFunctionLike).filter(t=>l===void 0||t.symbol!==l).filter(t=>t.endLine-t.startLine+1>=5).filter(t=>P(t.relativePath)!=="test").filter(t=>!x(t.symbol)).filter(t=>!L(i,t.relativePath,t.startLine)),n=j(i,o);return o.map(t=>({symbol:t.symbol,file:t.relativePath,callees:new Set((n.get(t.symbolId)??[]).map(c=>c.symbol)),paramCount:z(i,t.relativePath,t.startLine,t.endLine)?.paramCount??-1})).filter(t=>t.callees.size>=r)}function G(i,e,r){let s=H(i,e);if(!s||s.tokens.size<3)return[];let l=r.minSimilarity>=.5?r.minSimilarity:.3,o=[];for(let n of Q(i)){if(n.symbol===s.symbol||n.tokens.size<3)continue;let t=w(s.tokens,n.tokens);if(t.size<2)continue;let c=new Set([...s.tokens,...n.tokens]),u=c.size>0?t.size/c.size:0;u<l||o.push({symbolA:s.symbol,shortNameA:b(s.symbol),fileA:s.file,symbolB:n.symbol,shortNameB:b(n.symbol),fileB:n.file,similarity:u,sharedCallees:[...t].sort(),uniqueToA:[...h(s.tokens,n.tokens)].sort(),uniqueToB:[...h(n.tokens,s.tokens)].sort()})}return o.sort((n,t)=>t.similarity-n.similarity||n.shortNameB.localeCompare(t.shortNameB)),o.slice(0,r.limit)}function H(i,e){let r=A(i,e);if(!r||!F(r.symbol))return null;let s=J(i,r);return s?{symbol:r.symbol,file:r.relativePath,tokens:s}:null}function J(i,e){let r=q(e.symbol),s=O(i,e.relativePath,e.startLine,e.endLine,r),l=Z(s,r);return l.size>0?l:null}function Q(i){return $(i).filter(e=>e.isFunctionLike).filter(e=>P(e.relativePath)!=="test").filter(e=>!x(e.symbol)).map(e=>({symbol:e.symbol,file:e.relativePath,tokens:Z(O(i,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)})).filter(e=>e.tokens.size>0)}function O(i,e,r,s,l){let o=D(i,e);if(!o)return"";let n=o.split(`
2
2
  `);if(s>=r&&s-r<=12)return n.slice(r,s+1).join(`
3
3
  `);let t=[new RegExp(`\\bdef\\s+${d(l)}\\b`),new RegExp(`\\bfun\\s+${d(l)}\\b`),new RegExp(`\\bfn\\s+${d(l)}\\b`),new RegExp(`\\bfunction\\s+${d(l)}\\b`),new RegExp(`\\b${d(l)}\\s*\\(`)],c=n.findIndex(u=>t.some(f=>f.test(u)));if(c>=0){let u=c;for(let f=c+1;f<n.length&&f<=c+8;f++){let S=n[f]??"";if(f>c&&X(S)||(u=f,S.trim()===""&&f>c+1))break}return n.slice(c,u+1).join(`
4
4
  `)}return n.slice(r,Math.min(n.length,r+8)).join(`
5
5
  `)}function Z(i,e){if(!i)return new Set;let r=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),s=V(e),o=i.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>!r.has(n)).filter(n=>!s.has(n));return new Set(o)}function V(i){return new Set(i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(e=>e.toLowerCase()).filter(e=>e.length>1))}function X(i){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(i)}function d(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ae as a,me as b};
6
- //# sourceMappingURL=chunk-J22I2FWD.js.map
6
+ //# sourceMappingURL=chunk-5NSYCQWM.js.map
@@ -1,2 +1,2 @@
1
- import{g as y}from"./chunk-ID7TO4P6.js";function L(D,k={}){let{limit:x=10,scope:M,minDepth:j=3}=k,g=y(D,M),u=new Map,o=[],l=new Map,r=new Map,a=new Set,f=[],d=0;for(let t of g.keys()){if(l.has(t))continue;let n=[],s=(g.get(t)??new Set).values();for(l.set(t,d),r.set(t,d),d+=1,f.push(t),a.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let h=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(h)))}let c=e.iter.next();if(c.done){if(r.get(e.node)===l.get(e.node)){let h=[];for(;;){let p=f.pop();if(a.delete(p),h.push(p),u.set(p,o.length),p===e.node)break}o.push(h)}n.pop();continue}let i=c.value;if(l.has(i))a.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,d),r.set(i,d),d+=1,f.push(i),a.add(i);let h=(g.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:h,pendingChild:null})}}}let m=new Map,b=new Array(o.length);for(let t=0;t<o.length;t++)b[t]=o[t].length,m.set(t,new Set);for(let[t,n]of g){let s=u.get(t);for(let e of n){let c=u.get(e);c!==s&&m.get(s).add(c)}}let S=new Array(o.length),I=new Array(o.length);for(let t=0;t<o.length;t++){let n=[],s=0;for(let e of m.get(t)){let c=I[e];c>s&&(s=c,n=S[e])}S[t]=[t,...n],I[t]=b[t]+s}function v(t){return S[t]}let A=o.map(t=>[...t].sort()),C=new Set,w=[];for(let t=0;t<o.length;t++){let n=v(t),s=[];for(let c of n)s.push(...A[c]);if(s.length<j)continue;let e=s.join(" ");C.has(e)||(C.add(e),w.push({chain:s,depth:s.length}))}return w.sort((t,n)=>n.depth-t.depth),w.slice(0,x)}export{L as a};
2
- //# sourceMappingURL=chunk-IUNRL2AQ.js.map
1
+ import{g as y}from"./chunk-FT4WPAEX.js";function L(D,k={}){let{limit:x=10,scope:M,minDepth:j=3}=k,g=y(D,M),u=new Map,o=[],l=new Map,r=new Map,a=new Set,f=[],d=0;for(let t of g.keys()){if(l.has(t))continue;let n=[],s=(g.get(t)??new Set).values();for(l.set(t,d),r.set(t,d),d+=1,f.push(t),a.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let h=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(h)))}let c=e.iter.next();if(c.done){if(r.get(e.node)===l.get(e.node)){let h=[];for(;;){let p=f.pop();if(a.delete(p),h.push(p),u.set(p,o.length),p===e.node)break}o.push(h)}n.pop();continue}let i=c.value;if(l.has(i))a.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,d),r.set(i,d),d+=1,f.push(i),a.add(i);let h=(g.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:h,pendingChild:null})}}}let m=new Map,b=new Array(o.length);for(let t=0;t<o.length;t++)b[t]=o[t].length,m.set(t,new Set);for(let[t,n]of g){let s=u.get(t);for(let e of n){let c=u.get(e);c!==s&&m.get(s).add(c)}}let S=new Array(o.length),I=new Array(o.length);for(let t=0;t<o.length;t++){let n=[],s=0;for(let e of m.get(t)){let c=I[e];c>s&&(s=c,n=S[e])}S[t]=[t,...n],I[t]=b[t]+s}function v(t){return S[t]}let A=o.map(t=>[...t].sort()),C=new Set,w=[];for(let t=0;t<o.length;t++){let n=v(t),s=[];for(let c of n)s.push(...A[c]);if(s.length<j)continue;let e=s.join(" ");C.has(e)||(C.add(e),w.push({chain:s,depth:s.length}))}return w.sort((t,n)=>n.depth-t.depth),w.slice(0,x)}export{L as a};
2
+ //# sourceMappingURL=chunk-5OVBASGY.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-H4IWC7KJ.js";import{p as l}from"./chunk-QRULHDMO.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-GSVIC6KN.js.map
1
+ import{a as m}from"./chunk-MWCN46ZX.js";import{p as l}from"./chunk-QL5MJOVA.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-6QKHOBC6.js.map
@@ -1,5 +1,5 @@
1
- import{d as T}from"./chunk-F2TGKDMW.js";import{m as I}from"./chunk-ID7TO4P6.js";import{d as k}from"./chunk-VQXXSUQF.js";import{a as M,d as y,e as D,f as P,h as w,j as A,r as C}from"./chunk-QRULHDMO.js";import{a as x,b as F,c as b}from"./chunk-5IM4IQ6N.js";function ie(t,s){let{scope:n,minLoc:r=3,maxLoc:i=80,limit:o=30,includeLowConfidence:c=!1}=s??{},a=E(t,n),l=C(t,n).filter(e=>e.isTypeLike&&L(e)>=r).filter(e=>L(e)<=i).filter(e=>!t.isIgnored(e.relativePath)).filter(e=>!$(e.symbol)).filter(e=>!D(t,e.relativePath,e.startLine)),f=I(t,l),u=T(t,l),g=q(f,u),d=new Map;for(let e of l){let m=d.get(e.relativePath);m||(m=new Map,d.set(e.relativePath,m));let p=b(e.symbol);p&&m.set(p,e)}return l.map(e=>{let p=[...g.get(e.symbolId)??new Set].filter(v=>v!==e.relativePath&&!t.isIgnored(v)),{realConsumers:h,barrelConsumers:S}=O(t,e.relativePath,e.symbol,p),R=U(t,e,g,d);return{definition:e,realConsumers:h,barrelConsumers:S,transitivelyReachable:R}}).filter(e=>!e.transitivelyReachable).filter(e=>e.realConsumers.length<=1).filter(e=>!(e.realConsumers.length===0&&e.barrelConsumers>0)).filter(e=>N(e.definition,e.realConsumers.length,a)).map(e=>{let m=G(t,e.definition.relativePath,e.definition.startLine),p=_(e.definition.relativePath)?!0:H(t,e.definition),{confidence:h,reason:S}=K(e.realConsumers.length,m,p);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:L(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:m,definerUsesType:p,confidence:h,reason:S}}).filter(e=>c||e.confidence!=="low").sort((e,m)=>{let p={high:0,medium:1,low:2};return p[e.confidence]-p[m.confidence]||m.loc-e.loc||e.file.localeCompare(m.file)||e.startLine-m.startLine}).slice(0,o)}function E(t,s){return new Set(C(t,s).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function $(t){let s=x(t);if("kind"in s)return!1;let n=s.descriptors;if(n.length<2)return!1;let r=n[n.length-1],i=n[n.length-2];return r?.suffix==="type"&&i?.suffix==="type"}function _(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t))}function N(t,s,n){return!(_(t.relativePath)&&s>0||s===0&&n.has(t.relativePath))}function O(t,s,n,r){let i=[],o=0,c=b(n);for(let a of r)z(t,a,s,c)||B(t,a,c)?o++:i.push(a);return{realConsumers:i,barrelConsumers:o}}function U(t,s,n,r){let i=A(t,s.relativePath),o=b(s.symbol);if(!o)return!1;let c=i.get(o);if(!c||c.size===0)return!1;let a=r.get(s.relativePath);if(!a)return!1;for(let l of c){let f=a.get(l);if(!f)continue;let u=n.get(f.symbolId);if(u){for(let g of u)if(g!==s.relativePath&&!t.isIgnored(g))return!0}}return!1}var j=M("stale-abs-file-usage");function B(t,s,n){if(!n)return!1;let r=P(s);if(!r)return!1;let i=j.get(t,s,()=>W(t,s,r));return i.importedLeaves.has(n)&&!i.usedLeaves.has(n)}function W(t,s,n){let r=new Set,i=new Set,o=w(t,s);if(!o)return{importedLeaves:r,usedLeaves:i};let c=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(l,f)=>{let u=f||c.has(l.type);(l.type==="identifier"||l.type==="type_identifier"||l.type==="property_identifier"||l.type==="field_identifier")&&(u?r.add(l.text):i.add(l.text));for(let g of l.children)a(g,u)};return a(o.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function z(t,s,n,r){if(!r)return!1;let i=y(t,s);if(!i)return!1;let o=k(t,s);if(o.length===0)return!1;let c=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),l=i.split(`
1
+ import{d as T}from"./chunk-ZZ3F6P3X.js";import{m as I}from"./chunk-FT4WPAEX.js";import{d as k}from"./chunk-NKU7Z242.js";import{a as M,d as y,e as D,f as P,h as w,j as A,r as C}from"./chunk-QL5MJOVA.js";import{a as x,b as F,c as b}from"./chunk-5IM4IQ6N.js";function ie(t,s){let{scope:n,minLoc:r=3,maxLoc:i=80,limit:o=30,includeLowConfidence:c=!1}=s??{},a=E(t,n),l=C(t,n).filter(e=>e.isTypeLike&&L(e)>=r).filter(e=>L(e)<=i).filter(e=>!t.isIgnored(e.relativePath)).filter(e=>!$(e.symbol)).filter(e=>!D(t,e.relativePath,e.startLine)),f=I(t,l),u=T(t,l),g=q(f,u),d=new Map;for(let e of l){let m=d.get(e.relativePath);m||(m=new Map,d.set(e.relativePath,m));let p=b(e.symbol);p&&m.set(p,e)}return l.map(e=>{let p=[...g.get(e.symbolId)??new Set].filter(v=>v!==e.relativePath&&!t.isIgnored(v)),{realConsumers:h,barrelConsumers:S}=O(t,e.relativePath,e.symbol,p),R=U(t,e,g,d);return{definition:e,realConsumers:h,barrelConsumers:S,transitivelyReachable:R}}).filter(e=>!e.transitivelyReachable).filter(e=>e.realConsumers.length<=1).filter(e=>!(e.realConsumers.length===0&&e.barrelConsumers>0)).filter(e=>N(e.definition,e.realConsumers.length,a)).map(e=>{let m=G(t,e.definition.relativePath,e.definition.startLine),p=_(e.definition.relativePath)?!0:H(t,e.definition),{confidence:h,reason:S}=K(e.realConsumers.length,m,p);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:L(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:m,definerUsesType:p,confidence:h,reason:S}}).filter(e=>c||e.confidence!=="low").sort((e,m)=>{let p={high:0,medium:1,low:2};return p[e.confidence]-p[m.confidence]||m.loc-e.loc||e.file.localeCompare(m.file)||e.startLine-m.startLine}).slice(0,o)}function E(t,s){return new Set(C(t,s).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function $(t){let s=x(t);if("kind"in s)return!1;let n=s.descriptors;if(n.length<2)return!1;let r=n[n.length-1],i=n[n.length-2];return r?.suffix==="type"&&i?.suffix==="type"}function _(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t))}function N(t,s,n){return!(_(t.relativePath)&&s>0||s===0&&n.has(t.relativePath))}function O(t,s,n,r){let i=[],o=0,c=b(n);for(let a of r)z(t,a,s,c)||B(t,a,c)?o++:i.push(a);return{realConsumers:i,barrelConsumers:o}}function U(t,s,n,r){let i=A(t,s.relativePath),o=b(s.symbol);if(!o)return!1;let c=i.get(o);if(!c||c.size===0)return!1;let a=r.get(s.relativePath);if(!a)return!1;for(let l of c){let f=a.get(l);if(!f)continue;let u=n.get(f.symbolId);if(u){for(let g of u)if(g!==s.relativePath&&!t.isIgnored(g))return!0}}return!1}var j=M("stale-abs-file-usage");function B(t,s,n){if(!n)return!1;let r=P(s);if(!r)return!1;let i=j.get(t,s,()=>W(t,s,r));return i.importedLeaves.has(n)&&!i.usedLeaves.has(n)}function W(t,s,n){let r=new Set,i=new Set,o=w(t,s);if(!o)return{importedLeaves:r,usedLeaves:i};let c=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(l,f)=>{let u=f||c.has(l.type);(l.type==="identifier"||l.type==="type_identifier"||l.type==="property_identifier"||l.type==="field_identifier")&&(u?r.add(l.text):i.add(l.text));for(let g of l.children)a(g,u)};return a(o.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function z(t,s,n,r){if(!r)return!1;let i=y(t,s);if(!i)return!1;let o=k(t,s);if(o.length===0)return!1;let c=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),l=i.split(`
2
2
  `),f=0;for(let u=0;u<l.length;u++){if(!a.test(l[u]??""))continue;if(f++,!o.find(d=>d.startLine<=u&&u<=d.endLine))return!1}return f>0}function G(t,s,n){let r=y(t,s);if(!r)return"other";let i=r.split(`
3
3
  `),o=Math.max(0,n-2),c=Math.min(i.length-1,n+2);for(let a=o;a<=c;a++){let f=(i[a]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(f))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(f))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(f))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(f))return"enum"}return"other"}function H(t,s){let n=y(t,s.relativePath);if(!n)return!1;let r=b(s.symbol);if(!r)return!1;let i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`\\b${i}\\b`),c=n.split(`
4
4
  `);for(let a=0;a<c.length;a++)if(!(a>=s.startLine&&a<=s.endLine)&&o.test(c[a]??""))return!0;return!1}function K(t,s,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&s==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}function L(t){return t.endLine-t.startLine+1}function q(...t){let s=new Map;for(let n of t)for(let[r,i]of n){let o=s.get(r);o||(o=new Set,s.set(r,o));for(let c of i)o.add(c)}return s}export{ie as a};
5
- //# sourceMappingURL=chunk-HUEIPY4M.js.map
5
+ //# sourceMappingURL=chunk-6U5UHIRD.js.map
@@ -1,4 +1,4 @@
1
- import{b as o}from"./chunk-DX5YEUX4.js";import{s as m}from"./chunk-QRULHDMO.js";function y(t,l){let s=o(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
1
+ import{b as o}from"./chunk-4HCKXL7T.js";import{s as m}from"./chunk-QL5MJOVA.js";function y(t,l){let s=o(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
2
2
  WHERE relative_path IN (${d})
3
3
  ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=m(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
4
4
  FROM mentions m
@@ -32,4 +32,4 @@ import{b as o}from"./chunk-DX5YEUX4.js";import{s as m}from"./chunk-QRULHDMO.js";
32
32
  WHERE d2.relative_path IN (${d})
33
33
  AND d1.relative_path NOT IN (${d})
34
34
  ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{y as a};
35
- //# sourceMappingURL=chunk-6TRXTRCW.js.map
35
+ //# sourceMappingURL=chunk-6UJ5PXER.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-5KWWENJZ.js";import{k as b,m as f}from"./chunk-ID7TO4P6.js";import{r as u}from"./chunk-QRULHDMO.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-Q2MCCKWZ.js.map
1
+ import{a as C}from"./chunk-QID23O53.js";import{k as b,m as f}from"./chunk-FT4WPAEX.js";import{r as u}from"./chunk-QL5MJOVA.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-AQFXC7CF.js.map
@@ -1,4 +1,4 @@
1
- import{i as d}from"./chunk-ID7TO4P6.js";import{q as l}from"./chunk-QRULHDMO.js";import{b as r}from"./chunk-5IM4IQ6N.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
1
+ import{i as d}from"./chunk-FT4WPAEX.js";import{q as l}from"./chunk-QL5MJOVA.js";import{b as r}from"./chunk-5IM4IQ6N.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
2
2
  gs.symbol,
3
3
  COUNT(*) AS ref_count,
4
4
  COUNT(DISTINCT ref_d.id) AS file_count,
@@ -22,4 +22,4 @@ import{i as d}from"./chunk-ID7TO4P6.js";import{q as l}from"./chunk-QRULHDMO.js";
22
22
  GROUP BY gs.id
23
23
  ORDER BY ref_count DESC
24
24
  LIMIT ?`,s).filter(i=>!o.isIgnored(i.defined_in)).map(i=>({symbol:i.symbol,shortName:r(i.symbol),refCount:i.ref_count,fileCount:i.file_count,definedIn:i.defined_in}));return m.length>0?m:f(o,e,s)}function f(o,t,s){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,s)}function u(o,t){let s=d(o,t,{limit:500});return{symbol:t.symbol,shortName:r(t.symbol),refCount:s.length,fileCount:new Set(s.map(e=>e.file)).size,definedIn:t.relativePath}}export{y as a};
25
- //# sourceMappingURL=chunk-VZE4SOJG.js.map
25
+ //# sourceMappingURL=chunk-AW3QJT4O.js.map
@@ -1,7 +1,7 @@
1
- import{c as m}from"./chunk-F2TGKDMW.js";import{j as g}from"./chunk-ID7TO4P6.js";import{a as R}from"./chunk-H4IWC7KJ.js";import{d as h}from"./chunk-QRULHDMO.js";import{f as u}from"./chunk-5IM4IQ6N.js";function $(t,a){let e=R(t,a);if(!e)return[];let i=!u(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],r=m(t,e),l=(r.length>0?r:g(t,e)).filter(n=>!t.isIgnored(n.file)).map(n=>({relativePath:n.file,line:n.line})),c=S(t,e),o=new Set,f=[];for(let n of[...i,...l,...c]){let p=`${n.relativePath}:${n.line}`;o.has(p)||(o.add(p),f.push(n))}return f}function S(t,a){if(!a.relativePath.endsWith(".rb"))return[];let e=d(a.symbol);if(e.length===0)return[];let s=t.all(`SELECT relative_path
1
+ import{c as m}from"./chunk-ZZ3F6P3X.js";import{j as g}from"./chunk-FT4WPAEX.js";import{a as R}from"./chunk-MWCN46ZX.js";import{d as h}from"./chunk-QL5MJOVA.js";import{f as u}from"./chunk-5IM4IQ6N.js";function $(t,a){let e=R(t,a);if(!e)return[];let i=!u(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],r=m(t,e),l=(r.length>0?r:g(t,e)).filter(n=>!t.isIgnored(n.file)).map(n=>({relativePath:n.file,line:n.line})),c=S(t,e),o=new Set,f=[];for(let n of[...i,...l,...c]){let p=`${n.relativePath}:${n.line}`;o.has(p)||(o.add(p),f.push(n))}return f}function S(t,a){if(!a.relativePath.endsWith(".rb"))return[];let e=d(a.symbol);if(e.length===0)return[];let s=t.all(`SELECT relative_path
2
2
  FROM documents
3
3
  WHERE relative_path LIKE '%.rb'
4
4
  ${t.pathExclusionsFor("documents")}
5
5
  ORDER BY relative_path`),i=[];for(let r of s){if(t.isIgnored(r.relative_path))continue;let l=h(t,r.relative_path);if(!l)continue;let c=l.split(`
6
6
  `);for(let o=0;o<c.length;o++){let f=c[o]??"";e.some(n=>new RegExp(`@${n}\\b|\\b${n}:`).test(f))&&i.push({relativePath:r.relative_path,line:o})}}return i}function d(t){let e=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),s=e.split("_").filter(Boolean),i=new Set;return e&&i.add(e),s.length>=1&&i.add(s[s.length-1]),s.length>=2&&i.add(s.slice(-2).join("_")),[...i]}export{$ as a};
7
- //# sourceMappingURL=chunk-KOGVTPGE.js.map
7
+ //# sourceMappingURL=chunk-BSONDC3H.js.map
@@ -1,2 +1,2 @@
1
- import{c as g}from"./chunk-F2TGKDMW.js";import{h as c,i as y,j as S}from"./chunk-ID7TO4P6.js";import{a}from"./chunk-H4IWC7KJ.js";import{b as r}from"./chunk-5IM4IQ6N.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=g(l,o),s=(t.length>0?t:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
- //# sourceMappingURL=chunk-TRBNQ273.js.map
1
+ import{c as g}from"./chunk-ZZ3F6P3X.js";import{h as c,i as y,j as S}from"./chunk-FT4WPAEX.js";import{a}from"./chunk-MWCN46ZX.js";import{b as r}from"./chunk-5IM4IQ6N.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=g(l,o),s=(t.length>0?t:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
+ //# sourceMappingURL=chunk-CGAO6FHN.js.map
@@ -1,2 +1,2 @@
1
- import{h as f}from"./chunk-ID7TO4P6.js";import{a as m}from"./chunk-H4IWC7KJ.js";import{b as r}from"./chunk-5IM4IQ6N.js";function w(i,g,p){let s=m(i,g),n=m(i,p);if(!s||!n)return null;let c=new Set(f(i,s).map(e=>e.symbol)),h=new Set(f(i,n).map(e=>e.symbol)),a=[];for(let e of c)h.has(e)&&a.push(e);let o=[];for(let e of c)h.has(e)||o.push(e);let l=[];for(let e of h)c.has(e)||l.push(e);let u=new Set([...c,...h]),d=u.size>0?a.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":a.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&l.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":l.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&l.length<=2?t=`Create a shared function with the ${a.length} common callees. Pass the ${o.length+l.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${a.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${l.length} in B).`;let y=s.endLine-s.startLine+1,b=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:r(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:b},similarity:d,sharedCallees:a.map(r),uniqueToA:o.map(r),uniqueToB:l.map(r),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-S6IGA6KK.js.map
1
+ import{h as f}from"./chunk-FT4WPAEX.js";import{a as m}from"./chunk-MWCN46ZX.js";import{b as r}from"./chunk-5IM4IQ6N.js";function w(i,g,p){let s=m(i,g),n=m(i,p);if(!s||!n)return null;let c=new Set(f(i,s).map(e=>e.symbol)),h=new Set(f(i,n).map(e=>e.symbol)),a=[];for(let e of c)h.has(e)&&a.push(e);let o=[];for(let e of c)h.has(e)||o.push(e);let l=[];for(let e of h)c.has(e)||l.push(e);let u=new Set([...c,...h]),d=u.size>0?a.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":a.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&l.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":l.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&l.length<=2?t=`Create a shared function with the ${a.length} common callees. Pass the ${o.length+l.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${a.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${l.length} in B).`;let y=s.endLine-s.startLine+1,b=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:r(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:b},similarity:d,sharedCallees:a.map(r),uniqueToA:o.map(r),uniqueToB:l.map(r),consolidationStrategy:t}}export{w as a};
2
+ //# sourceMappingURL=chunk-ECT6SOBO.js.map
@@ -1,2 +1,2 @@
1
- import{d,q as b}from"./chunk-QRULHDMO.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-RKZBRDFK.js.map
1
+ import{d,q as b}from"./chunk-QL5MJOVA.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-FFE3RZ65.js.map
@@ -1,4 +1,4 @@
1
- import{a as T,b as H,c as $,e as J}from"./chunk-VQXXSUQF.js";import{c as P}from"./chunk-H4IWC7KJ.js";import{a as I,b as N,d as A,f as E,h as L,i as k,k as C,m as v,p as O,q as D,t as F}from"./chunk-QRULHDMO.js";import{c as R}from"./chunk-5IM4IQ6N.js";var x=new WeakMap;function xe(n,o){let i=E(o);return i==="rust"?ne(n,o):i==="typescript"||i==="tsx"||i==="javascript"?Q(n,o):[]}var X=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function Q(n,o){let i=L(n,o);if(!i)return[];let l=x.get(i);if(l)return l;let a=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(o)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(o),r=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(o),d=!1,t=i.rootNode;for(let s of t.namedChildren){if(s.type!=="expression_statement")continue;let f=s.namedChild(0);if(!f||f.type!=="call_expression")continue;let e=f.namedChild(0);if(!e)continue;let u=e.type==="member_expression"?e.namedChild(e.namedChildCount-1)?.text:e.text;if(u&&X.has(u)){d=!0;break}}let c=[];d&&c.push({startLine:0,endLine:t.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(a||r)&&c.push({startLine:0,endLine:t.endPosition.row,reason:a?"Next.js / Remix route file":"Vite/Vue route component"});for(let s of t.namedChildren){let f=null,e=null;if(s.type==="function_declaration")f=s.namedChild(0)?.text??null,e=s;else if(s.type==="export_statement"){let u=s.namedChild(0);u?.type==="function_declaration"&&(f=u.namedChild(0)?.text??null,e=u)}else if(s.type==="lexical_declaration"){let u=s.namedChild(0);if(u?.type==="variable_declarator"){let p=u.namedChild(0)?.text,m=u.namedChild(1);p&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(f=p,e=u)}}f&&/^use[A-Z]/.test(f)&&e&&c.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"React custom hook (use*)"})}return c.push(...z(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,c),c}var ee=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function te(n){return ee.test(n)}function z(n,o,i){let l=[],a=r=>{if(o.has(r.type)&&r.parent){let t=r.parent.children,c=-1;for(let s=0;s<t.length;s+=1)if(t[s].startIndex===r.startIndex&&t[s].type===r.type){c=s;break}if(c>0)for(let s=c-1;s>=0;s-=1){let f=t[s];if(i.has(f.type)){if(te(f.text)){l.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(f.type==="attribute_item"||f.type==="inner_attribute_item"))break}}for(let d of r.namedChildren)a(d)};return a(n.rootNode),l}function ne(n,o){let i=L(n,o);if(!i)return[];let l=x.get(i);if(l)return l;let a=[];if(ie(i.rootNode)){let e={startLine:0,endLine:i.rootNode.endPosition.row,reason:"generated file (@generated header)"};return x.set(i,[e]),[e]}let r=e=>{let u=e.parent;if(!u)return[];let p=u.children,m=-1;for(let g=0;g<p.length;g+=1)if(p[g].startIndex===e.startIndex&&p[g].type===e.type){m=g;break}if(m<=0)return[];let b=[];for(let g=m-1;g>=0;g-=1){let _=p[g];if(_.type==="attribute_item"||_.type==="inner_attribute_item")b.push(_.text);else{if(_.type==="line_comment"||_.type==="block_comment")continue;break}}return b},d=e=>/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null,t=e=>/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1,c=e=>/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e),s=(e,u,p,m)=>{let b=u,g=p,_=m;if(e.type==="trait_item"&&(_=!0,a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"})),e.type==="impl_item"&&e.childForFieldName("trait")&&(g=!0,a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"){let y=r(e),h=null;p?h="trait impl method (dynamic dispatch)":u&&(h="inside #[cfg(test)] mod");for(let S of y){let w=d(S);if(w){h=w;break}if(c(S)){h="#[allow(dead_code)]";break}}h&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:h})}else if(p&&(e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"))a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"});else if(e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"){let y=r(e),h=y.some(t),S=y.some(c),w=e.namedChildren.find(Z=>Z.type==="type_identifier")?.text;h&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:w}),S&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:w}),u&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:w})}else e.type==="mod_item"&&r(e).some(h=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(h))&&(b=!0);for(let y of e.namedChildren)s(y,b,g,_)};s(i.rootNode,!1,!1,!1),a.push(...z(i,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"])));let f=ce(i.rootNode);if(f.size>0)for(let e of i.rootNode.descendantsOfType("mod_item")){let u=e.childForFieldName("name")?.text;u&&f.has(u)&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:u})}return x.set(i,a),a}function ie(n){for(let o=0;o<Math.min(n.namedChildCount,12);o+=1){let i=n.namedChild(o);if(!i||i.type!=="line_comment"&&i.type!=="block_comment")break;if(/@generated\b/.test(i.text)||/This file is .*generated\b/i.test(i.text)||/Code generated by/i.test(i.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(i.text)||/openapi-generator/i.test(i.text)&&/Generated by/i.test(i.text))return!0}return!1}var se=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],j=/^#!?\[\s*serde\s*\(/,oe=/^#!?\[\s*schemars\s*\(/,re=/^#!?\[\s*validate\s*\(/,W=/\bwith\s*=\s*"([^"]+)"/g;function G(n,o){return C(n,o,ae,()=>new Set,(i,l,a)=>{if(l==="rust"){for(let r of i.rootNode.descendantsOfType("attribute_item"))B(r.text,a);for(let r of i.rootNode.descendantsOfType("inner_attribute_item"))B(r.text,a)}})??new Set}var ae=new WeakMap;function B(n,o){let i=j.test(n),l=oe.test(n),a=re.test(n);if(!(!i&&!l&&!a))for(let{re:r}of se){r.lastIndex=0;let d;for(;(d=r.exec(n))!==null;){let t=d[1],c=t.split("::").pop()??t;c==="is_none"&&/\bOption\b/.test(t)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(t)||c&&o.add(c)}}}function ce(n){let o=new Set;for(let i of n.descendantsOfType("attribute_item")){if(!j.test(i.text))continue;W.lastIndex=0;let l;for(;(l=W.exec(i.text))!==null;){let a=l[1],r=a.split("::").pop()??a;r&&o.add(r)}}return o}var le=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Re(n,o){return C(n,o,de,()=>new Set,(i,l,a)=>{if(!(l!=="typescript"&&l!=="tsx"&&l!=="javascript"))for(let r of i.rootNode.descendantsOfType("call_expression")){let d=r.namedChild(0);if(!d)continue;let t=v(d);if(!t||!le.has(t))continue;let c=r.namedChildren.find(e=>e.type==="arguments");if(!c)continue;let s=c.namedChild(0);if(!s||s.type!=="string")continue;let f=s.namedChildren.find(e=>e.type==="string_fragment");f&&a.add(f.text)}})??new Set}var de=new WeakMap;function Y(n,o,i,l={}){if(!i)return[];let a=A(n,o);if(!a)return[];if(a.indexOf(i)===-1)return[];if(E(o))return(M(n,o).get(i)??[]).filter(f=>!V(f,l));let r=H(n,o,a),d=new RegExp(`\\b${$(i)}\\b`),t=[];for(let c=0;c<r.length;c++)V(c,l)||d.test(r[c]??"")&&t.push(c);return t}function V(n,o){return typeof o.excludeStartLine=="number"&&typeof o.excludeEndLine=="number"&&n>=o.excludeStartLine&&n<=o.excludeEndLine}var ue=I("file-identifiers");function ve(n,o){return ue.get(n,o,()=>new Set(M(n,o).keys()))}var fe=I("file-ident-lines");function M(n,o){return fe.get(n,o,()=>pe(n,o))}var me=I("file-idents-by-line");function U(n,o){return me.get(n,o,()=>{let i=M(n,o),l=0;for(let r of i.values()){let d=r[r.length-1];d!==void 0&&d>l&&(l=d)}let a=new Array(l+1);for(let r=0;r<=l;r+=1)a[r]=new Set;for(let[r,d]of i)for(let t of d)a[t].add(r);return a})}function pe(n,o){let i=new Map,l=(t,c)=>{let s=i.get(t);if(!s){i.set(t,[c]);return}s[s.length-1]!==c&&s.push(c)};if(E(o)){let t=L(n,o);if(t){let c=E(o),s=c==="rust"?new Set(["identifier","type_identifier","field_identifier"]):c==="python"?new Set(["identifier"]):new Set(["identifier","property_identifier","type_identifier"]),f=new Set(["rust","python"]),e=/\{([^{}]*)\}/g,u=/\b([A-Za-z_][\w]*)\b/g,p=m=>{if(s.has(m.type)&&l(m.text,m.startPosition.row),c&&f.has(c)&&m.type==="string_content"){let b=m.startPosition.row;for(let g of m.text.matchAll(e)){let _=g[1]??"";for(let y of _.matchAll(u))y[1]&&l(y[1],b)}}for(let b of m.children)p(b)};return p(t.rootNode),i}}let a=A(n,o);if(!a)return i;let r=T(a).split(/\r?\n/),d=/\b([A-Za-z_$][\w$]*)\b/g;for(let t=0;t<r.length;t+=1){let c=r[t]??"";for(let s of c.matchAll(d))s[1]&&l(s[1],t)}return i}var be=I("file-dep-graph");function Be(n,o){return be.get(n,o??"",()=>{let i=o?`AND d1.relative_path LIKE '%${o}%'`:"",l=n.all(`SELECT DISTINCT
1
+ import{a as T,b as H,c as $,e as J}from"./chunk-NKU7Z242.js";import{c as P}from"./chunk-MWCN46ZX.js";import{a as I,b as N,d as A,f as E,h as L,i as k,k as C,m as v,p as O,q as D,t as F}from"./chunk-QL5MJOVA.js";import{c as R}from"./chunk-5IM4IQ6N.js";var x=new WeakMap;function xe(n,o){let i=E(o);return i==="rust"?ne(n,o):i==="typescript"||i==="tsx"||i==="javascript"?Q(n,o):[]}var X=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function Q(n,o){let i=L(n,o);if(!i)return[];let l=x.get(i);if(l)return l;let a=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(o)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(o),r=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(o),d=!1,t=i.rootNode;for(let s of t.namedChildren){if(s.type!=="expression_statement")continue;let f=s.namedChild(0);if(!f||f.type!=="call_expression")continue;let e=f.namedChild(0);if(!e)continue;let u=e.type==="member_expression"?e.namedChild(e.namedChildCount-1)?.text:e.text;if(u&&X.has(u)){d=!0;break}}let c=[];d&&c.push({startLine:0,endLine:t.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(a||r)&&c.push({startLine:0,endLine:t.endPosition.row,reason:a?"Next.js / Remix route file":"Vite/Vue route component"});for(let s of t.namedChildren){let f=null,e=null;if(s.type==="function_declaration")f=s.namedChild(0)?.text??null,e=s;else if(s.type==="export_statement"){let u=s.namedChild(0);u?.type==="function_declaration"&&(f=u.namedChild(0)?.text??null,e=u)}else if(s.type==="lexical_declaration"){let u=s.namedChild(0);if(u?.type==="variable_declarator"){let p=u.namedChild(0)?.text,m=u.namedChild(1);p&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(f=p,e=u)}}f&&/^use[A-Z]/.test(f)&&e&&c.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"React custom hook (use*)"})}return c.push(...z(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,c),c}var ee=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function te(n){return ee.test(n)}function z(n,o,i){let l=[],a=r=>{if(o.has(r.type)&&r.parent){let t=r.parent.children,c=-1;for(let s=0;s<t.length;s+=1)if(t[s].startIndex===r.startIndex&&t[s].type===r.type){c=s;break}if(c>0)for(let s=c-1;s>=0;s-=1){let f=t[s];if(i.has(f.type)){if(te(f.text)){l.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(f.type==="attribute_item"||f.type==="inner_attribute_item"))break}}for(let d of r.namedChildren)a(d)};return a(n.rootNode),l}function ne(n,o){let i=L(n,o);if(!i)return[];let l=x.get(i);if(l)return l;let a=[];if(ie(i.rootNode)){let e={startLine:0,endLine:i.rootNode.endPosition.row,reason:"generated file (@generated header)"};return x.set(i,[e]),[e]}let r=e=>{let u=e.parent;if(!u)return[];let p=u.children,m=-1;for(let g=0;g<p.length;g+=1)if(p[g].startIndex===e.startIndex&&p[g].type===e.type){m=g;break}if(m<=0)return[];let b=[];for(let g=m-1;g>=0;g-=1){let _=p[g];if(_.type==="attribute_item"||_.type==="inner_attribute_item")b.push(_.text);else{if(_.type==="line_comment"||_.type==="block_comment")continue;break}}return b},d=e=>/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null,t=e=>/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1,c=e=>/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e),s=(e,u,p,m)=>{let b=u,g=p,_=m;if(e.type==="trait_item"&&(_=!0,a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"})),e.type==="impl_item"&&e.childForFieldName("trait")&&(g=!0,a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"){let y=r(e),h=null;p?h="trait impl method (dynamic dispatch)":u&&(h="inside #[cfg(test)] mod");for(let S of y){let w=d(S);if(w){h=w;break}if(c(S)){h="#[allow(dead_code)]";break}}h&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:h})}else if(p&&(e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"))a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"});else if(e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"){let y=r(e),h=y.some(t),S=y.some(c),w=e.namedChildren.find(Z=>Z.type==="type_identifier")?.text;h&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:w}),S&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:w}),u&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:w})}else e.type==="mod_item"&&r(e).some(h=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(h))&&(b=!0);for(let y of e.namedChildren)s(y,b,g,_)};s(i.rootNode,!1,!1,!1),a.push(...z(i,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"])));let f=ce(i.rootNode);if(f.size>0)for(let e of i.rootNode.descendantsOfType("mod_item")){let u=e.childForFieldName("name")?.text;u&&f.has(u)&&a.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:u})}return x.set(i,a),a}function ie(n){for(let o=0;o<Math.min(n.namedChildCount,12);o+=1){let i=n.namedChild(o);if(!i||i.type!=="line_comment"&&i.type!=="block_comment")break;if(/@generated\b/.test(i.text)||/This file is .*generated\b/i.test(i.text)||/Code generated by/i.test(i.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(i.text)||/openapi-generator/i.test(i.text)&&/Generated by/i.test(i.text))return!0}return!1}var se=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],j=/^#!?\[\s*serde\s*\(/,oe=/^#!?\[\s*schemars\s*\(/,re=/^#!?\[\s*validate\s*\(/,W=/\bwith\s*=\s*"([^"]+)"/g;function G(n,o){return C(n,o,ae,()=>new Set,(i,l,a)=>{if(l==="rust"){for(let r of i.rootNode.descendantsOfType("attribute_item"))B(r.text,a);for(let r of i.rootNode.descendantsOfType("inner_attribute_item"))B(r.text,a)}})??new Set}var ae=new WeakMap;function B(n,o){let i=j.test(n),l=oe.test(n),a=re.test(n);if(!(!i&&!l&&!a))for(let{re:r}of se){r.lastIndex=0;let d;for(;(d=r.exec(n))!==null;){let t=d[1],c=t.split("::").pop()??t;c==="is_none"&&/\bOption\b/.test(t)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(t)||c&&o.add(c)}}}function ce(n){let o=new Set;for(let i of n.descendantsOfType("attribute_item")){if(!j.test(i.text))continue;W.lastIndex=0;let l;for(;(l=W.exec(i.text))!==null;){let a=l[1],r=a.split("::").pop()??a;r&&o.add(r)}}return o}var le=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Re(n,o){return C(n,o,de,()=>new Set,(i,l,a)=>{if(!(l!=="typescript"&&l!=="tsx"&&l!=="javascript"))for(let r of i.rootNode.descendantsOfType("call_expression")){let d=r.namedChild(0);if(!d)continue;let t=v(d);if(!t||!le.has(t))continue;let c=r.namedChildren.find(e=>e.type==="arguments");if(!c)continue;let s=c.namedChild(0);if(!s||s.type!=="string")continue;let f=s.namedChildren.find(e=>e.type==="string_fragment");f&&a.add(f.text)}})??new Set}var de=new WeakMap;function Y(n,o,i,l={}){if(!i)return[];let a=A(n,o);if(!a)return[];if(a.indexOf(i)===-1)return[];if(E(o))return(M(n,o).get(i)??[]).filter(f=>!V(f,l));let r=H(n,o,a),d=new RegExp(`\\b${$(i)}\\b`),t=[];for(let c=0;c<r.length;c++)V(c,l)||d.test(r[c]??"")&&t.push(c);return t}function V(n,o){return typeof o.excludeStartLine=="number"&&typeof o.excludeEndLine=="number"&&n>=o.excludeStartLine&&n<=o.excludeEndLine}var ue=I("file-identifiers");function ve(n,o){return ue.get(n,o,()=>new Set(M(n,o).keys()))}var fe=I("file-ident-lines");function M(n,o){return fe.get(n,o,()=>pe(n,o))}var me=I("file-idents-by-line");function U(n,o){return me.get(n,o,()=>{let i=M(n,o),l=0;for(let r of i.values()){let d=r[r.length-1];d!==void 0&&d>l&&(l=d)}let a=new Array(l+1);for(let r=0;r<=l;r+=1)a[r]=new Set;for(let[r,d]of i)for(let t of d)a[t].add(r);return a})}function pe(n,o){let i=new Map,l=(t,c)=>{let s=i.get(t);if(!s){i.set(t,[c]);return}s[s.length-1]!==c&&s.push(c)};if(E(o)){let t=L(n,o);if(t){let c=E(o),s=c==="rust"?new Set(["identifier","type_identifier","field_identifier"]):c==="python"?new Set(["identifier"]):new Set(["identifier","property_identifier","type_identifier"]),f=new Set(["rust","python"]),e=/\{([^{}]*)\}/g,u=/\b([A-Za-z_][\w]*)\b/g,p=m=>{if(s.has(m.type)&&l(m.text,m.startPosition.row),c&&f.has(c)&&m.type==="string_content"){let b=m.startPosition.row;for(let g of m.text.matchAll(e)){let _=g[1]??"";for(let y of _.matchAll(u))y[1]&&l(y[1],b)}}for(let b of m.children)p(b)};return p(t.rootNode),i}}let a=A(n,o);if(!a)return i;let r=T(a).split(/\r?\n/),d=/\b([A-Za-z_$][\w$]*)\b/g;for(let t=0;t<r.length;t+=1){let c=r[t]??"";for(let s of c.matchAll(d))s[1]&&l(s[1],t)}return i}var be=I("file-dep-graph");function Be(n,o){return be.get(n,o??"",()=>{let i=o?`AND d1.relative_path LIKE '%${o}%'`:"",l=n.all(`SELECT DISTINCT
2
2
  d1.relative_path AS from_file,
3
3
  d2.relative_path AS to_file
4
4
  FROM mentions m
@@ -62,4 +62,4 @@ import{a as T,b as H,c as $,e as J}from"./chunk-VQXXSUQF.js";import{c as P}from"
62
62
  JOIN documents d ON c.document_id = d.id
63
63
  WHERE m.role != 1
64
64
  ${n.pathExclusionsFor("d")}`),d=new Map;if(o)for(let t of o)d.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});for(let t of r){if(n.isIgnored(t.relative_path))continue;let c=d.get(t.symbol_id);if(c&&c.docId===t.document_id&&t.chunk_start>=c.startLine&&t.chunk_end<=c.endLine)continue;let s=i.get(t.symbol_id);s||(s=new Set,i.set(t.symbol_id,s)),s.add(t.relative_path)}for(let t of l){if(n.isIgnored(t.relative_path)||E(t.relative_path)!=="rust")continue;let c=G(n,t.relative_path);if(c.size!==0)for(let s of c){let f=a.get(s);if(f)for(let e of f){if(e.file===t.relative_path)continue;let u=i.get(e.symbolId);u||(u=new Set,i.set(e.symbolId,u)),u.add(t.relative_path)}}}return i}export{xe as a,G as b,Re as c,Y as d,ve as e,M as f,Be as g,ze as h,je as i,Ge as j,K as k,q as l,Ve as m};
65
- //# sourceMappingURL=chunk-ID7TO4P6.js.map
65
+ //# sourceMappingURL=chunk-FT4WPAEX.js.map
@@ -1,2 +1,2 @@
1
- import{a as x}from"./chunk-5KWWENJZ.js";import{k}from"./chunk-ID7TO4P6.js";import{e as w,r as v}from"./chunk-QRULHDMO.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-TVJMEDHH.js.map
1
+ import{a as x}from"./chunk-QID23O53.js";import{k}from"./chunk-FT4WPAEX.js";import{e as w,r as v}from"./chunk-QL5MJOVA.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-G6HYVVRV.js.map
@@ -1,4 +1,4 @@
1
- import{a as m}from"./chunk-DX5YEUX4.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-4HCKXL7T.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-DX5YEUX4.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-CH47OLNL.js.map
56
+ //# sourceMappingURL=chunk-GALIM3IE.js.map
@@ -1,4 +1,4 @@
1
- import{a as u}from"./chunk-DX5YEUX4.js";import{p as c}from"./chunk-QRULHDMO.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
1
+ import{a as u}from"./chunk-4HCKXL7T.js";import{p as c}from"./chunk-QL5MJOVA.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-DX5YEUX4.js";import{p as c}from"./chunk-QRULHDMO.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-6QXYWGE5.js.map
10
+ //# sourceMappingURL=chunk-GVVKLMXG.js.map
@@ -1,2 +1,2 @@
1
- import{g as M}from"./chunk-ID7TO4P6.js";function H(o,c={}){let{minSimilarity:e=.5,limit:n=15,scope:r,minChainLength:g=3,maxChainLength:s=8}=c,l=M(o,r),t=R(l,g,s);if(t.length===0)return[];let h=new Map,u=new Map;for(let i of t){let a=new Set;for(let f of i)a.has(f)||(h.set(f,(h.get(f)??0)+1),a.add(f));for(let f=Math.max(0,i.length-2);f<i.length;f++)u.set(i[f],(u.get(i[f])??0)+1)}let P=t.length*.9,q=t.length*.8,x=new Set;for(let[i,a]of h)a>P&&x.add(i);for(let[i,a]of u)a>q&&x.add(i);let E=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let i of h.keys()){let a=i.split("/").pop()??"";E.includes(a)&&x.add(i)}let p=[];for(let i of t){let a=i.filter(f=>!x.has(f));a.length>=2&&p.push({original:i,filtered:a})}if(p.length<2)return[];let b=[];for(let i=0;i<p.length;i++){for(let a=i+1;a<p.length;a++){let f=p[i],m=p[a],F=new Set(f.filtered),S=!1;for(let d of m.filtered)if(F.has(d)){S=!0;break}if(!S)continue;let{distance:C,ops:A}=T(f.filtered,m.filtered),j=Math.max(f.filtered.length,m.filtered.length);if(j===0)continue;let B=1-C/j;if(B<e||C===0)continue;let w=A.filter(d=>d.type==="substitute").map(d=>({index:d.indexA,nodeA:f.filtered[d.indexA],nodeB:m.filtered[d.indexB]}));if(w.length===0||A.filter(d=>d.type==="match").length<2)continue;let N=v(f.original,m.original),O=z(f.original,m.original);b.push({chainA:f.original,chainB:m.original,similarity:B,editDistance:C,divergencePoints:w,commonPrefix:N,commonSuffix:O})}if(b.length>n*10)break}b.sort((i,a)=>Math.abs(a.similarity-i.similarity)>.01?a.similarity-i.similarity:i.divergencePoints.length-a.divergencePoints.length);let y=[];for(let i of b)if(y.some(f=>k(i.chainA,f.chainA)&&k(i.chainB,f.chainB))||y.push(i),y.length>=n)break;return y}function R(o,c,e){let n=[];for(let g of o.keys()){if(n.length>=500)break;D(o,g,[g],new Set([g]),c,e,n,500)}return n}function D(o,c,e,n,r,g,s,l){if(s.length>=l)return;if(e.length>=g){e.length>=r&&s.push([...e]);return}let t=o.get(c);if(!t||t.size===0){e.length>=r&&s.push([...e]);return}let h=!1;for(let u of t)if(!n.has(u)&&(n.add(u),e.push(u),D(o,u,e,n,r,g,s,l),e.pop(),n.delete(u),h=!0,s.length>=l))return;!h&&e.length>=r&&s.push([...e])}function T(o,c){let e=o.length,n=c.length,r=Array.from({length:e+1},()=>Array(n+1).fill(0));for(let t=0;t<=e;t++)r[t][0]=t;for(let t=0;t<=n;t++)r[0][t]=t;for(let t=1;t<=e;t++)for(let h=1;h<=n;h++)o[t-1]===c[h-1]?r[t][h]=r[t-1][h-1]:r[t][h]=1+Math.min(r[t-1][h],r[t][h-1],r[t-1][h-1]);let g=[],s=e,l=n;for(;s>0||l>0;)s>0&&l>0&&o[s-1]===c[l-1]?(g.unshift({type:"match",indexA:s-1,indexB:l-1}),s--,l--):s>0&&l>0&&r[s][l]===r[s-1][l-1]+1?(g.unshift({type:"substitute",indexA:s-1,indexB:l-1}),s--,l--):l>0&&r[s][l]===r[s][l-1]+1?(g.unshift({type:"insert",indexA:s,indexB:l-1}),l--):(g.unshift({type:"delete",indexA:s-1,indexB:l}),s--);return{distance:r[e][n],ops:g}}function v(o,c){let e=[];for(let n=0;n<Math.min(o.length,c.length)&&o[n]===c[n];n++)e.push(o[n]);return e}function z(o,c){let e=[],n=o.length-1,r=c.length-1;for(;n>=0&&r>=0&&o[n]===c[r];)e.unshift(o[n]),n--,r--;return e}function k(o,c){if(o.length>c.length)return!1;let e=c.join("\u2192"),n=o.join("\u2192");return e.includes(n)}export{H as a};
2
- //# sourceMappingURL=chunk-VKYLXCV6.js.map
1
+ import{g as M}from"./chunk-FT4WPAEX.js";function H(o,c={}){let{minSimilarity:e=.5,limit:n=15,scope:r,minChainLength:g=3,maxChainLength:s=8}=c,l=M(o,r),t=R(l,g,s);if(t.length===0)return[];let h=new Map,u=new Map;for(let i of t){let a=new Set;for(let f of i)a.has(f)||(h.set(f,(h.get(f)??0)+1),a.add(f));for(let f=Math.max(0,i.length-2);f<i.length;f++)u.set(i[f],(u.get(i[f])??0)+1)}let P=t.length*.9,q=t.length*.8,x=new Set;for(let[i,a]of h)a>P&&x.add(i);for(let[i,a]of u)a>q&&x.add(i);let E=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let i of h.keys()){let a=i.split("/").pop()??"";E.includes(a)&&x.add(i)}let p=[];for(let i of t){let a=i.filter(f=>!x.has(f));a.length>=2&&p.push({original:i,filtered:a})}if(p.length<2)return[];let b=[];for(let i=0;i<p.length;i++){for(let a=i+1;a<p.length;a++){let f=p[i],m=p[a],F=new Set(f.filtered),S=!1;for(let d of m.filtered)if(F.has(d)){S=!0;break}if(!S)continue;let{distance:C,ops:A}=T(f.filtered,m.filtered),j=Math.max(f.filtered.length,m.filtered.length);if(j===0)continue;let B=1-C/j;if(B<e||C===0)continue;let w=A.filter(d=>d.type==="substitute").map(d=>({index:d.indexA,nodeA:f.filtered[d.indexA],nodeB:m.filtered[d.indexB]}));if(w.length===0||A.filter(d=>d.type==="match").length<2)continue;let N=v(f.original,m.original),O=z(f.original,m.original);b.push({chainA:f.original,chainB:m.original,similarity:B,editDistance:C,divergencePoints:w,commonPrefix:N,commonSuffix:O})}if(b.length>n*10)break}b.sort((i,a)=>Math.abs(a.similarity-i.similarity)>.01?a.similarity-i.similarity:i.divergencePoints.length-a.divergencePoints.length);let y=[];for(let i of b)if(y.some(f=>k(i.chainA,f.chainA)&&k(i.chainB,f.chainB))||y.push(i),y.length>=n)break;return y}function R(o,c,e){let n=[];for(let g of o.keys()){if(n.length>=500)break;D(o,g,[g],new Set([g]),c,e,n,500)}return n}function D(o,c,e,n,r,g,s,l){if(s.length>=l)return;if(e.length>=g){e.length>=r&&s.push([...e]);return}let t=o.get(c);if(!t||t.size===0){e.length>=r&&s.push([...e]);return}let h=!1;for(let u of t)if(!n.has(u)&&(n.add(u),e.push(u),D(o,u,e,n,r,g,s,l),e.pop(),n.delete(u),h=!0,s.length>=l))return;!h&&e.length>=r&&s.push([...e])}function T(o,c){let e=o.length,n=c.length,r=Array.from({length:e+1},()=>Array(n+1).fill(0));for(let t=0;t<=e;t++)r[t][0]=t;for(let t=0;t<=n;t++)r[0][t]=t;for(let t=1;t<=e;t++)for(let h=1;h<=n;h++)o[t-1]===c[h-1]?r[t][h]=r[t-1][h-1]:r[t][h]=1+Math.min(r[t-1][h],r[t][h-1],r[t-1][h-1]);let g=[],s=e,l=n;for(;s>0||l>0;)s>0&&l>0&&o[s-1]===c[l-1]?(g.unshift({type:"match",indexA:s-1,indexB:l-1}),s--,l--):s>0&&l>0&&r[s][l]===r[s-1][l-1]+1?(g.unshift({type:"substitute",indexA:s-1,indexB:l-1}),s--,l--):l>0&&r[s][l]===r[s][l-1]+1?(g.unshift({type:"insert",indexA:s,indexB:l-1}),l--):(g.unshift({type:"delete",indexA:s-1,indexB:l}),s--);return{distance:r[e][n],ops:g}}function v(o,c){let e=[];for(let n=0;n<Math.min(o.length,c.length)&&o[n]===c[n];n++)e.push(o[n]);return e}function z(o,c){let e=[],n=o.length-1,r=c.length-1;for(;n>=0&&r>=0&&o[n]===c[r];)e.unshift(o[n]),n--,r--;return e}function k(o,c){if(o.length>c.length)return!1;let e=c.join("\u2192"),n=o.join("\u2192");return e.includes(n)}export{H as a};
2
+ //# sourceMappingURL=chunk-HVM6SQPQ.js.map
@@ -1,5 +1,5 @@
1
- import{a as u}from"./chunk-QRULHDMO.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
1
+ import{a as u}from"./chunk-QL5MJOVA.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
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-56LPZC3S.js.map
5
+ //# sourceMappingURL=chunk-IDCWMWWP.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-H4IWC7KJ.js";import{p as l}from"./chunk-QRULHDMO.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-EUHHVFTI.js.map
1
+ import{a as n}from"./chunk-MWCN46ZX.js";import{p as l}from"./chunk-QL5MJOVA.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-IJO2HZFL.js.map
@@ -1,4 +1,4 @@
1
- import{a as y,b as A}from"./chunk-F2TGKDMW.js";import{d as C,e as B,f as $,g as W,h as H}from"./chunk-5KWWENJZ.js";import{c as M}from"./chunk-56LPZC3S.js";import{a as w,b as D,c as O,f as k}from"./chunk-ID7TO4P6.js";import{f as T,g as I,q as x,v as N}from"./chunk-QRULHDMO.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
1
+ import{a as y,b as A}from"./chunk-ZZ3F6P3X.js";import{d as C,e as B,f as $,g as W,h as H}from"./chunk-QID23O53.js";import{c as M}from"./chunk-IDCWMWWP.js";import{a as w,b as D,c as O,f as k}from"./chunk-FT4WPAEX.js";import{f as T,g as I,q as x,v as N}from"./chunk-QL5MJOVA.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
2
  m.symbol_id,
3
3
  d.relative_path,
4
4
  COUNT(*) AS ref_count
@@ -9,4 +9,4 @@ import{a as y,b as A}from"./chunk-F2TGKDMW.js";import{d as C,e as B,f as $,g as
9
9
  ${t.pathExclusionsFor("d")}
10
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
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-EARGTC7U.js.map
12
+ //# sourceMappingURL=chunk-INPQVQ6O.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-H4IWC7KJ.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
1
+ import{a as f}from"./chunk-MWCN46ZX.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-HLILTI7S.js.map
3
+ //# sourceMappingURL=chunk-IVT2U2BV.js.map
@@ -1,4 +1,4 @@
1
- import{a as h}from"./chunk-DX5YEUX4.js";import{e as p}from"./chunk-VQXXSUQF.js";import{a as _}from"./chunk-H4IWC7KJ.js";import{b as d,c,g as f}from"./chunk-5IM4IQ6N.js";function v(e,i){return b(e,i)?.map(t=>({symbol:t.symbol,shortName:t.shortName,fromFile:t.fromFile}))??[]}function F(e,i){let a=e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as h}from"./chunk-4HCKXL7T.js";import{e as p}from"./chunk-NKU7Z242.js";import{a as _}from"./chunk-MWCN46ZX.js";import{b as d,c,g as f}from"./chunk-5IM4IQ6N.js";function v(e,i){return b(e,i)?.map(t=>({symbol:t.symbol,shortName:t.shortName,fromFile:t.fromFile}))??[]}function F(e,i){let a=e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -36,4 +36,4 @@ import{a as h}from"./chunk-DX5YEUX4.js";import{e as p}from"./chunk-VQXXSUQF.js";
36
36
  WHERE imp_d.relative_path = ?
37
37
  AND m.role = 2
38
38
  ORDER BY def_d.relative_path, gs.symbol`,t).filter(r=>!e.isIgnored(r.importer));return o.length>0?o.map(r=>({symbol:r.symbol,shortName:d(r.symbol),fromFile:r.from_file??"(external)",importer:r.importer,used:r.used!==0})):p(e,t).map(r=>{let m=I(r.importedName,r.localName,r.kind),u=r.kind==="side-effect"?!0:r.used;return{symbol:m,shortName:m,fromFile:r.sourcePath??"(external)",importer:t,used:u}})}function I(e,i,t){return t==="namespace"&&e==="*"&&i?`* as ${i}`:t==="default"&&i?`default as ${i}`:t==="side-effect"?"(side effect import)":i&&i!==e?`${e} as ${i}`:e}function g(e){return e.replace(/\\/g,"/")}function E(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{v as a,F as b,D as c};
39
- //# sourceMappingURL=chunk-MDUIJELV.js.map
39
+ //# sourceMappingURL=chunk-JSBWVSES.js.map
@@ -1,4 +1,4 @@
1
- import{a as l}from"./chunk-DX5YEUX4.js";import{g as r}from"./chunk-ID7TO4P6.js";import{a as c}from"./chunk-H4IWC7KJ.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
1
+ import{a as l}from"./chunk-4HCKXL7T.js";import{g as r}from"./chunk-FT4WPAEX.js";import{a as c}from"./chunk-MWCN46ZX.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-DX5YEUX4.js";import{g as r}from"./chunk-ID7TO4P6.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-MMKNCPHB.js.map
62
+ //# sourceMappingURL=chunk-LAXFZ3UW.js.map
@@ -0,0 +1,2 @@
1
+ import{b as e}from"./chunk-4HCKXL7T.js";import{s as o}from"./chunk-QL5MJOVA.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-MFVPKCS5.js.map
@@ -1,4 +1,4 @@
1
- import{u as p}from"./chunk-QRULHDMO.js";import{b as N,c as E,f as R,g as I}from"./chunk-5IM4IQ6N.js";function T(e,t){let n=v(e,t.trim());if(n)return n;let i=t.match(/^(.+):(\d+)-(\d+)$/);if(i){let[,c,_,h]=i,u=Math.max(0,parseInt(_,10)-1),f=Math.max(u,parseInt(h,10)-1),m=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
1
+ import{u as p}from"./chunk-QL5MJOVA.js";import{b as N,c as E,f as R,g as I}from"./chunk-5IM4IQ6N.js";function T(e,t){let n=v(e,t.trim());if(n)return n;let i=t.match(/^(.+):(\d+)-(\d+)$/);if(i){let[,c,_,h]=i,u=Math.max(0,parseInt(_,10)-1),f=Math.max(u,parseInt(h,10)-1),m=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -86,4 +86,4 @@ import{u as p}from"./chunk-QRULHDMO.js";import{b as N,c as E,f as R,g as I}from"
86
86
  ${e.pathExclusionsFor("d")}
87
87
  GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name
88
88
  LIMIT 200`,...i)}function D(e,t,n,i){let d=t.trim(),o=n,l=o.replace(/\(\)$/,""),a=t.toLowerCase(),r=n.toLowerCase(),c=r.replace(/\(\)$/,""),_=e.symbol,h=N(e.symbol),u=E(e.symbol),f=e.display_name??"",m=e.symbol.toLowerCase(),y=h.toLowerCase(),S=u.toLowerCase(),O=f.toLowerCase(),g=e.relative_path.toLowerCase(),L=/[/:.]/.test(n),s=0;return(_===d||_===o)&&(s+=1150),(h===d||h===o)&&(s+=1100),f===l&&(s+=980),u===l&&(s+=960),(`${u}()`===d||`${u}()`===o)&&(s+=955),(m===a||m===r)&&(s+=1e3),(y===a||y===r)&&(s+=950),(g===a||g===r)&&(s+=925),(g.endsWith(`/${r}`)||g.endsWith(`/${a}`))&&(s+=875),O===c&&(s+=850),S===c&&(s+=825),(`${S}()`===a||`${S}()`===r)&&(s+=820),(y.endsWith(`:${r}`)||y.endsWith(`:${c}`)||y.endsWith(`:${c}()`))&&(s+=800),m.includes(r)&&(s+=120),y.includes(r)&&(s+=140),g.includes(r)&&(s+=140),O.includes(r)&&(s+=110),i.every(C=>{let b=C.toLowerCase();return m.includes(b)||y.includes(b)||g.includes(b)||O.includes(b)})&&(s+=100+i.length*15),R(e.symbol)&&S===c&&(s+=60),!L&&I(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function M(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function w(e){let t=M(e),n=t.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return n.length>0?[...new Set(n)]:[t]}function x(e,t,n){let i=t.trim(),d=e.filter(o=>{let l=N(o.symbol),a=(o.display_name??"").trim();return o.symbol===i||l===i||l===n||a===i||a===n||`${a}()`===i||o.relative_path===i});return d.length===0?null:(d.sort((o,l)=>o.end_line-o.start_line-(l.end_line-l.start_line)||o.relative_path.localeCompare(l.relative_path)||o.symbol.localeCompare(l.symbol)),d[0]??null)}export{T as a,v as b,W as c};
89
- //# sourceMappingURL=chunk-H4IWC7KJ.js.map
89
+ //# sourceMappingURL=chunk-MWCN46ZX.js.map