scip-query 0.6.2 → 0.6.3

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-6CTMG3IF.js → chunk-2OXZVIED.js} +2 -2
  2. package/dist/{chunk-F6F2QUIH.js → chunk-56LPZC3S.js} +2 -2
  3. package/dist/{chunk-AEMTUHQ7.js → chunk-5KWWENJZ.js} +2 -2
  4. package/dist/chunk-5OV6CUTY.js +2 -0
  5. package/dist/{chunk-PU7P5NPE.js → chunk-6QXYWGE5.js} +2 -2
  6. package/dist/{chunk-3QJ2NOYG.js → chunk-6TRXTRCW.js} +2 -2
  7. package/dist/{chunk-5NRGSXZQ.js → chunk-C6PQLWHR.js} +2 -2
  8. package/dist/{chunk-AZTWY4OT.js → chunk-CH47OLNL.js} +2 -2
  9. package/dist/{chunk-NLWXQMKR.js → chunk-DM56ECPZ.js} +2 -2
  10. package/dist/{chunk-NFOSOUH6.js → chunk-DX5YEUX4.js} +2 -2
  11. package/dist/{chunk-FPDWFGBQ.js → chunk-DXXROCSQ.js} +2 -2
  12. package/dist/{chunk-CW5K3KIF.js → chunk-EARGTC7U.js} +2 -2
  13. package/dist/{chunk-HS65NNKP.js → chunk-EJXPKSWV.js} +2 -2
  14. package/dist/{chunk-CHW7433E.js → chunk-EUHHVFTI.js} +2 -2
  15. package/dist/{chunk-QSTMORTI.js → chunk-F2TGKDMW.js} +2 -2
  16. package/dist/{chunk-MQ5FKM2F.js → chunk-GSVIC6KN.js} +2 -2
  17. package/dist/{chunk-7NEBSLI3.js → chunk-H4IWC7KJ.js} +2 -2
  18. package/dist/{chunk-HS5LX75F.js → chunk-H7BWAMFI.js} +2 -2
  19. package/dist/{chunk-GK6VXKLY.js → chunk-HLILTI7S.js} +2 -2
  20. package/dist/{chunk-5V76WMMZ.js → chunk-HUEIPY4M.js} +2 -2
  21. package/dist/{chunk-3FG3VLK3.js → chunk-ID7TO4P6.js} +2 -2
  22. package/dist/{chunk-67UXTIFZ.js → chunk-IUNRL2AQ.js} +2 -2
  23. package/dist/{chunk-4LBOHXT7.js → chunk-J22I2FWD.js} +2 -2
  24. package/dist/{chunk-7DKDFRXQ.js → chunk-KOGVTPGE.js} +2 -2
  25. package/dist/{chunk-ZJM2HD2Z.js → chunk-LUYN4IWJ.js} +2 -2
  26. package/dist/{chunk-3J463LOK.js → chunk-MDUIJELV.js} +2 -2
  27. package/dist/{chunk-T26XHATT.js → chunk-MMKNCPHB.js} +2 -2
  28. package/dist/{chunk-AZQ3ENHU.js → chunk-MSNW2AR2.js} +2 -2
  29. package/dist/{chunk-YRUHPGC3.js → chunk-NB3GIT4Z.js} +2 -2
  30. package/dist/{chunk-26LSAIEP.js → chunk-OBPP5RRE.js} +2 -2
  31. package/dist/{chunk-TWYHFB5K.js → chunk-ORBQ3HJD.js} +2 -2
  32. package/dist/{chunk-S65VVU3R.js → chunk-Q2MCCKWZ.js} +2 -2
  33. package/dist/{chunk-SPMLGXCE.js → chunk-QRULHDMO.js} +3 -3
  34. package/dist/{chunk-ORD3HEWI.js → chunk-RAJHIEBM.js} +2 -2
  35. package/dist/{chunk-TXADWK4I.js → chunk-RKZBRDFK.js} +2 -2
  36. package/dist/{chunk-3T53QAUS.js → chunk-RPRIZ43D.js} +2 -2
  37. package/dist/{chunk-FJV7QT4G.js → chunk-RXGCTLHY.js} +2 -2
  38. package/dist/{chunk-5VU2RVKI.js → chunk-S6IGA6KK.js} +2 -2
  39. package/dist/{chunk-LKCPNPHH.js → chunk-TPOYTT6O.js} +2 -2
  40. package/dist/{chunk-2HEJQBMS.js → chunk-TRBNQ273.js} +2 -2
  41. package/dist/{chunk-G2SX5EHW.js → chunk-TVJMEDHH.js} +2 -2
  42. package/dist/{chunk-OU2D2T4A.js → chunk-UDKLKBPQ.js} +2 -2
  43. package/dist/{chunk-6ALIV5SZ.js → chunk-UGUBEKK5.js} +2 -2
  44. package/dist/{chunk-AVLUWGXG.js → chunk-VKYLXCV6.js} +2 -2
  45. package/dist/{chunk-6XP3KWHC.js → chunk-VQXXSUQF.js} +2 -2
  46. package/dist/{chunk-5W22HCSF.js → chunk-VZE4SOJG.js} +2 -2
  47. package/dist/{chunk-RC2PKZSS.js → chunk-VZHI3TUX.js} +2 -2
  48. package/dist/{chunk-435YC4OF.js → chunk-YSEQFGGH.js} +2 -2
  49. package/dist/cli.js +2 -2
  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-ZORIMKQO.js +0 -2
@@ -1,4 +1,4 @@
1
- import{h as a,i as c}from"./chunk-3FG3VLK3.js";import{q as d}from"./chunk-SPMLGXCE.js";import{b as l}from"./chunk-5IM4IQ6N.js";function E(e,t={}){let{limit:m=20,scope:s,minFanIn:n=2,minFanOut:f=2}=t,_=s?`AND def_d.relative_path LIKE '%${s}%'`:"",r=e.all(`SELECT * FROM (
1
+ import{h as a,i as c}from"./chunk-ID7TO4P6.js";import{q as d}from"./chunk-QRULHDMO.js";import{b as l}from"./chunk-5IM4IQ6N.js";function E(e,t={}){let{limit:m=20,scope:s,minFanIn:n=2,minFanOut:f=2}=t,_=s?`AND def_d.relative_path LIKE '%${s}%'`:"",r=e.all(`SELECT * FROM (
2
2
  SELECT
3
3
  gs.symbol,
4
4
  def_d.relative_path AS defined_in,
@@ -38,4 +38,4 @@ import{h as a,i as c}from"./chunk-3FG3VLK3.js";import{q as d}from"./chunk-SPMLGX
38
38
  ) WHERE fan_in >= ? AND fan_out >= ?
39
39
  ORDER BY (fan_in * fan_out) DESC
40
40
  LIMIT ?`,n,f,m).filter(o=>!e.isIgnored(o.defined_in)).map(o=>({symbol:o.symbol,shortName:l(o.symbol),fanIn:o.fan_in,fanOut:o.fan_out,score:o.fan_in*o.fan_out,definedIn:o.defined_in}));return r.length>0?r:u(e,s,{minFanIn:n,minFanOut:f,limit:m})}function u(e,t,m){let{minFanIn:s,minFanOut:n,limit:f}=m;return d(e,{scope:t}).filter(i=>!e.isIgnored(i.relativePath)).map(i=>b(e,i)).filter(i=>i.fanIn>=s&&i.fanOut>=n).sort((i,r)=>r.score-i.score||r.fanIn-i.fanIn).slice(0,f)}function b(e,t){let m=new Set(c(e,t,{limit:500}).map(n=>n.file)).size,s=new Set(a(e,t,{limit:500}).filter(n=>n.file!==t.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:t.symbol,shortName:l(t.symbol),fanIn:m,fanOut:s,score:m*s,definedIn:t.relativePath}}export{E as a};
41
- //# sourceMappingURL=chunk-6CTMG3IF.js.map
41
+ //# sourceMappingURL=chunk-2OXZVIED.js.map
@@ -1,5 +1,5 @@
1
- import{a as u}from"./chunk-SPMLGXCE.js";import{readdirSync as l}from"fs";import{extname as d,join as p}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],v=[".vue"],S=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function _(o,i={}){let s=i.includeIndexed??!0,r=i.includeAuxiliary??!0,t=i.extensions?new Set(i.extensions.map(n=>n.toLowerCase())):new Set(x.map(n=>n.toLowerCase())),c=`${s?"1":"0"}|${r?"1":"0"}|${[...t].sort().join(",")}`;return f.get(o,c,()=>{let n=new Set;if(s){let e=o.all(`SELECT relative_path
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
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-F6F2QUIH.js.map
5
+ //# sourceMappingURL=chunk-56LPZC3S.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-F6F2QUIH.js";import{g as p}from"./chunk-3FG3VLK3.js";import{b as f}from"./chunk-SPMLGXCE.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var m=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,m as g,B as h};
2
- //# sourceMappingURL=chunk-AEMTUHQ7.js.map
1
+ import{c as a}from"./chunk-56LPZC3S.js";import{g as p}from"./chunk-ID7TO4P6.js";import{b as f}from"./chunk-QRULHDMO.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var m=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,m as g,B as h};
2
+ //# sourceMappingURL=chunk-5KWWENJZ.js.map
@@ -0,0 +1,2 @@
1
+ import{b as e}from"./chunk-DX5YEUX4.js";import{s as o}from"./chunk-QRULHDMO.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-5OV6CUTY.js.map
@@ -1,4 +1,4 @@
1
- import{a as u}from"./chunk-NFOSOUH6.js";import{p as c}from"./chunk-SPMLGXCE.js";import{b as a}from"./chunk-5IM4IQ6N.js";function _(t,d){let s=u(t,d);if(!s)return null;let n=t.get(`SELECT id, relative_path FROM documents
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
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-NFOSOUH6.js";import{p as c}from"./chunk-SPMLGXCE.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-PU7P5NPE.js.map
10
+ //# sourceMappingURL=chunk-6QXYWGE5.js.map
@@ -1,4 +1,4 @@
1
- import{b as o}from"./chunk-NFOSOUH6.js";import{s as m}from"./chunk-SPMLGXCE.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-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
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-NFOSOUH6.js";import{s as m}from"./chunk-SPMLGXCE.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-3QJ2NOYG.js.map
35
+ //# sourceMappingURL=chunk-6TRXTRCW.js.map
@@ -1,7 +1,7 @@
1
- import{k as g}from"./chunk-3FG3VLK3.js";import{a as b}from"./chunk-7NEBSLI3.js";import{b as m}from"./chunk-5IM4IQ6N.js";import{readFileSync as y}from"fs";import{join as d}from"path";function I(o,i){let t=b(o,i);if(!t)return null;let l=o.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath)?.language??"unknown",s=d(o.config.projectRoot,t.relativePath),n="";try{n=y(s,"utf-8").split(`
1
+ import{k as g}from"./chunk-ID7TO4P6.js";import{a as b}from"./chunk-H4IWC7KJ.js";import{b as m}from"./chunk-5IM4IQ6N.js";import{readFileSync as y}from"fs";import{join as d}from"path";function I(o,i){let t=b(o,i);if(!t)return null;let l=o.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath)?.language??"unknown",s=d(o.config.projectRoot,t.relativePath),n="";try{n=y(s,"utf-8").split(`
2
2
  `).slice(t.startLine,t.endLine+1).join(`
3
3
  `)}catch{}let e=S(n,l),f=t.endLine-t.startLine+1,a=g(o,[t],{additive:!0}).get(t.symbolId)??[],p=new Set(a.map(r=>r.symbol)),u=o.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
5
5
  JOIN chunks c ON m.chunk_id = c.id
6
6
  WHERE m.symbol_id = ? AND m.role != 1`,t.symbolId),h=new Set(a.filter(r=>r.file!==t.relativePath).map(r=>r.symbol)).size;return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:f,branches:e,cyclomaticEstimate:e+1,calleeCount:p.size,fanIn:u?.c??0,fanOut:h}}function S(o,i){let t=P(o),c=0,l=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let s of l){let n=t.match(s);n&&(c+=n.length)}if(i==="python"){let s=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="rust"){let s=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="ruby"){let s=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="go"){let s=[/\bselect\b/g,/\bdefer\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}return c}function P(o){return o.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"").replace(/#.*/g,"").replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/`(?:[^`\\]|\\.)*`/g,"``")}export{I as a};
7
- //# sourceMappingURL=chunk-5NRGSXZQ.js.map
7
+ //# sourceMappingURL=chunk-C6PQLWHR.js.map
@@ -1,4 +1,4 @@
1
- import{a as m}from"./chunk-NFOSOUH6.js";function c(e,n,o){let d=m(e,n)??n,s=m(e,o)??o,t=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
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
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-NFOSOUH6.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-AZTWY4OT.js.map
56
+ //# sourceMappingURL=chunk-CH47OLNL.js.map
@@ -1,2 +1,2 @@
1
- import{c as d}from"./chunk-LORWXBOO.js";import{g as a}from"./chunk-3FG3VLK3.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
- //# sourceMappingURL=chunk-NLWXQMKR.js.map
1
+ import{c as d}from"./chunk-LORWXBOO.js";import{g as a}from"./chunk-ID7TO4P6.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
+ //# sourceMappingURL=chunk-DM56ECPZ.js.map
@@ -1,6 +1,6 @@
1
- import{a as c}from"./chunk-7NEBSLI3.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as f,join as g}from"path";function S(e,r){let t=u(e,r,{allowMultiple:!1})[0]?.relativePath;return t||v(e,r)}function M(e,r){return u(e,r,{allowMultiple:!0}).map(t=>t.relativePath)}function v(e,r){if(!r)return null;let t=r.replace(/\\/g,"/").replace(/^\.\//,""),a=f(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,n=g(e.config.projectRoot,a);return m(n)?a:null}function u(e,r,t){let a=h(r);if(!a)return[];let i=e.all(`SELECT relative_path
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
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-NFOSOUH6.js.map
6
+ //# sourceMappingURL=chunk-DX5YEUX4.js.map
@@ -1,4 +1,4 @@
1
- import{b as v}from"./chunk-QSTMORTI.js";import{a as $}from"./chunk-AEMTUHQ7.js";import{b as y,f as S,g as I}from"./chunk-3FG3VLK3.js";import{e as k}from"./chunk-6XP3KWHC.js";import{f as _}from"./chunk-SPMLGXCE.js";import g from"path";function J(t,r){let{scope:s}=r??{},l=I(t,s),n=O(t,s),c=[];for(let[e,a]of l){if(m(e))continue;let u=n.get(e)??new Set;for(let o of a)if(!m(o)&&!u.has(o)){if(E(o)||R(t,e,o))continue;c.push({file:e,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}let i=D(l);for(let[e,a]of l){if(m(e))continue;let u=h(e);for(let o of a){if(m(o))continue;let f=h(o);if(u===f)continue;i.get(`${u}->${f}`)==="violation"&&c.push({file:e,kind:"layer-violation",description:`Imports from ${f}/ (${o}) \u2014 may cross architectural boundary`,dep:o,detail:`${u}/ should not depend on ${f}/`})}}let p=new Map;for(let e of l.keys()){let a=g.dirname(e);p.has(a)||p.set(a,[]),p.get(a).push(e)}for(let[e,a]of p){let u=a.filter(f=>!m(f));if(u.length<5)continue;let o=new Map;for(let f of u)for(let d of l.get(f)??[])m(d)||o.set(d,(o.get(d)??0)+1);for(let f of u)for(let d of l.get(f)??[])m(d)||(o.get(d)??0)===1&&g.dirname(d)!==e&&g.dirname(d)!==g.dirname(e)&&c.push({file:f,kind:"pattern-deviation",description:`Only file in ${e}/ that depends on ${d}`,dep:d})}return{results:c,unusedImports:c.filter(e=>e.kind==="unused-import").length,layerViolations:c.filter(e=>e.kind==="layer-violation").length,patternDeviations:c.filter(e=>e.kind==="pattern-deviation").length}}function O(t,r){let s=r?`AND d1.relative_path LIKE '%${r}%'`:"",l=t.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
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
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-QSTMORTI.js";import{a as $}from"./chunk-AEMTUHQ7.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-FPDWFGBQ.js.map
19
+ //# sourceMappingURL=chunk-DXXROCSQ.js.map
@@ -1,4 +1,4 @@
1
- import{a as y,b as A}from"./chunk-QSTMORTI.js";import{d as C,e as B,f as $,g as W,h as H}from"./chunk-AEMTUHQ7.js";import{c as M}from"./chunk-F6F2QUIH.js";import{a as w,b as D,c as O,f as k}from"./chunk-3FG3VLK3.js";import{f as T,g as I,q as x,v as N}from"./chunk-SPMLGXCE.js";import{b as L,f as R,g as E,h as P,i as F}from"./chunk-5IM4IQ6N.js";function se(t,a={}){let{scope:p,minLoc:c=1,includeTests:o=!1,skipBarrels:m=!1,includeMembers:s=!1}=a,n=m?new Set(C(t)):new Set,i=t.all(`SELECT
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
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-QSTMORTI.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-CW5K3KIF.js.map
12
+ //# sourceMappingURL=chunk-EARGTC7U.js.map
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-NFOSOUH6.js";import{p as a}from"./chunk-SPMLGXCE.js";import{b as d,e as l}from"./chunk-5IM4IQ6N.js";function u(t,n){let s=m(t,n);if(s.length===0)return[];let i=s.map(()=>"?").join(", "),c=t.all(`SELECT DISTINCT d1.relative_path, gs.symbol
1
+ import{b as m}from"./chunk-DX5YEUX4.js";import{p as a}from"./chunk-QRULHDMO.js";import{b as d,e as l}from"./chunk-5IM4IQ6N.js";function u(t,n){let s=m(t,n);if(s.length===0)return[];let i=s.map(()=>"?").join(", "),c=t.all(`SELECT DISTINCT d1.relative_path, gs.symbol
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -26,4 +26,4 @@ import{b as m}from"./chunk-NFOSOUH6.js";import{p as a}from"./chunk-SPMLGXCE.js";
26
26
  AND ${t.localSymbolPredicate}
27
27
  ${t.pathExclusionsFor("d1")}
28
28
  ORDER BY d1.relative_path`,...s,...s,...s),p=s.flatMap(e=>a(t,e).filter(o=>l(o.symbol)).map(o=>({relative_path:e,symbol:o.symbol}))),r=new Set;return[...c,...p].filter(e=>!t.isIgnored(e.relative_path)).filter(e=>{let o=`${e.relative_path}|${e.symbol}`;return r.has(o)?!1:(r.add(o),!0)}).map(e=>({consumer:e.relative_path,symbol:e.symbol,shortName:d(e.symbol)}))}export{u as a};
29
- //# sourceMappingURL=chunk-HS65NNKP.js.map
29
+ //# sourceMappingURL=chunk-EJXPKSWV.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-7NEBSLI3.js";import{p as l}from"./chunk-SPMLGXCE.js";import{b as m,d as o,j as i}from"./chunk-5IM4IQ6N.js";function f(r,a){let t=n(r,a);return t?l(r,t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>i(t.symbol,e.symbol)).sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine).map(e=>({symbol:e.symbol,shortName:m(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{f as a};
2
- //# sourceMappingURL=chunk-CHW7433E.js.map
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,2 +1,2 @@
1
- import{c as u}from"./chunk-F6F2QUIH.js";import{d as I,e as x,l as p}from"./chunk-3FG3VLK3.js";import{e as R}from"./chunk-6XP3KWHC.js";import{c as h}from"./chunk-7NEBSLI3.js";import{d as b,p as S,t as y}from"./chunk-SPMLGXCE.js";import{c as d}from"./chunk-5IM4IQ6N.js";function g(o,c,n){let e=p(o).get(n);if(!e||e.length===0)return[];if(e.length===1)return[l(e[0])];let i=e.filter(f=>f.file===c);if(i.length>0)return i.map(l);let t=P(o,c),r=t.get(n);if(r)for(let f of r){let s=e.filter(m=>D(f,m.file));if(s.length>0)return s.map(l)}let a=new Set;for(let f of t.values())for(let s of f)a.add(s);for(let f of a){let s=e.filter(m=>D(f,m.file));if(s.length>0&&s.length===e.length)return s.map(l)}return[]}function j(o,c,n){let e=g(o,c,n);if(e.length>0)return e;let i=p(o).get(n);return!i||i.length===0?[]:i.map(l)}function C(o,c){let n=h(o,c);if(!n)return[];let e=d(n.symbol);if(!e)return[];let i=new Map;for(let t of u(o)){let r=b(o,t);if(!r||r.indexOf(e)===-1||t!==n.relativePath&&!g(o,t,e).some(s=>s.symbolId===n.symbolId))continue;let a=I(o,t,e,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});a.length>0&&i.set(t,a)}return w(o,i)}function E(o,c){let n=new Map;for(let t of c){if(!t.leaf)continue;let r=n.get(t.leaf)??[];r.push(t),n.set(t.leaf,r)}if(n.size===0)return new Map;let e=new Set(c.map(t=>t.symbolId)),i=new Map;for(let t of u(o)){let r=x(o,t);if(r.size!==0){for(let a of r)if(n.has(a))for(let f of g(o,t,a)){if(!e.has(f.symbolId)||t===f.relativePath)continue;let s=i.get(f.symbolId);s||(s=new Set,i.set(f.symbolId,s)),s.add(t)}}}return i}function P(o,c){let n=new Map;for(let e of R(o,c)){if(!e.sourcePath)continue;let i=e.localName??e.importedName;if(i){let t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(e.sourcePath)}if(e.kind==="namespace")for(let t of e.usedMembers){let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(e.sourcePath)}}return n}function D(o,c){let n=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return n(o)===n(c)}function l(o){return{symbolId:o.symbolId,symbol:o.symbol,relativePath:o.file}}function w(o,c){let n=[],e=new Set;for(let[i,t]of c){let r=S(o,i);for(let a of t){let f=y(r,a),s=`${i}|${a}|${f?.symbol??""}`;e.has(s)||(e.add(s),n.push({file:i,line:a,enclosingSymbol:f?.symbol??null}))}}return n}export{g as a,j as b,C as c,E as d};
2
- //# sourceMappingURL=chunk-QSTMORTI.js.map
1
+ import{c as u}from"./chunk-56LPZC3S.js";import{d as I,e as x,l as p}from"./chunk-ID7TO4P6.js";import{e as R}from"./chunk-VQXXSUQF.js";import{c as h}from"./chunk-H4IWC7KJ.js";import{d as b,p as S,t as y}from"./chunk-QRULHDMO.js";import{c as d}from"./chunk-5IM4IQ6N.js";function g(o,c,n){let e=p(o).get(n);if(!e||e.length===0)return[];if(e.length===1)return[l(e[0])];let i=e.filter(f=>f.file===c);if(i.length>0)return i.map(l);let t=P(o,c),r=t.get(n);if(r)for(let f of r){let s=e.filter(m=>D(f,m.file));if(s.length>0)return s.map(l)}let a=new Set;for(let f of t.values())for(let s of f)a.add(s);for(let f of a){let s=e.filter(m=>D(f,m.file));if(s.length>0&&s.length===e.length)return s.map(l)}return[]}function j(o,c,n){let e=g(o,c,n);if(e.length>0)return e;let i=p(o).get(n);return!i||i.length===0?[]:i.map(l)}function C(o,c){let n=h(o,c);if(!n)return[];let e=d(n.symbol);if(!e)return[];let i=new Map;for(let t of u(o)){let r=b(o,t);if(!r||r.indexOf(e)===-1||t!==n.relativePath&&!g(o,t,e).some(s=>s.symbolId===n.symbolId))continue;let a=I(o,t,e,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});a.length>0&&i.set(t,a)}return w(o,i)}function E(o,c){let n=new Map;for(let t of c){if(!t.leaf)continue;let r=n.get(t.leaf)??[];r.push(t),n.set(t.leaf,r)}if(n.size===0)return new Map;let e=new Set(c.map(t=>t.symbolId)),i=new Map;for(let t of u(o)){let r=x(o,t);if(r.size!==0){for(let a of r)if(n.has(a))for(let f of g(o,t,a)){if(!e.has(f.symbolId)||t===f.relativePath)continue;let s=i.get(f.symbolId);s||(s=new Set,i.set(f.symbolId,s)),s.add(t)}}}return i}function P(o,c){let n=new Map;for(let e of R(o,c)){if(!e.sourcePath)continue;let i=e.localName??e.importedName;if(i){let t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(e.sourcePath)}if(e.kind==="namespace")for(let t of e.usedMembers){let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(e.sourcePath)}}return n}function D(o,c){let n=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return n(o)===n(c)}function l(o){return{symbolId:o.symbolId,symbol:o.symbol,relativePath:o.file}}function w(o,c){let n=[],e=new Set;for(let[i,t]of c){let r=S(o,i);for(let a of t){let f=y(r,a),s=`${i}|${a}|${f?.symbol??""}`;e.has(s)||(e.add(s),n.push({file:i,line:a,enclosingSymbol:f?.symbol??null}))}}return n}export{g as a,j as b,C as c,E as d};
2
+ //# sourceMappingURL=chunk-F2TGKDMW.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-7NEBSLI3.js";import{p as l}from"./chunk-SPMLGXCE.js";import{c as r,e as a}from"./chunk-5IM4IQ6N.js";import{basename as p}from"path";function M(t,c){let o=m(t,c);if(!o)return[];let s=r(o.symbol),i=l(t,o.relativePath).filter(e=>a(e.symbol)),n=i.filter(e=>e.parentTypeName===s||e.symbol.includes(s));return(n.length>0?n:f(p(o.relativePath))===s?i.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:r(e.symbol)}))}function f(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
- //# sourceMappingURL=chunk-MQ5FKM2F.js.map
1
+ 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,4 +1,4 @@
1
- import{u as p}from"./chunk-SPMLGXCE.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-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
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-SPMLGXCE.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-7NEBSLI3.js.map
89
+ //# sourceMappingURL=chunk-H4IWC7KJ.js.map
@@ -1,4 +1,4 @@
1
- import{c as S}from"./chunk-QSTMORTI.js";import{j as d}from"./chunk-3FG3VLK3.js";import{a as g}from"./chunk-7NEBSLI3.js";import{d as u,n as m,o as f}from"./chunk-SPMLGXCE.js";import{b as s,f as a}from"./chunk-5IM4IQ6N.js";function _(n,o){let e=g(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=f(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=u(n,o);if(!t)return null;let l=t.split(`
1
+ import{c as S}from"./chunk-F2TGKDMW.js";import{j as d}from"./chunk-ID7TO4P6.js";import{a as g}from"./chunk-H4IWC7KJ.js";import{d as u,n as m,o as f}from"./chunk-QRULHDMO.js";import{b as s,f as a}from"./chunk-5IM4IQ6N.js";function _(n,o){let e=g(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=f(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=u(n,o);if(!t)return null;let l=t.split(`
2
2
  `).slice(e,i+1).join(`
3
3
  `).trimEnd();return l.length>0?l:null}function b(n,o,e){let i=m(n);if(i&&!h(i))return i;let t=(o??"").trim();return t?a(e)&&!t.endsWith("()")?`${t}()`:t:s(e)}function h(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{_ as a};
4
- //# sourceMappingURL=chunk-HS5LX75F.js.map
4
+ //# sourceMappingURL=chunk-H7BWAMFI.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-7NEBSLI3.js";import{a as g,b as m}from"./chunk-5IM4IQ6N.js";function S(n,d){let c=f(n,d);if(!c)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
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
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-GK6VXKLY.js.map
3
+ //# sourceMappingURL=chunk-HLILTI7S.js.map
@@ -1,5 +1,5 @@
1
- import{d as T}from"./chunk-QSTMORTI.js";import{m as I}from"./chunk-3FG3VLK3.js";import{d as k}from"./chunk-6XP3KWHC.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-SPMLGXCE.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-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(`
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-5V76WMMZ.js.map
5
+ //# sourceMappingURL=chunk-HUEIPY4M.js.map
@@ -1,4 +1,4 @@
1
- import{a as T,b as H,c as $,e as J}from"./chunk-6XP3KWHC.js";import{c as P}from"./chunk-7NEBSLI3.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-SPMLGXCE.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-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
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-6XP3KWHC.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-3FG3VLK3.js.map
65
+ //# sourceMappingURL=chunk-ID7TO4P6.js.map
@@ -1,2 +1,2 @@
1
- import{g as y}from"./chunk-3FG3VLK3.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-67UXTIFZ.js.map
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,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-AEMTUHQ7.js";import{h as T,k as j}from"./chunk-3FG3VLK3.js";import{a as A}from"./chunk-7NEBSLI3.js";import{d as D,e as L,l as z,q as $,r as B}from"./chunk-SPMLGXCE.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-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(`
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-4LBOHXT7.js.map
6
+ //# sourceMappingURL=chunk-J22I2FWD.js.map
@@ -1,7 +1,7 @@
1
- import{c as m}from"./chunk-QSTMORTI.js";import{j as g}from"./chunk-3FG3VLK3.js";import{a as R}from"./chunk-7NEBSLI3.js";import{d as h}from"./chunk-SPMLGXCE.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-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
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-7DKDFRXQ.js.map
7
+ //# sourceMappingURL=chunk-KOGVTPGE.js.map
@@ -1,2 +1,2 @@
1
- import{a as W}from"./chunk-YRUHPGC3.js";import{b as I}from"./chunk-4LBOHXT7.js";import{a as q}from"./chunk-5V76WMMZ.js";import{a as j}from"./chunk-N3Z2SJCR.js";import{a as B}from"./chunk-AZQ3ENHU.js";import{a as E}from"./chunk-TWYHFB5K.js";import{a as z}from"./chunk-FPDWFGBQ.js";import{a as V}from"./chunk-G2SX5EHW.js";import{a as A}from"./chunk-435YC4OF.js";import{a as k}from"./chunk-CW5K3KIF.js";import{a as F}from"./chunk-S65VVU3R.js";import{e as y,f as R}from"./chunk-AEMTUHQ7.js";function ht(e,N={}){let{scope:n}=N,c=j(e),T=k(e,{scope:n,minLoc:3,skipBarrels:!0}),w=B(e,{scope:n,minLoc:3}),P=A(e,{scope:n}),U=I(e,{scope:n,minSimilarity:.6,limit:50,minCallees:4}),m=V(e,{scope:n,minLoc:15,minCallees:5,limit:50}),l=W(e,{scope:n,maxLoc:15,limit:50}),a=E(e,{scope:n,maxLoc:15,limit:50}),x=q(e,{scope:n,minLoc:3,limit:50}),s=z(e,{scope:n}),C=F(e,{scope:n,minLoc:10,limit:10}),S=T.symbols.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)&&t.kind==="dead-code"),u=S.length,$=S.reduce((t,o)=>t+o.loc,0),h=w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).length,p=x.length,v=s.unusedImports+s.layerViolations,d=U.length,r=[];u>0&&r.push({category:"Dead code",description:`${u} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:u,locRecoverable:$}),h>0&&r.push({category:"Isolated symbols",description:`${h} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:h,locRecoverable:w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).reduce((t,o)=>t+o.loc,0)});let b=P.filter(t=>t.kind==="real");if(b.length>0&&r.push({category:"Circular dependencies",description:`${b.length} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:b.length,locRecoverable:0}),d>0&&r.push({category:"Similar functions",description:`${d} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:d,locRecoverable:0}),m.length>0&&r.push({category:"Extraction candidates",description:`${m.length} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:m.length,locRecoverable:0}),l.length>0&&r.push({category:"Wrapper functions",description:`${l.length} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:l.length,locRecoverable:l.reduce((t,o)=>t+o.loc,0)}),a.length>0&&r.push({category:"Passthrough functions",description:`${a.length} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:a.length,locRecoverable:a.reduce((t,o)=>t+o.loc,0)}),p>0){let t=x.filter(M=>M.consumers===0).length,o=p-t,g=[];t>0&&g.push(`${t} unused`),o>0&&g.push(`${o} single-consumer (not in types file)`),r.push({category:"Stale abstractions",description:`${g.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:p,locRecoverable:x.reduce((M,_)=>M+_.loc,0)})}if(v>0||s.patternDeviations>0){let t=[];s.unusedImports>0&&t.push(`${s.unusedImports} unused imports`),s.layerViolations>0&&t.push(`${s.layerViolations} layer violations`),s.patternDeviations>0&&t.push(`${s.patternDeviations} unique deps`),r.push({category:"Structural drift",description:t.join(", "),effort:s.layerViolations>0?"medium":"low",impact:s.layerViolations>0?"medium":"low",count:v,locRecoverable:0})}let D={high:3,medium:2,low:1},L={low:3,medium:2,high:1};r.sort((t,o)=>{let g=D[t.impact]*L[t.effort];return D[o.impact]*L[o.effort]-g});let G=Math.max(c.documents,1),f=Math.max(c.symbols,1),i=100,J=u/f;i-=Math.min(20,Math.round(J*200));let K=h/f;i-=Math.min(10,Math.round(K*200));let H=P.filter(t=>t.kind==="real").length;i-=Math.min(15,H*5);let O=d/f*1e3;i-=Math.min(10,Math.round(O));let Q=m.length/f*1e3;i-=Math.min(5,Math.round(Q/2)),i-=Math.min(3,l.length),i-=Math.min(3,a.length);let X=p/Math.max(f*.1,1);i-=Math.min(8,Math.round(X*10));let Y=v/G;i-=Math.min(5,Math.round(Y*50));let Z=C.filter(t=>t.score>50).length;return i-=Math.min(5,Z*2),i=Math.max(0,Math.min(100,i)),{score:i,overview:{documents:c.documents,symbols:c.symbols,indexSizeBytes:c.indexSizeBytes},findings:{deadSymbols:u,deadLoc:$,isolatedSymbols:h,isolatedLoc:w.filter(t=>!y(e,t.relativePath)).reduce((t,o)=>t+o.loc,0),cycles:H,similarPairs:d,extractionCandidates:m.length,wrappers:l.length,passthroughs:a.length,staleTypes:p,driftedFiles:v,complexityHotspotCount:C.length},actions:r,topComplexity:C.slice(0,5).map(t=>({symbol:t.shortName,score:t.score}))}}export{ht as a};
2
- //# sourceMappingURL=chunk-ZJM2HD2Z.js.map
1
+ import{a as W}from"./chunk-NB3GIT4Z.js";import{b as I}from"./chunk-J22I2FWD.js";import{a as q}from"./chunk-HUEIPY4M.js";import{a as j}from"./chunk-N3Z2SJCR.js";import{a as B}from"./chunk-MSNW2AR2.js";import{a as E}from"./chunk-ORBQ3HJD.js";import{a as z}from"./chunk-DXXROCSQ.js";import{a as V}from"./chunk-TVJMEDHH.js";import{a as A}from"./chunk-YSEQFGGH.js";import{a as k}from"./chunk-EARGTC7U.js";import{a as F}from"./chunk-Q2MCCKWZ.js";import{e as y,f as R}from"./chunk-5KWWENJZ.js";function ht(e,N={}){let{scope:n}=N,c=j(e),T=k(e,{scope:n,minLoc:3,skipBarrels:!0}),w=B(e,{scope:n,minLoc:3}),P=A(e,{scope:n}),U=I(e,{scope:n,minSimilarity:.6,limit:50,minCallees:4}),m=V(e,{scope:n,minLoc:15,minCallees:5,limit:50}),l=W(e,{scope:n,maxLoc:15,limit:50}),a=E(e,{scope:n,maxLoc:15,limit:50}),x=q(e,{scope:n,minLoc:3,limit:50}),s=z(e,{scope:n}),C=F(e,{scope:n,minLoc:10,limit:10}),S=T.symbols.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)&&t.kind==="dead-code"),u=S.length,$=S.reduce((t,o)=>t+o.loc,0),h=w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).length,p=x.length,v=s.unusedImports+s.layerViolations,d=U.length,r=[];u>0&&r.push({category:"Dead code",description:`${u} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:u,locRecoverable:$}),h>0&&r.push({category:"Isolated symbols",description:`${h} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:h,locRecoverable:w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).reduce((t,o)=>t+o.loc,0)});let b=P.filter(t=>t.kind==="real");if(b.length>0&&r.push({category:"Circular dependencies",description:`${b.length} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:b.length,locRecoverable:0}),d>0&&r.push({category:"Similar functions",description:`${d} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:d,locRecoverable:0}),m.length>0&&r.push({category:"Extraction candidates",description:`${m.length} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:m.length,locRecoverable:0}),l.length>0&&r.push({category:"Wrapper functions",description:`${l.length} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:l.length,locRecoverable:l.reduce((t,o)=>t+o.loc,0)}),a.length>0&&r.push({category:"Passthrough functions",description:`${a.length} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:a.length,locRecoverable:a.reduce((t,o)=>t+o.loc,0)}),p>0){let t=x.filter(M=>M.consumers===0).length,o=p-t,g=[];t>0&&g.push(`${t} unused`),o>0&&g.push(`${o} single-consumer (not in types file)`),r.push({category:"Stale abstractions",description:`${g.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:p,locRecoverable:x.reduce((M,_)=>M+_.loc,0)})}if(v>0||s.patternDeviations>0){let t=[];s.unusedImports>0&&t.push(`${s.unusedImports} unused imports`),s.layerViolations>0&&t.push(`${s.layerViolations} layer violations`),s.patternDeviations>0&&t.push(`${s.patternDeviations} unique deps`),r.push({category:"Structural drift",description:t.join(", "),effort:s.layerViolations>0?"medium":"low",impact:s.layerViolations>0?"medium":"low",count:v,locRecoverable:0})}let D={high:3,medium:2,low:1},L={low:3,medium:2,high:1};r.sort((t,o)=>{let g=D[t.impact]*L[t.effort];return D[o.impact]*L[o.effort]-g});let G=Math.max(c.documents,1),f=Math.max(c.symbols,1),i=100,J=u/f;i-=Math.min(20,Math.round(J*200));let K=h/f;i-=Math.min(10,Math.round(K*200));let H=P.filter(t=>t.kind==="real").length;i-=Math.min(15,H*5);let O=d/f*1e3;i-=Math.min(10,Math.round(O));let Q=m.length/f*1e3;i-=Math.min(5,Math.round(Q/2)),i-=Math.min(3,l.length),i-=Math.min(3,a.length);let X=p/Math.max(f*.1,1);i-=Math.min(8,Math.round(X*10));let Y=v/G;i-=Math.min(5,Math.round(Y*50));let Z=C.filter(t=>t.score>50).length;return i-=Math.min(5,Z*2),i=Math.max(0,Math.min(100,i)),{score:i,overview:{documents:c.documents,symbols:c.symbols,indexSizeBytes:c.indexSizeBytes},findings:{deadSymbols:u,deadLoc:$,isolatedSymbols:h,isolatedLoc:w.filter(t=>!y(e,t.relativePath)).reduce((t,o)=>t+o.loc,0),cycles:H,similarPairs:d,extractionCandidates:m.length,wrappers:l.length,passthroughs:a.length,staleTypes:p,driftedFiles:v,complexityHotspotCount:C.length},actions:r,topComplexity:C.slice(0,5).map(t=>({symbol:t.shortName,score:t.score}))}}export{ht as a};
2
+ //# sourceMappingURL=chunk-LUYN4IWJ.js.map
@@ -1,4 +1,4 @@
1
- import{a as h}from"./chunk-NFOSOUH6.js";import{e as p}from"./chunk-6XP3KWHC.js";import{a as _}from"./chunk-7NEBSLI3.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-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
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-NFOSOUH6.js";import{e as p}from"./chunk-6XP3KWHC.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-3J463LOK.js.map
39
+ //# sourceMappingURL=chunk-MDUIJELV.js.map
@@ -1,4 +1,4 @@
1
- import{a as l}from"./chunk-NFOSOUH6.js";import{g as r}from"./chunk-3FG3VLK3.js";import{a as c}from"./chunk-7NEBSLI3.js";import{b as d}from"./chunk-5IM4IQ6N.js";function f(e,t){let o=c(e,t);if(!o)return[];let i=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
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
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-NFOSOUH6.js";import{g as r}from"./chunk-3FG3VLK3.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-T26XHATT.js.map
62
+ //# sourceMappingURL=chunk-MMKNCPHB.js.map
@@ -1,2 +1,2 @@
1
- import{d as L}from"./chunk-QSTMORTI.js";import{e as h}from"./chunk-AEMTUHQ7.js";import{b as y,k as d,m as b}from"./chunk-3FG3VLK3.js";import{f,r as u}from"./chunk-SPMLGXCE.js";import{b as i,c as m,h as c,i as p}from"./chunk-5IM4IQ6N.js";function x(s,v={}){let{scope:I,minLoc:S=3}=v,o=u(s,I).filter(e=>!s.isIgnored(e.relativePath)).filter(e=>!h(s,e.relativePath)).filter(e=>e.isFunctionLike).filter(e=>!c(e.symbol)).filter(e=>!p(e.symbol)).filter(e=>e.endLine-e.startLine+1>=S),C=b(s,o),M=L(s,o),n=new Set([...C.keys(),...M.keys()]),l=new Map;for(let e of o){let t=m(e.symbol);if(!t)continue;let a=l.get(t)??[];a.push(e.symbolId),l.set(t,a)}let g=s.all(`SELECT relative_path FROM documents WHERE 1 = 1 ${s.pathExclusionsFor("documents")}`);for(let e of g){if(s.isIgnored(e.relative_path)||f(e.relative_path)!=="rust")continue;let t=y(s,e.relative_path);for(let a of t){let r=l.get(a);if(r)for(let F of r)n.add(F)}}let R=new Map(o.map(e=>[e.symbolId,e.symbol])),k=d(s,o,{additive:!0}),E=new Set([...k.entries()].filter(([e,t])=>{let a=R.get(e);return t.some(r=>r.symbol!==a)}).map(([e])=>e));return o.filter(e=>!n.has(e.symbolId)).filter(e=>!E.has(e.symbolId)).sort((e,t)=>t.endLine-t.startLine-(e.endLine-e.startLine)||e.relativePath.localeCompare(t.relativePath)||e.startLine-t.startLine).map(e=>({symbol:e.symbol,shortName:i(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1}))}export{x as a};
2
- //# sourceMappingURL=chunk-AZQ3ENHU.js.map
1
+ import{d as L}from"./chunk-F2TGKDMW.js";import{e as h}from"./chunk-5KWWENJZ.js";import{b as y,k as d,m as b}from"./chunk-ID7TO4P6.js";import{f,r as u}from"./chunk-QRULHDMO.js";import{b as i,c as m,h as c,i as p}from"./chunk-5IM4IQ6N.js";function x(s,v={}){let{scope:I,minLoc:S=3}=v,o=u(s,I).filter(e=>!s.isIgnored(e.relativePath)).filter(e=>!h(s,e.relativePath)).filter(e=>e.isFunctionLike).filter(e=>!c(e.symbol)).filter(e=>!p(e.symbol)).filter(e=>e.endLine-e.startLine+1>=S),C=b(s,o),M=L(s,o),n=new Set([...C.keys(),...M.keys()]),l=new Map;for(let e of o){let t=m(e.symbol);if(!t)continue;let a=l.get(t)??[];a.push(e.symbolId),l.set(t,a)}let g=s.all(`SELECT relative_path FROM documents WHERE 1 = 1 ${s.pathExclusionsFor("documents")}`);for(let e of g){if(s.isIgnored(e.relative_path)||f(e.relative_path)!=="rust")continue;let t=y(s,e.relative_path);for(let a of t){let r=l.get(a);if(r)for(let F of r)n.add(F)}}let R=new Map(o.map(e=>[e.symbolId,e.symbol])),k=d(s,o,{additive:!0}),E=new Set([...k.entries()].filter(([e,t])=>{let a=R.get(e);return t.some(r=>r.symbol!==a)}).map(([e])=>e));return o.filter(e=>!n.has(e.symbolId)).filter(e=>!E.has(e.symbolId)).sort((e,t)=>t.endLine-t.startLine-(e.endLine-e.startLine)||e.relativePath.localeCompare(t.relativePath)||e.startLine-t.startLine).map(e=>({symbol:e.symbol,shortName:i(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1}))}export{x as a};
2
+ //# sourceMappingURL=chunk-MSNW2AR2.js.map
@@ -1,7 +1,7 @@
1
- import{d as x}from"./chunk-QSTMORTI.js";import{a as w}from"./chunk-AEMTUHQ7.js";import{f as k,g as P,m as R}from"./chunk-3FG3VLK3.js";import{e as D,p as v,r as _,t as N}from"./chunk-SPMLGXCE.js";import{b as S,c as C,f as M,i as h}from"./chunk-5IM4IQ6N.js";import{basename as p,extname as g}from"path";function Z(e,t){let{scope:i,maxLoc:n=15,limit:s=30}=t??{},o=H(P(e,i)),l=j(e,i,n),c=G(R(e,l),x(e,l)),y=[];for(let r of l){if(D(e,r.relativePath,r.startLine))continue;let b=p(r.relativePath,g(r.relativePath)),L=[...c.get(r.symbolId)??[]].filter(m=>m!==r.relativePath).filter(m=>p(m,g(m))!==b).filter(m=>{let u=w(m);return u!=="barrel"&&u!=="entry"&&u!=="test"});if(L.length!==1)continue;let f=L[0],F=e.get(`SELECT c.start_line, c.end_line
1
+ import{d as x}from"./chunk-F2TGKDMW.js";import{a as w}from"./chunk-5KWWENJZ.js";import{f as k,g as P,m as R}from"./chunk-ID7TO4P6.js";import{e as D,p as v,r as _,t as N}from"./chunk-QRULHDMO.js";import{b as S,c as C,f as M,i as h}from"./chunk-5IM4IQ6N.js";import{basename as p,extname as g}from"path";function Z(e,t){let{scope:i,maxLoc:n=15,limit:s=30}=t??{},o=H(P(e,i)),l=j(e,i,n),c=G(R(e,l),x(e,l)),y=[];for(let r of l){if(D(e,r.relativePath,r.startLine))continue;let b=p(r.relativePath,g(r.relativePath)),L=[...c.get(r.symbolId)??[]].filter(m=>m!==r.relativePath).filter(m=>p(m,g(m))!==b).filter(m=>{let u=w(m);return u!=="barrel"&&u!=="entry"&&u!=="test"});if(L.length!==1)continue;let f=L[0],F=e.get(`SELECT c.start_line, c.end_line
2
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
5
5
  WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
6
  LIMIT 1`,r.symbolId,f);if(!F)continue;let O=v(e,f),T=J(e,f,r.symbol,F.start_line,F.end_line),a=N(O,T);if(a&&h(a.symbol))continue;let d,W=a?.symbol??"",A=a?.isFunctionLike?S(a.symbol):p(f);if(a?.isFunctionLike&&a.symbolId!==r.symbolId){let m=[...c.get(a.symbolId)??[]].filter(u=>u!==a.relativePath);d=m.length>0?m.length:E(o,f)}else d=E(o,f);d<=3||y.push({symbol:r.symbol,shortName:S(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:I(r),singleCaller:W,singleCallerShort:A,callerFanIn:d})}return y.sort((r,b)=>b.callerFanIn-r.callerFanIn||b.loc-r.loc),y.slice(0,s)}function I(e){return e.endLine-e.startLine+1}function j(e,t,i){return _(e,t).filter(n=>!e.isIgnored(n.relativePath)).filter(n=>M(n.symbol)).filter(n=>!h(n.symbol)).filter(n=>I(n)<=i&&I(n)>=2)}function J(e,t,i,n,s){let o=C(i);if(!o)return n;let l=k(e,t).get(o);if(!l||l.length===0)return n;for(let c of l)if(c>=n&&c<=s)return c;return n}function G(...e){let t=new Map;for(let i of e)for(let[n,s]of i){let o=t.get(n);o||(o=new Set,t.set(n,o));for(let l of s)o.add(l)}return t}function H(e){let t=new Map;for(let[i,n]of e){t.has(i)||t.set(i,t.get(i)??0);for(let s of n)t.set(s,(t.get(s)??0)+1)}return t}function E(e,t){let i=e.get(t)??0;if(i>0)return i;let n=p(t,g(t)),s=0;for(let[o,l]of e)o!==t&&p(o,g(o))===n&&l>s&&(s=l);return s}export{Z as a};
7
- //# sourceMappingURL=chunk-YRUHPGC3.js.map
7
+ //# sourceMappingURL=chunk-NB3GIT4Z.js.map
@@ -1,2 +1,2 @@
1
- import{h as n,i as a}from"./chunk-3FG3VLK3.js";import{a as i}from"./chunk-7NEBSLI3.js";import{b as m}from"./chunk-5IM4IQ6N.js";function b(s,e){let o=i(s,e);if(!o)return null;let t=a(s,o,{limit:50}),r=y(n(s,o,{limit:50}));return{symbol:o.symbol,shortName:m(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file}))}}function y(s){let e=new Set,o=[];for(let t of s){let r=`${t.symbol}|${t.file}`;e.has(r)||(e.add(r),o.push(t))}return o}export{b as a};
2
- //# sourceMappingURL=chunk-26LSAIEP.js.map
1
+ import{h as n,i as a}from"./chunk-ID7TO4P6.js";import{a as i}from"./chunk-H4IWC7KJ.js";import{b as m}from"./chunk-5IM4IQ6N.js";function b(s,e){let o=i(s,e);if(!o)return null;let t=a(s,o,{limit:50}),r=y(n(s,o,{limit:50}));return{symbol:o.symbol,shortName:m(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file}))}}function y(s){let e=new Set,o=[];for(let t of s){let r=`${t.symbol}|${t.file}`;e.has(r)||(e.add(r),o.push(t))}return o}export{b as a};
2
+ //# sourceMappingURL=chunk-OBPP5RRE.js.map
@@ -1,2 +1,2 @@
1
- import{k as x}from"./chunk-3FG3VLK3.js";import{e as C,f as S,h as L,r as _}from"./chunk-SPMLGXCE.js";import{b as y,f as d,h as g,i as b}from"./chunk-5IM4IQ6N.js";function P(i,r,a,t){let s=S(r);if(!s)return!0;let n=L(i,r);if(!n)return!0;let l=w.get(n);return l||(l=T(n,s),w.set(n,l)),l.get(`${a}:${t}`)??!0}var w=new WeakMap;function T(i,r){let a=r==="rust"?new Set(["function_item","function_signature_item"]):r==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,s=n=>{a.has(n.type)&&t.set(`${n.startPosition.row}:${n.endPosition.row}`,N(n,r));for(let l of n.children)s(l)};return s(i.rootNode),t}function N(i,r){let a=i.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!a)return!1;let t=a.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(t.length!==1)return!1;let s=t[0],n=null;if(s.type==="return_statement"||s.type==="expression_statement"?n=s.namedChild(0)??null:r==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(n=s),!n)return!1;let l=r==="python"?"call":"call_expression";if(n.type!==l)return!1;let c=n.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!c)return!1;let o=c.namedChildren.filter(e=>e.type!=="comment"),f=i.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!f)return!1;let p=[];for(let e of f.namedChildren)if(e.type==="identifier")p.push(e.text);else{let m=e.namedChildren.find(u=>u.type==="identifier");m&&p.push(m.text)}if(o.length!==p.length)return!1;for(let e=0;e<p.length;e+=1){let m=o[e];if(m.type!=="identifier"||m.text!==p[e])return!1}return!0}function j(i,r){let{scope:a,maxLoc:t=15,limit:s=30}=r??{},n=D(i,a,t),l=x(i,n),c=[];for(let o of n){if(C(i,o.relativePath,o.startLine))continue;let f=l.get(o.symbolId)??[],p=f.some(u=>d(u.symbol))?f.filter(u=>d(u.symbol)):f,e=new Map;for(let u of p)e.has(u.symbol)||e.set(u.symbol,u);if(e.size!==1||!P(i,o.relativePath,o.startLine,o.endLine))continue;let[,m]=[...e.entries()][0];c.push({symbol:o.symbol,shortName:y(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:h(o),forwardsTo:m.symbol,forwardsToShort:y(m.symbol),forwardsToFile:m.file})}return c.sort((o,f)=>o.loc-f.loc||o.file.localeCompare(f.file)),c.slice(0,s)}function D(i,r,a){return _(i,r).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>d(t.symbol)).filter(t=>!g(t.symbol)).filter(t=>!b(t.symbol)).filter(t=>h(t)>=3&&h(t)<=a)}function h(i){return i.endLine-i.startLine+1}export{j as a};
2
- //# sourceMappingURL=chunk-TWYHFB5K.js.map
1
+ import{k as x}from"./chunk-ID7TO4P6.js";import{e as C,f as S,h as L,r as _}from"./chunk-QRULHDMO.js";import{b as y,f as d,h as g,i as b}from"./chunk-5IM4IQ6N.js";function P(i,r,a,t){let s=S(r);if(!s)return!0;let n=L(i,r);if(!n)return!0;let l=w.get(n);return l||(l=T(n,s),w.set(n,l)),l.get(`${a}:${t}`)??!0}var w=new WeakMap;function T(i,r){let a=r==="rust"?new Set(["function_item","function_signature_item"]):r==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,s=n=>{a.has(n.type)&&t.set(`${n.startPosition.row}:${n.endPosition.row}`,N(n,r));for(let l of n.children)s(l)};return s(i.rootNode),t}function N(i,r){let a=i.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!a)return!1;let t=a.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(t.length!==1)return!1;let s=t[0],n=null;if(s.type==="return_statement"||s.type==="expression_statement"?n=s.namedChild(0)??null:r==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(n=s),!n)return!1;let l=r==="python"?"call":"call_expression";if(n.type!==l)return!1;let c=n.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!c)return!1;let o=c.namedChildren.filter(e=>e.type!=="comment"),f=i.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!f)return!1;let p=[];for(let e of f.namedChildren)if(e.type==="identifier")p.push(e.text);else{let m=e.namedChildren.find(u=>u.type==="identifier");m&&p.push(m.text)}if(o.length!==p.length)return!1;for(let e=0;e<p.length;e+=1){let m=o[e];if(m.type!=="identifier"||m.text!==p[e])return!1}return!0}function j(i,r){let{scope:a,maxLoc:t=15,limit:s=30}=r??{},n=D(i,a,t),l=x(i,n),c=[];for(let o of n){if(C(i,o.relativePath,o.startLine))continue;let f=l.get(o.symbolId)??[],p=f.some(u=>d(u.symbol))?f.filter(u=>d(u.symbol)):f,e=new Map;for(let u of p)e.has(u.symbol)||e.set(u.symbol,u);if(e.size!==1||!P(i,o.relativePath,o.startLine,o.endLine))continue;let[,m]=[...e.entries()][0];c.push({symbol:o.symbol,shortName:y(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:h(o),forwardsTo:m.symbol,forwardsToShort:y(m.symbol),forwardsToFile:m.file})}return c.sort((o,f)=>o.loc-f.loc||o.file.localeCompare(f.file)),c.slice(0,s)}function D(i,r,a){return _(i,r).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>d(t.symbol)).filter(t=>!g(t.symbol)).filter(t=>!b(t.symbol)).filter(t=>h(t)>=3&&h(t)<=a)}function h(i){return i.endLine-i.startLine+1}export{j as a};
2
+ //# sourceMappingURL=chunk-ORBQ3HJD.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-AEMTUHQ7.js";import{k as b,m as f}from"./chunk-3FG3VLK3.js";import{r as u}from"./chunk-SPMLGXCE.js";import{b as n,e as c,i as y}from"./chunk-5IM4IQ6N.js";function R(o,r){let{scope:s,minLoc:t=10,limit:M=30}=r??{},{definitions:d,callerMap:S,calleeMap:L}=g(o,s);return d.map(e=>{let a=e.endLine-e.startLine+1,i=S.get(e.symbolId)?.size??0,p=L.get(e.symbolId)??[],h=p.filter(l=>l.file!==e.relativePath),m=new Set(h.map(l=>`${l.symbol}|${l.file}`)).size,x=new Set(p.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:n(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:a,fanIn:i,fanOut:m,calleeCount:x,score:Math.round(a/50*(i/5)*Math.max(m/5,1)*100)/100}}).filter(e=>e.loc>=t).sort((e,a)=>a.score-e.score||a.loc-e.loc).slice(0,M)}function g(o,r){let s=u(o,r).filter(t=>c(t.symbol)&&!o.isIgnored(t.relativePath)).filter(t=>C(t.relativePath)!=="test").filter(t=>!y(t.symbol));return{definitions:s,callerMap:f(o,s),calleeMap:b(o,s)}}export{R as a};
2
- //# sourceMappingURL=chunk-S65VVU3R.js.map
1
+ 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