scip-query 0.10.8 → 0.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/README.md +3 -1
  2. package/dist/{chunk-E2CCBFLR.js → chunk-2UYQLFVC.js} +2 -2
  3. package/dist/chunk-2VM46FC5.js +8 -0
  4. package/dist/{chunk-24S6MYOC.js → chunk-3DGD6NKW.js} +2 -2
  5. package/dist/chunk-3Q77KKEY.js +2 -0
  6. package/dist/chunk-3VD3JMK2.js +2 -0
  7. package/dist/{chunk-RSKOYTSY.js → chunk-4KTOV4QN.js} +2 -2
  8. package/dist/chunk-4N4WONI4.js +102 -0
  9. package/dist/{chunk-EBIQY3RK.js → chunk-56P7PDST.js} +2 -2
  10. package/dist/{chunk-BWL2ECGQ.js → chunk-5NVUWIAN.js} +2 -2
  11. package/dist/{chunk-BEUQVBE3.js → chunk-5VG7RKEF.js} +2 -2
  12. package/dist/{chunk-C6BYNIH4.js → chunk-65AU3HFZ.js} +2 -2
  13. package/dist/{chunk-NWFSC356.js → chunk-6LNQOOTB.js} +2 -2
  14. package/dist/{chunk-6TDOT7B3.js → chunk-72KY2ZFO.js} +2 -2
  15. package/dist/{chunk-7KJBH4IP.js → chunk-736BLPHR.js} +2 -2
  16. package/dist/chunk-7JRRXGVZ.js +2 -0
  17. package/dist/{chunk-RHKMQNFI.js → chunk-7UQWUVRG.js} +2 -2
  18. package/dist/chunk-A6IDHNMC.js +4 -0
  19. package/dist/chunk-A6TANQNV.js +2 -0
  20. package/dist/{chunk-X3Z4MLVL.js → chunk-AW2QHPLL.js} +2 -2
  21. package/dist/chunk-BSN22NRK.js +9 -0
  22. package/dist/{chunk-ZDR4VTOP.js → chunk-BVRS7RKQ.js} +2 -2
  23. package/dist/{chunk-ANIOISCE.js → chunk-C5CTSJ6X.js} +2 -2
  24. package/dist/{chunk-MEKSFV6H.js → chunk-CCKPYPDI.js} +2 -2
  25. package/dist/chunk-CZ425R2B.js +18 -0
  26. package/dist/{chunk-QDGKE5HN.js → chunk-DQVKIG3D.js} +2 -2
  27. package/dist/chunk-F6ICF7HL.js +40 -0
  28. package/dist/chunk-FAYI6KZ5.js +2 -0
  29. package/dist/{chunk-ZL52RLDK.js → chunk-FDEQIPPK.js} +2 -2
  30. package/dist/chunk-FRPEPTYJ.js +5 -0
  31. package/dist/chunk-GBEYTDY5.js +2 -0
  32. package/dist/{chunk-VFLHKRTW.js → chunk-GRJY65YT.js} +2 -2
  33. package/dist/chunk-HF25DFSC.js +3 -0
  34. package/dist/chunk-HHN2B5KA.js +2 -0
  35. package/dist/{chunk-FKUCFCLU.js → chunk-I46WR7MT.js} +2 -2
  36. package/dist/{chunk-5SMUKUV5.js → chunk-IPQTC36U.js} +2 -2
  37. package/dist/{chunk-FGTHPJON.js → chunk-J7RWXLUL.js} +2 -2
  38. package/dist/{chunk-63MSELOP.js → chunk-KX5PLFZ5.js} +2 -2
  39. package/dist/{chunk-VMPB52FG.js → chunk-LPL4MA6R.js} +2 -2
  40. package/dist/chunk-LZHUWKGD.js +2 -0
  41. package/dist/{chunk-BJWNO6BU.js → chunk-MMLZEGMS.js} +2 -2
  42. package/dist/{chunk-5G5VI7J4.js → chunk-NZ4UDB5N.js} +2 -2
  43. package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
  44. package/dist/chunk-P5RYBRIO.js +4 -0
  45. package/dist/chunk-PKMZCDQD.js +4 -0
  46. package/dist/{chunk-T633QLYF.js → chunk-PTQVNJ4Q.js} +2 -2
  47. package/dist/{chunk-FHWEEQVO.js → chunk-QPU7EXAW.js} +2 -2
  48. package/dist/chunk-QVI3NR7E.js +7 -0
  49. package/dist/{chunk-6EO3E3IP.js → chunk-QX7LLCGB.js} +2 -2
  50. package/dist/{chunk-AA7L7GKI.js → chunk-QYB5P7GL.js} +2 -2
  51. package/dist/chunk-RVWSAMTT.js +2 -0
  52. package/dist/{chunk-SHM5D3DQ.js → chunk-RXRLZFUL.js} +2 -2
  53. package/dist/{chunk-LGX2Y4BA.js → chunk-RYXW3KRC.js} +2 -2
  54. package/dist/{chunk-B4EHYG6M.js → chunk-SGLLBSCV.js} +2 -2
  55. package/dist/{chunk-ZMU6IWDK.js → chunk-SULEXAHO.js} +2 -2
  56. package/dist/{chunk-KZYHFI2X.js → chunk-TH2N6QHW.js} +2 -2
  57. package/dist/{chunk-JRUKS66S.js → chunk-TL6QPNF5.js} +2 -2
  58. package/dist/{chunk-JUIAOOK7.js → chunk-UDGXK2WA.js} +2 -2
  59. package/dist/{chunk-Q34NWRPP.js → chunk-UFX7EPBA.js} +2 -2
  60. package/dist/chunk-UQLFQLAF.js +2 -0
  61. package/dist/{chunk-VXT7WVIN.js → chunk-UWYJDBDW.js} +2 -2
  62. package/dist/{chunk-GZQID3FS.js → chunk-UYD7FJ3K.js} +2 -2
  63. package/dist/{chunk-2YI45TNM.js → chunk-VUKC6F77.js} +2 -2
  64. package/dist/{chunk-L4QKEQ4S.js → chunk-WG6KRH5F.js} +2 -2
  65. package/dist/{chunk-LWTML2AN.js → chunk-XIVO4SDZ.js} +2 -2
  66. package/dist/{chunk-N7F5UM6J.js → chunk-XSNRACLV.js} +2 -2
  67. package/dist/chunk-XUGQU7PM.js +41 -0
  68. package/dist/{chunk-BJG67TCR.js → chunk-XXZXDXTD.js} +2 -2
  69. package/dist/chunk-Y6E3JHC4.js +2 -0
  70. package/dist/{chunk-6BNOACLT.js → chunk-YBEEVDJQ.js} +2 -2
  71. package/dist/chunk-YGHUVQLR.js +2 -0
  72. package/dist/chunk-YWDVDAD7.js +2 -0
  73. package/dist/{chunk-6N6QTGSD.js → chunk-Z4I7BVIU.js} +2 -2
  74. package/dist/{chunk-3FYGJ2GY.js → chunk-ZQO43G2T.js} +2 -2
  75. package/dist/{chunk-JYSAYZNX.js → chunk-ZU6PROUY.js} +2 -2
  76. package/dist/cli.js +256 -205
  77. package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
  78. package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
  79. package/dist/index.d.ts +3 -2
  80. package/dist/index.js +3 -3
  81. package/dist/queries/affected.d.ts +1 -1
  82. package/dist/queries/affected.js +1 -1
  83. package/dist/queries/bottlenecks.d.ts +1 -1
  84. package/dist/queries/bottlenecks.js +1 -1
  85. package/dist/queries/by-kind.d.ts +1 -1
  86. package/dist/queries/by-kind.js +1 -1
  87. package/dist/queries/call-graph.d.ts +1 -1
  88. package/dist/queries/call-graph.js +1 -1
  89. package/dist/queries/change-surface.d.ts +1 -1
  90. package/dist/queries/change-surface.js +1 -1
  91. package/dist/queries/cleanup-plan.d.ts +1 -1
  92. package/dist/queries/cleanup-plan.js +1 -1
  93. package/dist/queries/co-change.d.ts +1 -1
  94. package/dist/queries/co-change.js +1 -1
  95. package/dist/queries/code.d.ts +1 -1
  96. package/dist/queries/code.js +1 -1
  97. package/dist/queries/complexity-hotspots.d.ts +1 -1
  98. package/dist/queries/complexity-hotspots.js +1 -1
  99. package/dist/queries/complexity.d.ts +1 -1
  100. package/dist/queries/complexity.js +1 -1
  101. package/dist/queries/convergence.d.ts +1 -1
  102. package/dist/queries/convergence.js +1 -1
  103. package/dist/queries/coupling.d.ts +1 -1
  104. package/dist/queries/coupling.js +1 -1
  105. package/dist/queries/cycles.d.ts +1 -1
  106. package/dist/queries/cycles.js +1 -1
  107. package/dist/queries/dataflow.d.ts +1 -1
  108. package/dist/queries/dataflow.js +1 -1
  109. package/dist/queries/dead.d.ts +1 -1
  110. package/dist/queries/dead.js +1 -1
  111. package/dist/queries/deep-chains.d.ts +1 -1
  112. package/dist/queries/deep-chains.js +1 -1
  113. package/dist/queries/deps.d.ts +1 -1
  114. package/dist/queries/deps.js +1 -1
  115. package/dist/queries/diff-gate.d.ts +1 -1
  116. package/dist/queries/diff-gate.js +1 -1
  117. package/dist/queries/diff-impact.d.ts +1 -1
  118. package/dist/queries/diff-impact.js +1 -1
  119. package/dist/queries/doc-drift.d.ts +1 -1
  120. package/dist/queries/doc-drift.js +1 -1
  121. package/dist/queries/drift.d.ts +2 -1
  122. package/dist/queries/drift.js +1 -1
  123. package/dist/queries/extract-candidates.d.ts +1 -1
  124. package/dist/queries/extract-candidates.js +1 -1
  125. package/dist/queries/fan.d.ts +1 -1
  126. package/dist/queries/fan.js +1 -1
  127. package/dist/queries/files.d.ts +1 -1
  128. package/dist/queries/health.d.ts +2 -2
  129. package/dist/queries/health.js +1 -1
  130. package/dist/queries/hierarchy.d.ts +1 -1
  131. package/dist/queries/hierarchy.js +1 -1
  132. package/dist/queries/hotspots.d.ts +1 -1
  133. package/dist/queries/hotspots.js +1 -1
  134. package/dist/queries/imports.d.ts +1 -1
  135. package/dist/queries/imports.js +1 -1
  136. package/dist/queries/incomplete-migration.d.ts +1 -1
  137. package/dist/queries/incomplete-migration.js +1 -1
  138. package/dist/queries/index.d.ts +2 -2
  139. package/dist/queries/index.js +1 -1
  140. package/dist/queries/isolated.d.ts +1 -1
  141. package/dist/queries/isolated.js +1 -1
  142. package/dist/queries/locality-candidates.d.ts +1 -1
  143. package/dist/queries/locality-candidates.js +1 -1
  144. package/dist/queries/members.d.ts +1 -1
  145. package/dist/queries/members.js +1 -1
  146. package/dist/queries/methods.d.ts +1 -1
  147. package/dist/queries/methods.js +1 -1
  148. package/dist/queries/outline.d.ts +1 -1
  149. package/dist/queries/outline.js +1 -1
  150. package/dist/queries/passthrough-candidates.d.ts +1 -1
  151. package/dist/queries/passthrough-candidates.js +1 -1
  152. package/dist/queries/plan-context.d.ts +1 -1
  153. package/dist/queries/plan-context.js +1 -1
  154. package/dist/queries/react-component-duplicates.d.ts +2 -1
  155. package/dist/queries/react-component-duplicates.js +1 -1
  156. package/dist/queries/react-hook-candidates.d.ts +2 -1
  157. package/dist/queries/react-hook-candidates.js +1 -1
  158. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  159. package/dist/queries/react-large-component-pressure.js +1 -1
  160. package/dist/queries/recent-duplicates.d.ts +1 -1
  161. package/dist/queries/recent-duplicates.js +1 -1
  162. package/dist/queries/redundant-reexports.d.ts +1 -1
  163. package/dist/queries/redundant-reexports.js +1 -1
  164. package/dist/queries/refs.d.ts +1 -1
  165. package/dist/queries/refs.js +1 -1
  166. package/dist/queries/self-audit.d.ts +1 -1
  167. package/dist/queries/self-audit.js +1 -1
  168. package/dist/queries/similar-chains.d.ts +1 -1
  169. package/dist/queries/similar-chains.js +1 -1
  170. package/dist/queries/similar-files.d.ts +1 -1
  171. package/dist/queries/similar-files.js +1 -1
  172. package/dist/queries/similar-signatures.d.ts +1 -1
  173. package/dist/queries/similar-signatures.js +1 -1
  174. package/dist/queries/similar.d.ts +2 -1
  175. package/dist/queries/similar.js +1 -1
  176. package/dist/queries/slice.d.ts +1 -1
  177. package/dist/queries/slice.js +1 -1
  178. package/dist/queries/stale-abstractions.d.ts +1 -1
  179. package/dist/queries/stale-abstractions.js +1 -1
  180. package/dist/queries/stats.d.ts +1 -1
  181. package/dist/queries/surface.d.ts +1 -1
  182. package/dist/queries/surface.js +1 -1
  183. package/dist/queries/symbols.d.ts +1 -1
  184. package/dist/queries/symbols.js +1 -1
  185. package/dist/queries/system.d.ts +1 -1
  186. package/dist/queries/system.js +1 -1
  187. package/dist/queries/trace.d.ts +1 -1
  188. package/dist/queries/trace.js +1 -1
  189. package/dist/queries/unused-imports.d.ts +1 -1
  190. package/dist/queries/unused-imports.js +1 -1
  191. package/dist/queries/unused-params.d.ts +1 -1
  192. package/dist/queries/unused-params.js +1 -1
  193. package/dist/queries/vue-component-duplicates.d.ts +2 -1
  194. package/dist/queries/vue-component-duplicates.js +1 -1
  195. package/dist/queries/vue-composable-candidates.d.ts +2 -1
  196. package/dist/queries/vue-composable-candidates.js +1 -1
  197. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  198. package/dist/queries/wrapper-candidates.d.ts +1 -1
  199. package/dist/queries/wrapper-candidates.js +1 -1
  200. package/docs/analyzer-inventory.md +29 -0
  201. package/docs/analyzer-validation-ledger.md +32 -1
  202. package/package.json +1 -1
  203. package/dist/chunk-2H57MJLI.js +0 -2
  204. package/dist/chunk-4TMJDHC6.js +0 -5
  205. package/dist/chunk-5GVOJOBL.js +0 -2
  206. package/dist/chunk-7XWXGANX.js +0 -4
  207. package/dist/chunk-AETMKBZR.js +0 -40
  208. package/dist/chunk-BTCASU5J.js +0 -3
  209. package/dist/chunk-C6ROZBJA.js +0 -32
  210. package/dist/chunk-COUFCH64.js +0 -2
  211. package/dist/chunk-EKECQP6Z.js +0 -2
  212. package/dist/chunk-FVA3NH4P.js +0 -2
  213. package/dist/chunk-I274B3B3.js +0 -7
  214. package/dist/chunk-J6ADQKQA.js +0 -2
  215. package/dist/chunk-K7VBTWNR.js +0 -2
  216. package/dist/chunk-KLXVEBVC.js +0 -2
  217. package/dist/chunk-KRGBLZT2.js +0 -7
  218. package/dist/chunk-P3K7LX7M.js +0 -4
  219. package/dist/chunk-PVZMPG5I.js +0 -2
  220. package/dist/chunk-RY7CAOJF.js +0 -4
  221. package/dist/chunk-S7YOLFLX.js +0 -2
  222. package/dist/chunk-SOGKYB5I.js +0 -8
  223. package/dist/chunk-VAXDTQHE.js +0 -18
  224. package/dist/chunk-X3BJUFSN.js +0 -62
  225. package/dist/chunk-XPOZO76D.js +0 -2
  226. package/dist/chunk-XWC67C3Q.js +0 -2
  227. package/dist/chunk-YNSVAJR6.js +0 -2
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-LGX2Y4BA.js";import{i as o}from"./chunk-X3BJUFSN.js";function h(t,l){let s=m(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 m}from"./chunk-RYXW3KRC.js";import{j as o}from"./chunk-4N4WONI4.js";function h(t,l){let s=m(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=o(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 m}from"./chunk-LGX2Y4BA.js";import{i as o}from"./chunk-X3BJUFSN.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{h as a};
35
- //# sourceMappingURL=chunk-BJWNO6BU.js.map
35
+ //# sourceMappingURL=chunk-MMLZEGMS.js.map
@@ -1,2 +1,2 @@
1
- import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-RSKOYTSY.js";import{y as d}from"./chunk-3LQFMQPY.js";import{c as h,d as S,g as x}from"./chunk-X3BJUFSN.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-DS6QEB3G.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
2
- //# sourceMappingURL=chunk-5G5VI7J4.js.map
1
+ import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-4KTOV4QN.js";import{y as d}from"./chunk-OBGRLXWF.js";import{c as h,d as S,g as x}from"./chunk-4N4WONI4.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-DS6QEB3G.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
2
+ //# sourceMappingURL=chunk-NZ4UDB5N.js.map
@@ -1,3 +1,3 @@
1
- import{a as w}from"./chunk-C6ROZBJA.js";import{a as v}from"./chunk-64MNV6AB.js";import{a as O,d as D,f as P}from"./chunk-7S5E7KWT.js";function V(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Rt=P("stripped-lines",{clearGroups:["whole-project","source-file"]});O({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,h=""},clearFile:()=>{_=null,h=""}});var _=null,h="";function Y(t){return _===t||(_=t,h=V(t)),h}function Ct(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${X(n)}\\b`,"m").test(t)}function jt(t,n){let e=new Set,r=new RegExp(`\\b${X(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as K,dirname as S,extname as p,join as g,relative as m,resolve as u}from"path";var Q=D("indexed-paths",{clearGroups:[]}),Z=D("indexed-path-digest",{clearGroups:[]}),I=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],b=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],G=[".php"],q=new Set(I),R=new Set(b),J=new Set(k),C=new Set(A),$=new Set(L),M=new Set(W),B=new Set(H),j=new Set(U),F=new Set(G),tt=[{extensions:I,lookup:q},{extensions:b,lookup:R},{extensions:k,lookup:J},{extensions:A,lookup:C},{extensions:L,lookup:$},{extensions:W,lookup:M},{extensions:H,lookup:B},{extensions:U,lookup:j},{extensions:G,lookup:F}];function x(t,n){return n.has(p(t).toLowerCase())}function nt(t){return x(t,R)}function et(t){return x(t,J)}function rt(t){return x(t,C)}function ot(t){return x(t,$)}function st(t){return x(t,M)}function it(t){return x(t,B)}function kt(t){return p(t).toLowerCase()===".vb"}function ct(t){return x(t,j)}function at(t){return x(t,F)}function lt(t){let n=p(t).toLowerCase();for(let e of tt)if(e.lookup.has(n))return e.extensions;return I}function ut(t){return et(t)||it(t)||at(t)}function At(t,n,e){return nt(n)?pt(t,n,e):rt(n)?ft(t,n,e):ot(n)?St(t,n,e):st(n)?xt(t,n,e):ut(n)?dt(t,e.replace(/\\/g,"."),lt(n)):ct(n)?Et(t,n,e):gt(t,n,e)}function gt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=E(t);for(let c of _t(o)){let a=d(m(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(m(t.config.projectRoot,o))}function pt(t,n,e){let r=E(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of ht(o)){let c=d(m(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function ft(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),y(t,mt(s))}function St(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return y(t,It(o))}function xt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return y(t,o)}function dt(t,n,e){let r=E(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,N=[...r].find(z=>z.endsWith(l));if(N)return N}for(let i of e){let l=[...r].find(N=>K(N)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function Et(t,n,e){let r=E(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of Nt(s)){let a=d(m(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function ht(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function y(t,n){let e=E(t);for(let r of n){let o=d(m(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function It(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function Nt(t){let n=p(t);return j.has(n)?[t]:[`${t}.dart`,t]}function _t(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of I)e.add(t.slice(0,-n.length)+r)}else for(let r of I)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function E(t){return Q.get(t,()=>new Set(v(t,{includeIgnored:!1}).map(d)))}function Lt(t){return Z.get(t,()=>w([...E(t)].sort().join(`
1
+ import{a as w}from"./chunk-XUGQU7PM.js";import{a as v}from"./chunk-64MNV6AB.js";import{a as O,d as D,f as P}from"./chunk-7S5E7KWT.js";function V(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Rt=P("stripped-lines",{clearGroups:["whole-project","source-file"]});O({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,h=""},clearFile:()=>{_=null,h=""}});var _=null,h="";function Y(t){return _===t||(_=t,h=V(t)),h}function Ct(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${X(n)}\\b`,"m").test(t)}function jt(t,n){let e=new Set,r=new RegExp(`\\b${X(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as K,dirname as S,extname as p,join as g,relative as m,resolve as u}from"path";var Q=D("indexed-paths",{clearGroups:[]}),Z=D("indexed-path-digest",{clearGroups:[]}),I=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],b=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],G=[".php"],q=new Set(I),R=new Set(b),J=new Set(k),C=new Set(A),$=new Set(L),M=new Set(W),B=new Set(H),j=new Set(U),F=new Set(G),tt=[{extensions:I,lookup:q},{extensions:b,lookup:R},{extensions:k,lookup:J},{extensions:A,lookup:C},{extensions:L,lookup:$},{extensions:W,lookup:M},{extensions:H,lookup:B},{extensions:U,lookup:j},{extensions:G,lookup:F}];function x(t,n){return n.has(p(t).toLowerCase())}function nt(t){return x(t,R)}function et(t){return x(t,J)}function rt(t){return x(t,C)}function ot(t){return x(t,$)}function st(t){return x(t,M)}function it(t){return x(t,B)}function kt(t){return p(t).toLowerCase()===".vb"}function ct(t){return x(t,j)}function at(t){return x(t,F)}function lt(t){let n=p(t).toLowerCase();for(let e of tt)if(e.lookup.has(n))return e.extensions;return I}function ut(t){return et(t)||it(t)||at(t)}function At(t,n,e){return nt(n)?pt(t,n,e):rt(n)?ft(t,n,e):ot(n)?St(t,n,e):st(n)?xt(t,n,e):ut(n)?dt(t,e.replace(/\\/g,"."),lt(n)):ct(n)?Et(t,n,e):gt(t,n,e)}function gt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=E(t);for(let c of _t(o)){let a=d(m(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(m(t.config.projectRoot,o))}function pt(t,n,e){let r=E(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of ht(o)){let c=d(m(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function ft(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),y(t,mt(s))}function St(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return y(t,It(o))}function xt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return y(t,o)}function dt(t,n,e){let r=E(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,N=[...r].find(z=>z.endsWith(l));if(N)return N}for(let i of e){let l=[...r].find(N=>K(N)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function Et(t,n,e){let r=E(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of Nt(s)){let a=d(m(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function ht(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function y(t,n){let e=E(t);for(let r of n){let o=d(m(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function It(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function Nt(t){let n=p(t);return j.has(n)?[t]:[`${t}.dart`,t]}function _t(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of I)e.add(t.slice(0,-n.length)+r)}else for(let r of I)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function E(t){return Q.get(t,()=>new Set(v(t,{includeIgnored:!1}).map(d)))}function Lt(t){return Z.get(t,()=>w([...E(t)].sort().join(`
2
2
  `)))}function d(t){return t.replace(/\\/g,"/")}export{I as a,b,k as c,A as d,L as e,W as f,H as g,U as h,G as i,kt as j,lt as k,At as l,pt as m,ft as n,St as o,xt as p,dt as q,Et as r,Lt as s,d as t,V as u,Ct as v,$t as w,jt as x,yt as y};
3
- //# sourceMappingURL=chunk-3LQFMQPY.js.map
3
+ //# sourceMappingURL=chunk-OBGRLXWF.js.map
@@ -0,0 +1,4 @@
1
+ import{a as oe,b as ie,c as P,d as ae,e as pe,f as ce,g as j,h as me,i as F,j as le,k as ue,l as _,m as U,n as T,o as G,p as Y,q as S,r as K,s as Z,t as J,v as R,w as h,x as M,y as ee}from"./chunk-OBGRLXWF.js";import{b as ge}from"./chunk-YZA6PPZL.js";import{a as de,b as fe,d as C}from"./chunk-HF25DFSC.js";import{a as v}from"./chunk-DS6QEB3G.js";import{b as B,d as V,e as Q}from"./chunk-XUGQU7PM.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as Se}from"path";var je=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&je.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function b(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,ue(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function O(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function D(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=R(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function z(t,r,e,s){let n=C(t,r),o=de(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function he(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=Se(o).replace(/\.[^.]+$/,"");return[$(o,i,Y(t,r,o),h(n,i))]})}function Me(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(m=>m.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");n.push(f(i,a,Y(t,r,i),s))}return n}function xe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=R(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:K(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function ye(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:K(t,r,o)})}return s}function Ne(t,r,e){return z(t,r,{csharp:s=>qe(t,r,s),vb:s=>$e(t,r,s)},()=>{let s=le(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),c=!!p,m=(c?p:a)?.trim()??i,l=m.split(".").pop()??m,u=c?a?.trim()??l:l;return[b(t,r,o,m,l,u,S(t,m,j))]})})}function $e(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,c=a.text,m=c.split(".").pop()??c,l=p?.text??m;n.push(f(m,l,S(t,c,j),s,p?"namespace":"named"))}return n}function qe(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let c=p.text,m=c.split(".").pop()??c,l=a?.text??m;n.push(f(m,l,S(t,c,j),s,a?"namespace":"named"))}return n}var Fe=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ie(t,r){return Fe.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function te(t,r,e){return I(t,r,s=>We(t,r,s),()=>Ue(t,r,e))}function Ue(t,r,e){return Ze(e).flatMap(s=>et(t,r,s.clause,s.specifier,s.start,s.end,e))}function We(t,r,e){let s=Je(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...ze(t,r,e,o,s));return n}function Je(t,r,e){let s=g(e,new Set(["import_statement"]));if(fe(r))for(let n of Ie(t,r))s.add(n);return s}function ze(t,r,e,s,n){let o=Qe(s);if(!o)return[];let i=_(t,r,o),a=y(s,"import_clause");return a?Xe(e,a,i,n,Ge(s.text)):[O("*",i)]}function Xe(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(He(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Be(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ve(i,e,s,n));return o}function He(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Be(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ke(t,i);return D("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Ve(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,c=a?.text??p;n.push(f(p,c,r,e,"named",{isTypeOnly:s||Ye(o.text)}))}return n}function Qe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Ge(t){return/^\s*import\s+type\b/.test(t)}function Ye(t){return/^\s*type\b/.test(t.trim())}function Ke(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function et(t,r,e,s,n,o,i){let a=_(t,r,s),p=R(i,n,o);return e?tt(e).map(m=>({...m,sourcePath:a})).map(m=>{if(m.kind==="namespace"){let l=M(p,m.localName);return D(m.importedName,m.sourcePath,{localName:m.localName,usedMembers:l,used:l.length>0||h(p,m.localName),isTypeOnly:m.isTypeOnly})}return m.kind==="side-effect"?O(m.importedName,m.sourcePath):$(m.importedName,m.localName??"",m.sourcePath,m.localName?h(p,m.localName):!1,m.kind,[],{isTypeOnly:m.isTypeOnly})}):[O("*",a)]}function tt(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=rt(s),i=[];return n&&i.push(...Pe(n,e)),o&&i.push(...Pe(o,e)),i}function Pe(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,c]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(c??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function rt(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function re(t,r,e){let s=C(t,r);return s?pt(t,r,s):st(t,r,e)}function st(t,r,e){return[...nt(t,r,e),...ot(t,r,e),...it(t,r,e)]}function nt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>at(l.trim())).filter(l=>!!l),c=q(e,o.index),m=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:_(t,r,a),names:p,startLine:c,endLine:m})}return s}function ot(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function it(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function at(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ct(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=mt(n,o,i,a);s.push(p)}return s}function ct(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return _(t,r,n.text)}function mt(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),c=a.namedChild(1);p&&i.push((c??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function be(t,r,e){return z(t,r,{java:s=>lt(t,r,s),kotlin:s=>ut(t,r,s),scala:s=>dt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ft(t,r,o,n):[]}))}function lt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let c=p.text;if(i){n.push(D("*",S(t,c,P)));continue}let m=c.split(".").pop()??c;n.push(f(m,m,S(t,c,P),s))}return n}function ut(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(D("*",S(t,i.text,P)));continue}let c=i.text,m=c.split(".").pop()??c,u=p?.namedChild(0)?.text??m;n.push(f(m,u,S(t,c,P),s))}return n}function dt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(D("*",S(t,p,P)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let E=u.text,A=d?.text??E;if(E==="_")continue;n.push(f(E,A,S(t,`${p}.${E}`,P),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,P),s))}continue}let c=a[a.length-1]?.text??p,m=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(c,c,S(t,m&&a.length>1?`${m}.${c}`:p,P),s))}return n}function ft(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,c]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),m=p?.trim();if(!m||m==="_")return[];let l=(c??m.split(".").pop()??m).trim(),u=m==="_"?n:`${n}.${m}`.replace(/\.\./g,".");return[b(t,r,s,u,m,l)]})}return[b(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function _e(t,r,e){return I(t,r,s=>gt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,c]=a.split(/\s+as\s+/i),m=p?.trim()??a,l=m.split("\\").pop()??m,u=(c??l).trim();return[b(t,r,n,m,l,u,S(t,m.replace(/\\/g,"."),F))]}):[]}))}function gt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),F),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(c=>c.type==="namespace_name")?.text??"";for(let c of a.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:m,localName:l,qualified:u}=Ee(c,p);m&&o(u,m,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:c,localName:m,qualified:l}=Ee(p,"");c&&o(l,c,m)}}return n}function Ee(t,r){let e=t.namedChildren.find(c=>c.type==="qualified_name"),s=t.namedChildren.filter(c=>c.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function Re(t,r,e){return I(t,r,s=>St(t,r,s),()=>xt(e).flatMap(s=>Nt(t,r,s,e)))}function St(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Te(i);if(!a)continue;let p=U(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ht(i);if(a===null)continue;let p=U(t,r,a);for(let c=1;c<o.namedChildCount;c+=1){let m=o.namedChild(c);if(m.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Te(m);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Te(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ht(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function xt(t){let r=t.split(`
2
+ `),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,c=a+o.length,m=ee(o);for(;n+1<r.length&&(m>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
+ ${u}`,c+=1+u.length,m+=ee(u),s+=u.length+1}let l=yt(p);l&&e.push({...l,start:a,end:c})}return e}function yt(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function Nt(t,r,e,s){let n=R(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let c=p.trim().replace(/,$/,"");if(!c)return[];let[m,l]=c.split(/\s+as\s+/),u=m.trim(),d=(l??u.split(".")[0]??u).trim(),E=U(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:E,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?U(t,r,e.module):null,a=[];for(let p of x(o)){let c=p.trim().replace(/,$/,"");if(!c)continue;if(c==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[m,l]=c.split(/\s+as\s+/),u=(l??m).trim();a.push({importedName:m.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as It}from"path";function Ce(t,r,e){return I(t,r,s=>bt(t,r,s),()=>Pt(t,r,e))}function Pt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?G(t,r,i):null;if(a){let p=Oe(i);return[$(p,p,a,h(n,p))]}return[O(i,a)]})}function bt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let c=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!c||c.type!=="string")continue;let l=c.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?G(t,r,l):null;if(u){let d=Oe(l);n.push(f(d,d,u,s))}else n.push(O(l,u))}return n}function Oe(t){return ge(It(t).replace(/\.[^.]+$/,""),/_/)}function De(t,r,e){return I(t,r,s=>Et(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?_t(t,r,o,n):[]}))}function Et(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of W(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function W(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:X(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:X(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=X(r,e.text),o=[];for(let i of s.namedChildren)o.push(...W(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...W(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=W(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:X(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function X(t,r){return t?r?`${t}::${r}`:t:r}function _t(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let m=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[E,A]=d.split(/\s+as\s+/),w=E?.trim();if(!w)return[];let we=(A??w.split("::").pop()??w).trim(),Le=`${m}::${w}`.replace(/::::/g,"::");return[b(t,r,s,Le,w.split("::").pop()??w,we,T(t,r,m))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),c=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[b(t,r,s,a,a.split("::").pop()??a,p,c)]}function ke(t,r,e){let s=C(t,r);if(s)return Tt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Ct(t,r,i))}return n}function Tt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Rt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of W(o,""))i.importedName&&s.push(se(t,r,i.qualifiedName))}return s}function Rt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Ct(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),c=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[se(t,r,c)]})}return[se(t,r,s)]}function se(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Ae(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Ot={language:"javascript",extensions:oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:te,parseReExports:re},Dt=k({language:"python",extensions:ie,imports:"ast-with-regex-fallback",parseImports:Re}),kt=k({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:be}),At={language:"rust",extensions:ae,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:De,parseExports:ke},wt=k({language:"ruby",extensions:pe,imports:"ast-with-regex-fallback",parseImports:Ce}),Lt=k({language:"c/cpp",extensions:ce,imports:"ast-with-regex-fallback",parseImports:he}),jt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),vt={language:"dart",extensions:me,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:xe,parseExports:ye},Mt=k({language:"php",extensions:F,imports:"ast-with-regex-fallback",parseImports:_e}),$t=[Ot,Dt,kt,At,wt,Lt,jt,vt,Mt];function H(t){return Ae($t,t)}var ne={clearGroups:["whole-project","source-file"]},qt=L("source-imports",ne),Ft=L("source-exports",ne),Ut=L("source-reexports",ne);function ns(t,r){let e=J(r);return Ut.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-reexports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.reExports))return c.reExports}catch{}let p=s.parseReExports(t,e,n);return Q(t,"source-reexports",e,o,JSON.stringify({resolutionFingerprint:i,reExports:p})),p})}function os(t,r){let e=J(r);return qt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);if(!n)return[];let o=B(t,e,n),i=Z(t),a=V(t,"source-imports",e,o);if(a!==null)try{let c=JSON.parse(a);if(c.resolutionFingerprint===i&&Array.isArray(c.imports))return c.imports}catch{}let p=s.parseImports(t,e,n);return Q(t,"source-imports",e,o,JSON.stringify({resolutionFingerprint:i,imports:p})),p})}function is(t,r){let e=J(r);return Ft.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{ns as a,os as b,is as c};
4
+ //# sourceMappingURL=chunk-P5RYBRIO.js.map
@@ -0,0 +1,4 @@
1
+ import{a as O,d as v}from"./chunk-BSN22NRK.js";import{b as E,d as _,e as N,j as F,k as M}from"./chunk-XUGQU7PM.js";import{existsSync as P,readFileSync as X}from"fs";import{join as I}from"path";function L(t,n){let e=G(t,n)??W(t,n)??Z(t,n)??J(t,n);return q(t,e,n)}function G(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=A(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(A(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function A(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function W(t,n){if(!b(t[n]??""))return null;let e=n;for(;e>0&&b(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&b(t[i]??"");)i+=1;return{start:e,end:i}}function b(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function Z(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(x(o)!==null)break;if(k(o)!==null)return null;e-=1}if(e<0)return null;let i=x(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",c=x(o);if(c!==null){if(c<=i)break;r+=1;continue}if(k(o)!==null)break;r+=1}return{start:e,end:r}}function x(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function J(t,n){let e=t[n]??"";if(B(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&j(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&j(t[r]??"");)r+=1;return{start:i,end:r}}function j(t){return k(t)===null}function k(t){return t.trim().length===0?"blank":B(t)?"heading":A(t)?"fence":b(t)?"table":x(t)!==null?"list":null}function B(t){return/^#{1,6}\s+/.test(t.trim())}function q(t,n,e){let{start:i,end:r}=n;if(r-i>40){let c=Math.floor(20);i=Math.max(i,e-c),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
+ `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function w(t,n){return n.filter(e=>t.includes(e))}var D=/\.(?:md|mdx|rst|txt)$/i;function K(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Q=3,V=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function St(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Q}=n,o=nt(t);if(!o)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let s of o.docFiles){if(e!==void 0&&!s.includes(e)||e===void 0&&!z(t,s)||e!==void 0&&!P(I(t.config.projectRoot,s)))continue;let l=Math.max(0,...o.changeTimes.get(s)??[]),h=Y(t,s),d=new Map,{resolved:g,broken:a,citations:u}=rt(t,s,o.tracked,o.trackedBySuffix,o.everSeenInHistory),p=new Map(u.map(f=>[f.file,f.contexts]));for(let f of g){if(f===s||D.test(f))continue;let m=(o.changeTimes.get(f)??[]).filter(y=>y>l).length;m!==0&&d.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:m,...R("reference",h),citationContexts:p.get(f)})}for(let[f,m]of o.coupling.get(s)??[]){if(m<r||!o.tracked.has(f))continue;let y=(o.changeTimes.get(f)??[]).filter($=>$>l).length;if(y===0)continue;let S=d.get(f);S?(S.evidence="both",S.coChanges=m,Object.assign(S,R("both",h))):d.set(f,{file:f,evidence:"co-change",coChanges:m,changesSinceDocUpdate:y,...R("co-change",h)})}if(d.size===0&&a.length===0)continue;let C=[...d.values()].sort((f,m)=>m.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:s,docLastChangedAt:l,staleness:C.reduce((f,m)=>f+m.changesSinceDocUpdate,0)+a.length*10,subjects:C.slice(0,8),brokenReferences:a})}return c.sort((s,l)=>l.staleness-s.staleness),{available:!0,commitsAnalyzed:o.historyCommitCount,docsScanned:o.docFiles.length,findings:c.slice(0,i)}}function Y(t,n){let e;try{e=X(I(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
3
+ ${e}`.toLowerCase(),r=w(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=w(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function R(t,n){return{actionTier:tt(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function tt(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function nt(t){let n=O(t);if(!n)return null;let e=v(t)??new Set,i=new Map,r=new Map,o=new Set;for(let c of n.commits){let s=[...new Set(c.files)],l=s.filter(d=>D.test(d)),h=s.filter(d=>!D.test(d));for(let d of s){o.add(d);let g=i.get(d)??[];g.push(c.timestamp),i.set(d,g)}for(let d of l){let g=r.get(d);g||(g=new Map,r.set(d,g));for(let a of h)g.set(a,(g.get(a)??0)+1)}}return{changeTimes:i,coupling:r,docFiles:[...e].filter(c=>D.test(c)),everSeenInHistory:o,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:H(e)}}function bt(t,n){if(n.size===0)return[];let e=v(t)??new Set,i=H(e),r=et(n,i),o=[];for(let c of e){if(!z(t,c))continue;let s=U(t,c);if(!s)continue;let l=it(s.candidates,n,r,e,i);if(l.size===0)continue;let h=[...new Set([...l.values()].flatMap(u=>[...u]))],d=ot(s.contextsByCandidate,h),g=[...l].map(([u,p])=>({file:u,contexts:T([...p].flatMap(C=>d.get(C)??[])).slice(0,3)})).filter(u=>u.contexts.length>0),a=[...l.keys()];if(a.length>0){let u=a.sort();o.push({doc:c,cited:u,citations:g,citedClaims:T(g.flatMap(p=>p.contexts)).slice(0,3)})}}return o}function z(t,n){return D.test(n)&&!K(n)&&P(I(t.config.projectRoot,n))}function H(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),c=n.get(o)??[];c.push(e),n.set(o,c)}}return n}function et(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let c=r.slice(-o).join("/"),s=n.get(c);s?.length===1&&s[0]===i&&e.add(c)}}return e}function it(t,n,e,i,r){let o=new Map;for(let c of t){if(!e.has(c))continue;let s;if(i.has(c))s=c;else{let h=r.get(c);h?.length===1&&(s=h[0])}if(!s||!n.has(s))continue;let l=o.get(s)??new Set;l.add(c),o.set(s,l)}return o}function rt(t,n,e,i,r){let o=new Set,c=new Set,s=U(t,n);if(!s)return{resolved:o,broken:[],citations:[]};let l=s.candidates,h=s.contextsByCandidate,d=new Map,g=(a,u)=>{let p=h.get(u);if(!p||p.length===0)return;let C=d.get(a)??[];C.push(...p),d.set(a,T(C).slice(0,3))};for(let a of l){if(e.has(a)){o.add(a),g(a,a);continue}let u=i.get(a);if(u&&u.length===1){o.add(u[0]),g(u[0],a);continue}u&&u.length>1||r.has(a)&&c.add(a)}return{resolved:o,broken:[...c],citations:[...d].map(([a,u])=>({file:a,contexts:u}))}}function ot(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function U(t,n){let e;try{e=X(I(t.config.projectRoot,n),"utf-8")}catch{return null}let i=E(t,n,e),r=_(t,"doc-path-evidence",n,i);if(r!==null){let c=at(r);if(c)return c}let o=st(e);return N(t,"doc-path-evidence",n,i,ct(o)),o}function st(t){let n=t.split(/\r?\n/),e=new Set,i=new Map;for(let r=0;r<n.length;r+=1){let o=n[r]??"";for(let c of o.matchAll(V)){let s=c[0].replace(/^\.?\//,"");e.add(s);let l=L(n,r);if(l.length===0)continue;let h=i.get(s)??[];h.push(l),i.set(s,T(h).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i}}function ct(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()]};return JSON.stringify(n)}function at(t){try{let n=JSON.parse(t);if(!F(n))return null;let e=M(n.candidates),i=dt(n.contextsByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i)}}catch{return null}}function dt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=M(e[1]);if(!i)return null;n.push([e[0],i])}return n}function T(t){let n=[];for(let e of new Set(t))n.some(i=>lt(i,e))||n.push(e);return n}function lt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),i=n.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),c=e.filter(s=>o.has(s)).length;return c>=3&&c/r>=.6}export{L as a,w as b,K as c,St as d,bt as e};
4
+ //# sourceMappingURL=chunk-PKMZCDQD.js.map
@@ -1,3 +1,3 @@
1
- import{a as y,b as d,e as w,l as f}from"./chunk-X3BJUFSN.js";import{b as D,c as $,d as Q,f as v,g as A,h as N}from"./chunk-JM72FNGA.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
1
+ import{a as y,b as d,e as w,m as f}from"./chunk-4N4WONI4.js";import{b as D,c as $,d as Q,f as v,g as A,h as N}from"./chunk-JM72FNGA.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
2
2
  AND `),r=y(e,{where:o,params:i,limit:200}),a=d(e,{where:o,params:i,limit:200});return w(r,a)}function J(e,n,t,i){let o=n.trim(),r=t,a=r.replace(/\(\)$/,""),c=n.toLowerCase(),l=t.toLowerCase(),S=l.replace(/\(\)$/,""),k=e.symbol,C=$(e.symbol),b=Q(e.symbol),E=e.display_name??"",g=e.symbol.toLowerCase(),u=C.toLowerCase(),m=b.toLowerCase(),R=E.toLowerCase(),p=e.relative_path.toLowerCase(),K=/[/:.]/.test(t),M=I(t),_=M?.leaf.toLowerCase(),s=0;return(k===o||k===r)&&(s+=1150),(C===o||C===r)&&(s+=1100),E===a&&(s+=1180),b===a&&(s+=1160),(`${b}()`===o||`${b}()`===r)&&(s+=955),(g===c||g===l)&&(s+=1e3),(u===c||u===l)&&(s+=950),(p===c||p===l)&&(s+=925),(p.endsWith(`/${l}`)||p.endsWith(`/${c}`))&&(s+=875),R===S&&(s+=850),m===S&&(s+=825),(`${m}()`===c||`${m}()`===l)&&(s+=820),(u.endsWith(`:${l}`)||u.endsWith(`:${S}`)||u.endsWith(`:${S}()`))&&(s+=800),g.includes(l)&&(s+=120),u.includes(l)&&(s+=140),p.includes(l)&&(s+=140),R.includes(l)&&(s+=110),i.every(B=>{let L=B.toLowerCase();return g.includes(L)||u.includes(L)||p.includes(L)||R.includes(L)})&&(s+=100+i.length*15),M&&p.includes(M.path.toLowerCase())&&(s+=360,_&&(m===_||`${m}()`===_||`${m}()`==`${_}()`)&&(s+=700),v(e.symbol)&&(s+=180)),A(e.symbol)&&m===S&&(s+=60),!K&&N(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function I(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let i=n.slice(t+1).replace(/\(\)$/,"");return!i||i.includes(".")?null:{path:n.slice(0,t),leaf:i}}function x(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function U(e){let n=x(e),t=n.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return t.length>0?[...new Set(t)]:[n]}function V(e,n,t){let i=n.trim(),o=e.filter(r=>{let a=$(r.symbol),c=(r.display_name??"").trim();return r.symbol===i||a===i||a===t||c===i||c===t||`${c}()`===i||h(r,t)>1||r.relative_path===i});return o.length===0?null:(o.sort((r,a)=>h(a,t)-h(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),o[0]??null)}function h(e,n){let t=I(n);if(!t)return 0;let i=e.relative_path.toLowerCase(),o=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return i.includes(r)?o!==a?1:v(e.symbol)?D(e.symbol)===null?5:4:D(e.symbol)===null?3:2:0}export{re as a,Z as b,ae as c};
3
- //# sourceMappingURL=chunk-T633QLYF.js.map
3
+ //# sourceMappingURL=chunk-PTQVNJ4Q.js.map
@@ -1,2 +1,2 @@
1
- import{e as l}from"./chunk-BTCASU5J.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
2
- //# sourceMappingURL=chunk-FHWEEQVO.js.map
1
+ import{e as l}from"./chunk-HF25DFSC.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
2
+ //# sourceMappingURL=chunk-QPU7EXAW.js.map
@@ -0,0 +1,7 @@
1
+ import{a as L,b as v}from"./chunk-GRJY65YT.js";import{a as S}from"./chunk-LM5SHAN4.js";import{a as y}from"./chunk-PFOCOG57.js";import{a as x}from"./chunk-B75HZHUP.js";import{a as D}from"./chunk-GBEYTDY5.js";import{a as M}from"./chunk-BGBBVSH4.js";import{e as h}from"./chunk-UQLFQLAF.js";import{a as F}from"./chunk-F6ICF7HL.js";import{l as C}from"./chunk-4N4WONI4.js";import{c as d,d as g,j as I}from"./chunk-JM72FNGA.js";import{basename as u,extname as p}from"path";function X(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new D(t),l=R(r.fileDependencyGraph(e));return y({candidates:()=>N(r,e,i),orderCandidates:x,scanLimit:o,prepare:s=>({callerFileMap:_(t,r,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>E(t,r,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function _(t,n,e,i){let a=L(n,e,{semantic:i.semantic,sourceFallback:!1}),o=new Map(e.map(s=>[s.symbolId,s])),r=new Map;for(let s of e){let c=k(t,n,s,a);if(c.length>1||(r.set(s.symbolId,s),c.length!==1))continue;let f=c[0],b=w(t,s.symbolId,f);if(!b)continue;let m=P(n,t,f,s.symbol,b);m?.isFunctionLike&&o.has(m.symbolId)&&r.set(m.symbolId,o.get(m.symbolId))}let l=[...r.values()];return l.length===0?a:h(a,n.sourceFallbackCallerFiles(l))}function E(t,n,e,i){let a=k(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=w(t,e.symbolId,o);if(!r)return null;let l=P(n,t,o,e.symbol,r);if(l&&I(l.symbol))return null;let{fanIn:s,source:c}=j(i.callerFileMap,i.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let f=A(t,e,o,l);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:M(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?d(l.symbol):u(o),callerFanIn:s,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function N(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function k(t,n,e,i){let a=u(e.relativePath,p(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>u(r,p(r))!==a).filter(r=>{let l=n.fileKind(r);return l!=="barrel"&&l!=="entry"&&l!=="test"});return v(t,e,o).realConsumers}function w(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d ON c.document_id = d.id
5
+ WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
+ LIMIT 1`,n,e)}function P(t,n,e,i,a){let o=t.definitionsForFile(e),r=W(n,e,i,a.start_line,a.end_line);return C(o,r)}function j(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:T(n,e),source:"file"}}function W(t,n,e,i,a){let o=g(e);if(!o)return i;let r=F(t,n).get(o);if(!r||r.length===0)return i;for(let l of r)if(l>=i&&l<=a)return l;return i}function R(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function T(t,n){let e=t.get(n)??0;if(e>0)return e;let i=u(n,p(n)),a=0;for(let[o,r]of t)o!==n&&u(o,p(o))===i&&r>a&&(a=r);return a}function A(t,n,e,i){return S(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):u(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{X as a};
7
+ //# sourceMappingURL=chunk-QVI3NR7E.js.map
@@ -1,4 +1,4 @@
1
- import{g as p}from"./chunk-X3BJUFSN.js";import{a as f,c as g,e as l}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-64MNV6AB.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},d=new Map;for(let[e,r]of Object.entries(m))d.set(r.toLowerCase(),Number(e));var b=500;function _(e){let r=parseInt(e,10);if(!isNaN(r))return r;let t=e.toLowerCase(),n=d.get(t);if(n!==void 0)return n;for(let[i,o]of d)if(i.includes(t))return o;return null}function O(e,r,t={}){let{scope:n,limit:i=100}=t,o=_(r);return o===null?[]:h(e,n).map(s=>({row:s,resolvedKind:N(s)})).filter(s=>s.resolvedKind===o).slice(0,i).map(({row:s,resolvedKind:u})=>({symbol:s.symbol,shortName:g(s.symbol),kind:u,kindName:m[u]??"Unknown",relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function P(e,r={}){let t=k(e,r.scope);for(let n of S(e,r.scope)){let i=N(n);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((n,i)=>i[1]-n[1]||n[0]-i[0]).map(([n,i])=>({kind:n,kindName:m[n]??"Unknown",count:i}))}function h(e,r){return p(e,{scope:r}).map(K)}function k(e,r){let t=new Map;for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", "),o=e.all(`SELECT gs.kind AS kind, COUNT(*) AS count
1
+ import{g as p}from"./chunk-4N4WONI4.js";import{a as f,c as g,e as l}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-64MNV6AB.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},d=new Map;for(let[e,r]of Object.entries(m))d.set(r.toLowerCase(),Number(e));var b=500;function _(e){let r=parseInt(e,10);if(!isNaN(r))return r;let t=e.toLowerCase(),n=d.get(t);if(n!==void 0)return n;for(let[i,o]of d)if(i.includes(t))return o;return null}function O(e,r,t={}){let{scope:n,limit:i=100}=t,o=_(r);return o===null?[]:h(e,n).map(s=>({row:s,resolvedKind:N(s)})).filter(s=>s.resolvedKind===o).slice(0,i).map(({row:s,resolvedKind:u})=>({symbol:s.symbol,shortName:g(s.symbol),kind:u,kindName:m[u]??"Unknown",relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function P(e,r={}){let t=k(e,r.scope);for(let n of S(e,r.scope)){let i=N(n);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((n,i)=>i[1]-n[1]||n[0]-i[0]).map(([n,i])=>({kind:n,kindName:m[n]??"Unknown",count:i}))}function h(e,r){return p(e,{scope:r}).map(K)}function k(e,r){let t=new Map;for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", "),o=e.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN global_symbols gs ON der.symbol_id = gs.id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -20,4 +20,4 @@ import{g as p}from"./chunk-X3BJUFSN.js";import{a as f,c as g,e as l}from"./chunk
20
20
  ${e.symbolNoiseFor("gs")}
21
21
  AND d.relative_path IN (${i})
22
22
  ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...n))}return t}function y(e){let r=[];for(let t=0;t<e.length;t+=b)r.push(e.slice(t,t+b));return r}function K(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function N(e){return e.kind!==null&&e.kind!==0?M(e.kind,e.symbol,e.documentation):R(e.symbol,e.documentation,e.enclosing_symbol)}function M(e,r,t){let n=(t??"").toLowerCase();if(l(r)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function R(e,r,t){let n=f(e);if("kind"in n)return null;let i=n.descriptors,o=i[i.length-2]??null,a=l(e),s=(r??"").toLowerCase();return a==="type"?s.includes("type ")?76:s.includes("interface ")?27:s.includes("struct ")?68:s.includes("trait ")?73:(s.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:s.includes("async def ")||s.includes("def ")?23:(t?l(t):o?.suffix??null)==="type"?21:83}export{O as a,P as b};
23
- //# sourceMappingURL=chunk-6EO3E3IP.js.map
23
+ //# sourceMappingURL=chunk-QX7LLCGB.js.map
@@ -1,2 +1,2 @@
1
- import{b as d,c as m}from"./chunk-ANIOISCE.js";import{a as B}from"./chunk-2YI45TNM.js";function F(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),g=u.indexOf(u.reduce((x,$)=>x<$?x:$)),p=[...u.slice(g,-1),...u.slice(0,g),u[g]],S=p.join(" -> ");b.has(S)||(b.add(S),i.push({path:p,kind:R(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=d(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":m(e)||m(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||d(e)==="entry"||d(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{F as a};
2
- //# sourceMappingURL=chunk-AA7L7GKI.js.map
1
+ import{b as d,c as m}from"./chunk-C5CTSJ6X.js";import{a as B}from"./chunk-VUKC6F77.js";function F(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),g=u.indexOf(u.reduce((x,$)=>x<$?x:$)),p=[...u.slice(g,-1),...u.slice(0,g),u[g]],S=p.join(" -> ");b.has(S)||(b.add(S),i.push({path:p,kind:R(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=d(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":m(e)||m(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||d(e)==="entry"||d(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{F as a};
2
+ //# sourceMappingURL=chunk-QYB5P7GL.js.map
@@ -0,0 +1,2 @@
1
+ import{a as p,b as H,c as d,d as u}from"./chunk-BZ53S4ZN.js";import{a as b}from"./chunk-3VD3JMK2.js";import{a as R,b as g}from"./chunk-YWOOQ4FF.js";import{e as v}from"./chunk-HF25DFSC.js";function F(e,r={}){let{minSimilarity:h=.45,minSharedBehaviors:c=6,limit:t=20,scope:n,scanLimit:a,filePattern:l,focusFiles:f}=r,i=v(e,{scope:n,minBehaviorTokens:Math.max(3,c),scanLimit:a}).map(s=>({file:s.file,component:s.name,tokens:s.behaviorTokens,profile:s}));return b({profiles:i,limit:t,filePattern:l,focusFiles:f,compare:(s,o)=>y(s,o,h,c),sort:(s,o)=>o.similarity-s.similarity||s.fileA.localeCompare(o.fileA)||s.componentA.localeCompare(o.componentA)||s.fileB.localeCompare(o.fileB)||s.componentB.localeCompare(o.componentB)})}function y(e,r,h,c){let t=R(e.tokens,r.tokens);if(t.size<c||!A(t))return null;let n=H(e.tokens,r.tokens);if(n<h)return null;let a=d(t,"hook:"),l=d(t,"react-hook:"),f=d(t,"effect:"),i=d(t,"state:"),s=d(t,"request:"),o=d(t,"handler:"),k=d(t,"handler-verb:"),m=B({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k});return{fileA:e.file,componentA:e.component,fileB:r.file,componentB:r.component,similarity:n,sharedTokens:u(t),sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:u(g(e.tokens,r.tokens)).slice(0,25),uniqueToB:u(g(r.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k}),locA:e.profile.loc,locB:r.profile.loc}}function B(e){return p({genericWords:P,stripPrefixes:S,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:C})}function C(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function A(e){let r=0,h=0,c=0,t=0,n=0,a=0,l=0;for(let s of e)s.startsWith("hook:")?r+=1:s.startsWith("react-hook:")?h+=1:s.startsWith("effect:")?c+=1:s.startsWith("request:")?t+=1:s.startsWith("handler:")||s.startsWith("handler-verb:")?n+=1:s.startsWith("state:")?a+=1:s.startsWith("state-hook:")&&(l+=1);let f=a+l,i=r+h+c+t+n+f;return t>=1&&i>=4||r>=1&&(t>=1||a>=1||n>=2)&&i>=5||a>=1&&n>=2&&(c>=1||h>=2)&&i>=5}function E(e){let r=[];return e.sharedHooks.length&&r.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&r.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&r.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&r.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&r.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&r.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&r.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),r.join("; ")||"shared React behavior profile"}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),S=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{F as a};
2
+ //# sourceMappingURL=chunk-RVWSAMTT.js.map
@@ -1,6 +1,6 @@
1
- import{a as m}from"./chunk-LGX2Y4BA.js";import{a as h}from"./chunk-T633QLYF.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
1
+ import{a as m}from"./chunk-RYXW3KRC.js";import{a as h}from"./chunk-PTQVNJ4Q.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
2
2
  `),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
3
3
  `);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
4
4
  `),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
- //# sourceMappingURL=chunk-SHM5D3DQ.js.map
6
+ //# sourceMappingURL=chunk-RXRLZFUL.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-T633QLYF.js";import{a as c}from"./chunk-64MNV6AB.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
2
- //# sourceMappingURL=chunk-LGX2Y4BA.js.map
1
+ import{a as u}from"./chunk-PTQVNJ4Q.js";import{a as c}from"./chunk-64MNV6AB.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
2
+ //# sourceMappingURL=chunk-RYXW3KRC.js.map
@@ -1,2 +1,2 @@
1
- import{a as I}from"./chunk-BJWNO6BU.js";import{a as H}from"./chunk-FGTHPJON.js";import{a as p}from"./chunk-L4QKEQ4S.js";import{a as T}from"./chunk-24S6MYOC.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-BJG67TCR.js";import{a as v,b as F}from"./chunk-5SMUKUV5.js";import{b as D}from"./chunk-C6BYNIH4.js";import{b as S}from"./chunk-KRGBLZT2.js";import{a as j}from"./chunk-RHKMQNFI.js";import{a as w}from"./chunk-FKUCFCLU.js";import{a as P}from"./chunk-EBIQY3RK.js";import{a as A}from"./chunk-3FYGJ2GY.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
- //# sourceMappingURL=chunk-B4EHYG6M.js.map
1
+ import{a as I}from"./chunk-MMLZEGMS.js";import{a as H}from"./chunk-J7RWXLUL.js";import{a as p}from"./chunk-WG6KRH5F.js";import{a as T}from"./chunk-3DGD6NKW.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-XXZXDXTD.js";import{a as v,b as F}from"./chunk-IPQTC36U.js";import{b as D}from"./chunk-65AU3HFZ.js";import{b as S}from"./chunk-BSN22NRK.js";import{a as j}from"./chunk-7UQWUVRG.js";import{a as w}from"./chunk-I46WR7MT.js";import{a as P}from"./chunk-56P7PDST.js";import{a as A}from"./chunk-ZQO43G2T.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
+ //# sourceMappingURL=chunk-SGLLBSCV.js.map
@@ -1,4 +1,4 @@
1
- import{b as j,g as G,h as J,i as B,p as Q}from"./chunk-AETMKBZR.js";import{a as W,b as U,d as K,f as q}from"./chunk-RSKOYTSY.js";import{a as O}from"./chunk-2YI45TNM.js";import{f as P,g as F,j as H,k as $}from"./chunk-X3BJUFSN.js";import{d as T,f as x}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-6TDOT7B3.js";import{a as N}from"./chunk-BTCASU5J.js";import{a as M}from"./chunk-DS6QEB3G.js";import{a as A,b as I,f as v,h as k}from"./chunk-C6ROZBJA.js";import{c as L,d as D}from"./chunk-7S5E7KWT.js";function Le(e,n,l={}){let o=Y(e,[n],{additive:l.additive,semantic:l.semantic}),s=l.callableOnly?(o.get(n.symbolId)??[]).filter(c=>x(c.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?s.slice(0,l.limit):s}function De(e,n,l={}){let o=ne(e)?oe(e,n,{semantic:l.semantic!==!1}):te(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var X=D("caller-rows",{clearGroups:["whole-project"]}),ee=2e4;function ne(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ee}function te(e){return X.get(e,()=>{let n=F(e),l=Y(e,n),o=new Map;for(let i of n)o.set(i.symbol,i.symbolId);let s=new Map,c=new Map;for(let i of n){let a=l.get(i.symbolId);if(!(!a||a.length===0))for(let d of a){let r=o.get(d.symbol);if(r===void 0||r===i.symbolId)continue;let m=s.get(r);m||(m=[],s.set(r,m),c.set(r,new Set));let u=`${i.symbol}|${i.relativePath}`;c.get(r).has(u)||(c.get(r).add(u),m.push({symbol:i.symbol,file:i.relativePath,source:"caller-map-inversion"}))}}return s})}function oe(e,n,l){let o=[],s=new Set,c=a=>{if(a.symbol===n.symbol)return;let d=`${a.symbol}|${a.file}`;s.has(d)||(s.add(d),o.push(a))};for(let a of Q(e,n))a.file!==n.relativePath&&c({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});let i=l.semantic?ie(e,n):null;if(i)for(let a of K(e,i)){if(a.file===n.relativePath||e.isIgnored(a.file))continue;let d=$(P(e,a.file),a.line);c({symbol:d?.symbol??a.file,file:a.file,source:"semantic-reference"})}return o}function ie(e,n){return e.get(`SELECT
1
+ import{b as j,g as G,h as J,i as B,p as Q}from"./chunk-F6ICF7HL.js";import{a as W,b as U,d as K,f as q}from"./chunk-4KTOV4QN.js";import{a as O}from"./chunk-VUKC6F77.js";import{f as P,g as F,k as H,l as $}from"./chunk-4N4WONI4.js";import{d as T,f as x}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-72KY2ZFO.js";import{a as N}from"./chunk-HF25DFSC.js";import{a as M}from"./chunk-DS6QEB3G.js";import{a as A,b as I,f as v,h as k}from"./chunk-XUGQU7PM.js";import{c as L,d as D}from"./chunk-7S5E7KWT.js";function Le(e,n,l={}){let o=Y(e,[n],{additive:l.additive,semantic:l.semantic}),s=l.callableOnly?(o.get(n.symbolId)??[]).filter(c=>x(c.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?s.slice(0,l.limit):s}function De(e,n,l={}){let o=ne(e)?oe(e,n,{semantic:l.semantic!==!1}):te(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var X=D("caller-rows",{clearGroups:["whole-project"]}),ee=2e4;function ne(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ee}function te(e){return X.get(e,()=>{let n=F(e),l=Y(e,n),o=new Map;for(let i of n)o.set(i.symbol,i.symbolId);let s=new Map,c=new Map;for(let i of n){let a=l.get(i.symbolId);if(!(!a||a.length===0))for(let d of a){let r=o.get(d.symbol);if(r===void 0||r===i.symbolId)continue;let m=s.get(r);m||(m=[],s.set(r,m),c.set(r,new Set));let u=`${i.symbol}|${i.relativePath}`;c.get(r).has(u)||(c.get(r).add(u),m.push({symbol:i.symbol,file:i.relativePath,source:"caller-map-inversion"}))}}return s})}function oe(e,n,l){let o=[],s=new Set,c=a=>{if(a.symbol===n.symbol)return;let d=`${a.symbol}|${a.file}`;s.has(d)||(s.add(d),o.push(a))};for(let a of Q(e,n))a.file!==n.relativePath&&c({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});let i=l.semantic?ie(e,n):null;if(i)for(let a of K(e,i)){if(a.file===n.relativePath||e.isIgnored(a.file))continue;let d=$(P(e,a.file),a.line);c({symbol:d?.symbol??a.file,file:a.file,source:"semantic-reference"})}return o}function ie(e,n){return e.get(`SELECT
2
2
  d.id AS documentId,
3
3
  gs.id AS symbolId,
4
4
  gs.symbol,
@@ -35,4 +35,4 @@ import{b as j,g as G,h as J,i as B,p as Q}from"./chunk-AETMKBZR.js";import{a as
35
35
  ) def_chunk ON def_chunk.symbol_id = gs.id
36
36
  WHERE gs.id IN (${t.map(()=>"?").join(",")})`,...t,...t)),a=R([...n.map(t=>t.documentId),...i.flatMap(t=>t.document_id===null?[]:[t.document_id])]),d=new Map(a.flatMap(t=>e.all(`SELECT id, relative_path FROM documents
37
37
  WHERE id IN (${t.map(()=>"?").join(",")})`,...t).map(b=>[b.id,b.relative_path]))),r=new Map;for(let t of i)r.has(t.symbol_id)||r.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?d.get(t.document_id)??"":""});let m=new Map,u=d;for(let t of n){let b=s.get(t.documentId)??[],p=new Set,g=[],h=null,Z=()=>{if(h)return h;let f=u.get(t.documentId)??"",y=new Set;if(f){let _=j(e,f),C=Math.max(0,t.startLine),w=Math.min(_.length-1,t.endLine);for(let S=C;S<=w;S+=1)for(let z of _[S])y.add(z)}return h=y,y};for(let f of b){if(f.symbol_id===t.symbolId)continue;let y=r.get(f.symbol_id);if(!y)continue;if(!(f.start_line>=t.startLine&&f.end_line<=t.endLine)){if(!(f.start_line<=t.endLine&&f.end_line>=t.startLine))continue;let S=T(y.symbol);if(!S||!Z().has(S))continue}let C=`${y.symbol}|${f.chunk_id}`;p.has(C)||(p.add(C),g.push({...y,chunkId:f.chunk_id,source:"scip-chunk"}))}m.set(t.symbolId,g)}return m}var V=500;function R(e){let n=[...new Set(e)],l=[];for(let o=0;o<n.length;o+=V)l.push(n.slice(o,o+V));return l}function fe(e){let n=new Map;for(let[l,o]of e){let s=[];for(let c of o)s.push({symbol:c.symbol,file:c.file,chunkId:-1,source:"semantic-callee"});n.set(l,s)}return n}export{Le as a,De as b,Y as c};
38
- //# sourceMappingURL=chunk-ZMU6IWDK.js.map
38
+ //# sourceMappingURL=chunk-SULEXAHO.js.map
@@ -1,2 +1,2 @@
1
- import{a as D}from"./chunk-XPOZO76D.js";import{p as A}from"./chunk-AETMKBZR.js";import{b as d,d as h,f as y}from"./chunk-RSKOYTSY.js";import{c as S}from"./chunk-JM72FNGA.js";function F(e,n={}){let{samples:o=50,scope:r,maxDisagreements:l=5}=n,s=new D(e),i=C(s.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o);if(i.length===0||!R(e,i))return{available:!1,sampleSize:i.length,oracleCoverage:0,scores:[],topDisagreements:[]};let c={references:v(),callees:v()},a=[],g=0,T=y(e,i);for(let t of i){let u=f(t,h(e,t).map(m=>m.file)),b=f(t,(T.get(t.symbolId)??[]).map(m=>m.file));if(u.size===0&&b.size===0)continue;g+=1;let Q=f(t,A(e,t).map(m=>m.file)),I=f(t,(s.calleeMap([t],{semantic:!1}).get(t.symbolId)??[]).map(m=>m.file));x(c.references,t,"references",Q,u,a),x(c.callees,t,"callees",I,b,a)}return a.sort((t,u)=>u.cheapOnly.length+u.oracleOnly.length-(t.cheapOnly.length+t.oracleOnly.length)),{available:!0,sampleSize:i.length,oracleCoverage:i.length>0?p(g/i.length):0,scores:["references","callees"].map(t=>O(t,c[t])),topDisagreements:a.slice(0,l)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function C(e,n){let o=[...e].sort((s,i)=>s.symbolId-i.symbolId);if(o.length<=n)return o;let r=o.length/n,l=[];for(let s=0;s<n;s++)l.push(o[Math.floor(s*r)]);return l}function R(e,n){let o=n[0];if(!o)return!1;try{return d(e,o.relativePath).availability().available}catch{return!1}}function f(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function x(e,n,o,r,l,s){if(r.size===0&&l.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=l.size;let i=[],c=[];for(let a of r)l.has(a)?e.agreed+=1:i.push(a);for(let a of l)r.has(a)||c.push(a);(i.length>0||c.length>0)&&s.push({symbol:S(n.symbol),question:o,cheapOnly:i,oracleOnly:c})}var z={references:!0,callees:!1};function O(e,n){let o=n.oracleTotal>0?n.agreed/n.oracleTotal:1,r=n.cheapTotal-n.agreed;return{question:e,comparedSymbols:n.comparedSymbols,precision:z[e]&&n.cheapTotal>0?p(n.agreed/n.cheapTotal):null,recall:p(o),unverified:r}}function p(e){return Math.round(e*1e3)/1e3}export{F as a};
2
- //# sourceMappingURL=chunk-KZYHFI2X.js.map
1
+ import{a as D}from"./chunk-GBEYTDY5.js";import{p as A}from"./chunk-F6ICF7HL.js";import{b as d,d as h,f as y}from"./chunk-4KTOV4QN.js";import{c as S}from"./chunk-JM72FNGA.js";function F(e,n={}){let{samples:o=50,scope:r,maxDisagreements:l=5}=n,s=new D(e),i=C(s.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o);if(i.length===0||!R(e,i))return{available:!1,sampleSize:i.length,oracleCoverage:0,scores:[],topDisagreements:[]};let c={references:v(),callees:v()},a=[],g=0,T=y(e,i);for(let t of i){let u=f(t,h(e,t).map(m=>m.file)),b=f(t,(T.get(t.symbolId)??[]).map(m=>m.file));if(u.size===0&&b.size===0)continue;g+=1;let Q=f(t,A(e,t).map(m=>m.file)),I=f(t,(s.calleeMap([t],{semantic:!1}).get(t.symbolId)??[]).map(m=>m.file));x(c.references,t,"references",Q,u,a),x(c.callees,t,"callees",I,b,a)}return a.sort((t,u)=>u.cheapOnly.length+u.oracleOnly.length-(t.cheapOnly.length+t.oracleOnly.length)),{available:!0,sampleSize:i.length,oracleCoverage:i.length>0?p(g/i.length):0,scores:["references","callees"].map(t=>O(t,c[t])),topDisagreements:a.slice(0,l)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function C(e,n){let o=[...e].sort((s,i)=>s.symbolId-i.symbolId);if(o.length<=n)return o;let r=o.length/n,l=[];for(let s=0;s<n;s++)l.push(o[Math.floor(s*r)]);return l}function R(e,n){let o=n[0];if(!o)return!1;try{return d(e,o.relativePath).availability().available}catch{return!1}}function f(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function x(e,n,o,r,l,s){if(r.size===0&&l.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=l.size;let i=[],c=[];for(let a of r)l.has(a)?e.agreed+=1:i.push(a);for(let a of l)r.has(a)||c.push(a);(i.length>0||c.length>0)&&s.push({symbol:S(n.symbol),question:o,cheapOnly:i,oracleOnly:c})}var z={references:!0,callees:!1};function O(e,n){let o=n.oracleTotal>0?n.agreed/n.oracleTotal:1,r=n.cheapTotal-n.agreed;return{question:e,comparedSymbols:n.comparedSymbols,precision:z[e]&&n.cheapTotal>0?p(n.agreed/n.cheapTotal):null,recall:p(o),unverified:r}}function p(e){return Math.round(e*1e3)/1e3}export{F as a};
2
+ //# sourceMappingURL=chunk-TH2N6QHW.js.map
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-YNSVAJR6.js";import{g as l}from"./chunk-X3BJUFSN.js";import{c as r}from"./chunk-JM72FNGA.js";function b(o,t={}){let{limit:n=30,scope:e}=t,i=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
1
+ import{a as d}from"./chunk-UQLFQLAF.js";import{g as l}from"./chunk-4N4WONI4.js";import{c as r}from"./chunk-JM72FNGA.js";function b(o,t={}){let{limit:n=30,scope:e}=t,i=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
2
2
  gs.symbol,
3
3
  COUNT(*) AS ref_count,
4
4
  COUNT(DISTINCT ref_d.id) AS file_count,
@@ -22,4 +22,4 @@ import{a as d}from"./chunk-YNSVAJR6.js";import{g as l}from"./chunk-X3BJUFSN.js";
22
22
  GROUP BY gs.id
23
23
  ORDER BY ref_count DESC
24
24
  LIMIT ?`,n).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in}));return m.length>0?m:f(o,e,n)}function f(o,t,n){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,i)=>i.refCount-e.refCount||i.fileCount-e.fileCount).slice(0,n)}function u(o,t){let n=d(o,t,{limit:500});return{symbol:t.symbol,shortName:r(t.symbol),refCount:n.length,fileCount:new Set(n.map(e=>e.file)).size,definedIn:t.relativePath}}export{b as a};
25
- //# sourceMappingURL=chunk-JRUKS66S.js.map
25
+ //# sourceMappingURL=chunk-TL6QPNF5.js.map
@@ -1,4 +1,4 @@
1
- import{a as R}from"./chunk-XPOZO76D.js";import{a as _,d as f}from"./chunk-ANIOISCE.js";import{a as c,b as m,c as s}from"./chunk-RY7CAOJF.js";import{c as d,e as p}from"./chunk-JM72FNGA.js";import{a as l}from"./chunk-DS6QEB3G.js";import{a}from"./chunk-64MNV6AB.js";function P(e,o={}){let{scope:r,limit:n}=o,t=new R(e),i=C([...h(e,r),...N(e,t,r)]);return D(i),n?i.slice(0,n):i}function h(e,o){let r=[];for(let n of E(e,o)){if(e.isIgnored(n.barrel_path)||e.isIgnored(n.original_path)||f(e,n.barrel_path)||l(e,n.barrel_path)&&s(e,n.barrel_path).length===0)continue;let t=S(e,n),i=t?.barrel_consumers??0,u=t?.direct_consumers??0;i!==0||u!==0||r.push({barrelFile:n.barrel_path,symbol:n.symbol,shortName:d(n.symbol),originalFile:n.original_path,barrelConsumers:i,directConsumers:u,...g(e,n.barrel_path)})}return r}function E(e,o){let r=o?`AND barrel_d.relative_path LIKE '%${o}%'`:"";return e.all(`SELECT DISTINCT
1
+ import{a as R}from"./chunk-GBEYTDY5.js";import{a as _,d as f}from"./chunk-C5CTSJ6X.js";import{a as c,b as m,c as s}from"./chunk-P5RYBRIO.js";import{c as d,e as p}from"./chunk-JM72FNGA.js";import{a as l}from"./chunk-DS6QEB3G.js";import{a}from"./chunk-64MNV6AB.js";function P(e,o={}){let{scope:r,limit:n}=o,t=new R(e),i=C([...h(e,r),...N(e,t,r)]);return D(i),n?i.slice(0,n):i}function h(e,o){let r=[];for(let n of E(e,o)){if(e.isIgnored(n.barrel_path)||e.isIgnored(n.original_path)||f(e,n.barrel_path)||l(e,n.barrel_path)&&s(e,n.barrel_path).length===0)continue;let t=S(e,n),i=t?.barrel_consumers??0,u=t?.direct_consumers??0;i!==0||u!==0||r.push({barrelFile:n.barrel_path,symbol:n.symbol,shortName:d(n.symbol),originalFile:n.original_path,barrelConsumers:i,directConsumers:u,...g(e,n.barrel_path)})}return r}function E(e,o){let r=o?`AND barrel_d.relative_path LIKE '%${o}%'`:"";return e.all(`SELECT DISTINCT
2
2
  barrel_d.id AS barrel_doc_id,
3
3
  barrel_d.relative_path AS barrel_path,
4
4
  gs.id AS symbol_id,
@@ -58,4 +58,4 @@ import{a as R}from"./chunk-XPOZO76D.js";import{a as _,d as f}from"./chunk-ANIOIS
58
58
  ${e.pathExclusionsFor("consumer_d")}
59
59
  GROUP BY consumer_d.id
60
60
  )`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function N(e,o,r){let n=[];for(let t of y(e,r))x(e,t,t)>0||n.push(...I(e,o,t));return n}function y(e,o){return a(e,{scope:o,includeIgnored:!1}).filter(r=>s(e,r).length>0||c(e,r).length>0)}function I(e,o,r){let n=s(e,r).filter(i=>i.sourcePath&&!e.isIgnored(i.sourcePath)).flatMap(i=>b(e,o,r,i.sourcePath)),t=c(e,r).filter(i=>i.sourcePath&&!e.isIgnored(i.sourcePath)).flatMap(i=>b(e,o,r,i.sourcePath));return[...n,...t]}function b(e,o,r,n){let t=O(o,n);return t?[{barrelFile:r,symbol:t.symbol,shortName:d(t.symbol),originalFile:n,barrelConsumers:0,directConsumers:x(e,n,r),...g(e,r)}]:[]}function g(e,o){return _(e,o)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function x(e,o,r){let n=new Set;for(let t of a(e,{includeIgnored:!1}))if(t!==r)for(let i of m(e,t))i.sourcePath===o&&n.add(t);return n.size}function O(e,o){let r=e.definitionsForFile(o);return r.find(n=>p(n.symbol)==="method")??r[0]??null}function C(e){let o=new Set,r=[];for(let n of e){let t=`${n.barrelFile}|${n.symbol}|${n.originalFile}`;o.has(t)||(o.add(t),r.push(n))}return r}function D(e){e.sort((o,r)=>r.directConsumers-o.directConsumers||o.barrelFile.localeCompare(r.barrelFile)||o.shortName.localeCompare(r.shortName))}export{P as a};
61
- //# sourceMappingURL=chunk-JUIAOOK7.js.map
61
+ //# sourceMappingURL=chunk-UDGXK2WA.js.map
@@ -1,4 +1,4 @@
1
- import{a as r}from"./chunk-LGX2Y4BA.js";import{a as l}from"./chunk-T633QLYF.js";import{a as c}from"./chunk-2YI45TNM.js";import{c as d}from"./chunk-JM72FNGA.js";function p(e,t){let o=l(e,t);if(!o)return[];let n=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
1
+ import{a as r}from"./chunk-RYXW3KRC.js";import{a as l}from"./chunk-PTQVNJ4Q.js";import{a as c}from"./chunk-VUKC6F77.js";import{c as d}from"./chunk-JM72FNGA.js";function p(e,t){let o=l(e,t);if(!o)return[];let n=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 r}from"./chunk-LGX2Y4BA.js";import{a as l}from"./chunk-T633QLYF.js";
59
59
  GROUP BY d.id
60
60
  ORDER BY symbol_count DESC
61
61
  LIMIT ?`,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}))}export{p as a,b,y as c,I as d};
62
- //# sourceMappingURL=chunk-Q34NWRPP.js.map
62
+ //# sourceMappingURL=chunk-UFX7EPBA.js.map
@@ -0,0 +1,2 @@
1
+ import{b as k}from"./chunk-SULEXAHO.js";import{e as g,g as R,h as M,i as C,o as D}from"./chunk-F6ICF7HL.js";import{e as h}from"./chunk-4KTOV4QN.js";import{g as S}from"./chunk-4N4WONI4.js";import{d as y}from"./chunk-JM72FNGA.js";import{d as p,f as b}from"./chunk-72KY2ZFO.js";import{a as d}from"./chunk-HF25DFSC.js";import{a as m}from"./chunk-64MNV6AB.js";function L(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let r=m(e,{includeIgnored:!1}),a=C(e),i=n??S(e),l=new Set(i.map(c=>c.symbolId)),s=F(i);return I(e,o,r,a,l,s),w(e,o,i,l),_(e,o,r,a,l,s),t.semantic!==!1&&V(o,h(e,j(i))),o}function I(e,n,t,o,r,a){for(let i of t){if(!d(i))continue;let l=p(e,i);if(l)for(let s of l){if(a&&!a.has(s.calleeLeaf))continue;let c=R(i,o.get(s.calleeLeaf)??[]);if(!c||c.length===0)continue;let f=M(e,i,c,s.memberAccess);f&&r.has(f.symbolId)&&f.file!==i&&u(n,f.symbolId,i)}}}function w(e,n,t,o){let r=x(t);for(let a of v(e,o))e.isIgnored(a.relative_path)||A(a,r.get(a.symbol_id))||u(n,a.symbol_id,a.relative_path)}function v(e,n){return g(e,n?[...n]:void 0)}function x(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function A(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function _(e,n,t,o,r,a){for(let i of t){if(d(i)!=="rust")continue;let l=b(e,i,{includeRustAttributeNames:!0});if(l.length!==0)for(let{name:s}of l){if(a&&!a.has(s))continue;let c=o.get(s);if(c)for(let f of c)r.has(f.symbolId)&&f.file!==i&&u(n,f.symbolId,i)}}}function u(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function F(e){let n=new Set;for(let t of e){let o="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?y(t.symbol):"";o&&n.add(o)}return n.size>0?n:null}function j(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function V(e,n){for(let[t,o]of n){let r=e.get(t);r||(r=new Set,e.set(t,r));for(let a of o)r.add(a)}}function W(e,n,t={}){return k(e,n,t)}function K(e,n,t={}){return L(e,n,t)}function G(e,n){return D(e,n)}function X(e,n,t={}){let o=K(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:E(o,G(e,n))}function E(e,n){let t=new Map;for(let[o,r]of e)t.set(o,new Set(r));for(let[o,r]of n){let a=t.get(o)??new Set;for(let i of r)a.add(i);t.set(o,a)}return t}export{W as a,K as b,G as c,X as d,E as e};
2
+ //# sourceMappingURL=chunk-UQLFQLAF.js.map
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-VFLHKRTW.js";import{a as C}from"./chunk-XPOZO76D.js";import{a as k}from"./chunk-T633QLYF.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as f}from"path";var j=20,z=1,_=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),G=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),O=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function De(e,n={}){let t=L(n.limit,j),i=L(n.minConsumers,z),o=new C(e),s=o.fileDependencyGraph(n.scope),r=de(p(e,{includeIgnored:!1})),c=fe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?q(e,o,n.target):Y(e,n.scope,n.scanLimit)).map(a=>K(o,s,a,n,r,c)).filter(a=>a.consumerFiles.length>=i||n.target).sort(ue).slice(0,t)}function q(e,n,t){let i=V(e,t);if(i)return[N(i)];let o=k(e,t);if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(r=>r.symbolId===o.symbolId);return s?[X(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:b(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function Y(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),o=L(t,i.length);return i.slice(0,o).map(s=>N(s))}function K(e,n,t,i,o,s){let r=t.definition?J(e,t.definition,i.semantic):Q(n,t.unit.file),c=t.definition?r.length>0?"exact":"none":r.length>0?"file-level":"none",m=t.unit.file,l=u(f.dirname(m)),a=ee(r),h=Z(l),B=w([...F(l),...a?F(a):[]]),y=ne(t.unit,l,a,r),g=te(y,t.unit,l,a,r,o,s),E=ae(t.unit,c,a,r,l,g.whyNoSuggestedHome),W=ce(t.unit,l,a,r,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:t.unit,candidatePath:m,currentDirectory:l,directoryAncestry:h,consumerFiles:r,consumerCoverage:c,nearestCommonOwner:a,boundaryMarkers:B,recommendedTier:y,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:E,reasons:W,recommendation:le(y,g.suggestedHome,c)}}function J(e,n,t){let i=A(e,[n],{semantic:t!==!1,sourceFallback:!0});return H(i.get(n.symbolId)??[])}function Q(e,n){let t=[];for(let[i,o]of e.entries())i!==n&&o.has(n)&&t.push(i);return H(t)}function V(e,n){let t=D(n),i=p(e,{includeIgnored:!1}),o=i.find(r=>r===t);if(o)return o;let s=i.find(r=>r.endsWith(`/${t}`));return s||(i.find(r=>r.includes(t))??null)}function X(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:b(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function N(e){return{unit:{kind:"file",file:e,shortName:f.basename(e)}}}function Z(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let o=t.slice(0,i+1).join("/");n.push({path:o,depth:i,markers:v(o)})}return n}function F(e){return e==="."?[]:I(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function v(e){return w(I(e).map(({marker:n})=>n))}function I(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let o=_.get(n[i]);o&&t.push({marker:o,prefix:n.slice(0,i+1).join("/")})}return t}function ee(e){if(e.length===0)return null;let n=e.map(i=>u(f.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let o=i.split("/").filter(Boolean),s=[],r=Math.min(t.length,o.length);for(let c=0;c<r&&t[c]===o[c];c+=1)s.push(t[c]);t=s}return t.length===0?".":t.join("/")}function ne(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":R(t,"package")?"package-level-shared":R(t,"app")?"app-level-shared":U(t,["feature","domain","module"])||U(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function te(e,n,t,i,o,s,r){let c=ie(e,i);if(c)return d(c);let m=me(n.file),l=re(e,t,m,o,r);if(l)return l;let a=i;if(u(t)===u(a))return d(`${t} is already the nearest common owner for its consumers.`);let h=oe(a,t,m,r);return h||se(a,t,m,s,r)}function ie(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function re(e,n,t,i,o){if(e==="same-file"){let s=i[0]??null;return s?S(s):d("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=u(f.dirname(i[0])),r=M(n,t,s,o);return r?d(r):S(s)}return null}function oe(e,n,t,i){return pe(e)?$(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function se(e,n,t,i,o){if(e===".")return d("The nearest common owner is the repository root.");let s=`${e}/shared`,r=$(s,n,t,o,`Proposed home ${s} is outside source root ${t}.`);return r.confidence==="withheld"||i.has(s)?r:d(`${s} does not exist in the indexed project.`)}function $(e,n,t,i,o){if(!P(e,t))return d(o);let s=M(n,t,e,i);return s?d(s):S(e)}function S(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function d(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ae(e,n,t,i,o,s){let r=["Report-only signal; review ownership before moving files."];return n==="none"&&r.push("No consumers were found in the current index."),n==="file-level"&&r.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&r.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&r.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&r.push("File targets describe module locality, not symbol-level usage."),t&&o.startsWith(`${t}/`)&&r.push("Candidate already lives under the nearest common owner."),s&&r.push(`No exact suggested home: ${s}`),r}function ce(e,n,t,i,o,s){let r=[];return r.push(`${e.shortName} currently lives in ${n}.`),t?r.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):r.push("No consumer owner could be inferred from the current index."),o?r.push(`Suggested home is ${o}.`):s&&r.push(`No exact suggested home: ${s}`),r}function le(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ue(e,n){return T(n)-T(e)||e.candidatePath.localeCompare(n.candidatePath)}function T(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n-=8),e.recommendedTier==="no-exact-consumers"&&(n-=12),n}function de(e){let n=new Set(["."]);for(let t of e){let i=u(f.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=u(f.dirname(i))}return n}function me(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function P(e,n){let t=u(e),i=u(n);return i==="."||t===i||t.startsWith(`${i}/`)}function ge(e,n,t){let i=x(e),o=x(n);return(P(e,n)?i.slice(o.length):i).some(r=>t.has(r.toLowerCase()))}function M(e,n,t,i){return u(e)===u(t)||!ge(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function fe(...e){let n=new Set(O);for(let t of e)for(let i of t??[]){let o=he(i);o&&n.add(o)}return n}function he(e){let n=e.trim().toLowerCase();return n===""?null:n}function R(e,n){return v(e).includes(n)}function U(e,n){let t=v(e);return n.some(i=>t.includes(i))}function pe(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?G.has(t):!1}function D(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function u(e){let n=D(e);return n===""?".":n}function x(e){let n=D(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{De as a};
2
- //# sourceMappingURL=chunk-VXT7WVIN.js.map
1
+ import{a as A}from"./chunk-GRJY65YT.js";import{a as C}from"./chunk-GBEYTDY5.js";import{a as k}from"./chunk-PTQVNJ4Q.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as f}from"path";var j=20,z=1,_=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),G=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),O=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function De(e,n={}){let t=L(n.limit,j),i=L(n.minConsumers,z),o=new C(e),s=o.fileDependencyGraph(n.scope),r=de(p(e,{includeIgnored:!1})),c=fe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?q(e,o,n.target):Y(e,n.scope,n.scanLimit)).map(a=>K(o,s,a,n,r,c)).filter(a=>a.consumerFiles.length>=i||n.target).sort(ue).slice(0,t)}function q(e,n,t){let i=V(e,t);if(i)return[N(i)];let o=k(e,t);if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(r=>r.symbolId===o.symbolId);return s?[X(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:b(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function Y(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),o=L(t,i.length);return i.slice(0,o).map(s=>N(s))}function K(e,n,t,i,o,s){let r=t.definition?J(e,t.definition,i.semantic):Q(n,t.unit.file),c=t.definition?r.length>0?"exact":"none":r.length>0?"file-level":"none",m=t.unit.file,l=u(f.dirname(m)),a=ee(r),h=Z(l),B=w([...F(l),...a?F(a):[]]),y=ne(t.unit,l,a,r),g=te(y,t.unit,l,a,r,o,s),E=ae(t.unit,c,a,r,l,g.whyNoSuggestedHome),W=ce(t.unit,l,a,r,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:t.unit,candidatePath:m,currentDirectory:l,directoryAncestry:h,consumerFiles:r,consumerCoverage:c,nearestCommonOwner:a,boundaryMarkers:B,recommendedTier:y,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:E,reasons:W,recommendation:le(y,g.suggestedHome,c)}}function J(e,n,t){let i=A(e,[n],{semantic:t!==!1,sourceFallback:!0});return H(i.get(n.symbolId)??[])}function Q(e,n){let t=[];for(let[i,o]of e.entries())i!==n&&o.has(n)&&t.push(i);return H(t)}function V(e,n){let t=D(n),i=p(e,{includeIgnored:!1}),o=i.find(r=>r===t);if(o)return o;let s=i.find(r=>r.endsWith(`/${t}`));return s||(i.find(r=>r.includes(t))??null)}function X(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:b(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function N(e){return{unit:{kind:"file",file:e,shortName:f.basename(e)}}}function Z(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let o=t.slice(0,i+1).join("/");n.push({path:o,depth:i,markers:v(o)})}return n}function F(e){return e==="."?[]:I(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function v(e){return w(I(e).map(({marker:n})=>n))}function I(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let o=_.get(n[i]);o&&t.push({marker:o,prefix:n.slice(0,i+1).join("/")})}return t}function ee(e){if(e.length===0)return null;let n=e.map(i=>u(f.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let o=i.split("/").filter(Boolean),s=[],r=Math.min(t.length,o.length);for(let c=0;c<r&&t[c]===o[c];c+=1)s.push(t[c]);t=s}return t.length===0?".":t.join("/")}function ne(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":R(t,"package")?"package-level-shared":R(t,"app")?"app-level-shared":U(t,["feature","domain","module"])||U(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function te(e,n,t,i,o,s,r){let c=ie(e,i);if(c)return d(c);let m=me(n.file),l=re(e,t,m,o,r);if(l)return l;let a=i;if(u(t)===u(a))return d(`${t} is already the nearest common owner for its consumers.`);let h=oe(a,t,m,r);return h||se(a,t,m,s,r)}function ie(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function re(e,n,t,i,o){if(e==="same-file"){let s=i[0]??null;return s?S(s):d("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=u(f.dirname(i[0])),r=M(n,t,s,o);return r?d(r):S(s)}return null}function oe(e,n,t,i){return pe(e)?$(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function se(e,n,t,i,o){if(e===".")return d("The nearest common owner is the repository root.");let s=`${e}/shared`,r=$(s,n,t,o,`Proposed home ${s} is outside source root ${t}.`);return r.confidence==="withheld"||i.has(s)?r:d(`${s} does not exist in the indexed project.`)}function $(e,n,t,i,o){if(!P(e,t))return d(o);let s=M(n,t,e,i);return s?d(s):S(e)}function S(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function d(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ae(e,n,t,i,o,s){let r=["Report-only signal; review ownership before moving files."];return n==="none"&&r.push("No consumers were found in the current index."),n==="file-level"&&r.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&r.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&r.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&r.push("File targets describe module locality, not symbol-level usage."),t&&o.startsWith(`${t}/`)&&r.push("Candidate already lives under the nearest common owner."),s&&r.push(`No exact suggested home: ${s}`),r}function ce(e,n,t,i,o,s){let r=[];return r.push(`${e.shortName} currently lives in ${n}.`),t?r.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):r.push("No consumer owner could be inferred from the current index."),o?r.push(`Suggested home is ${o}.`):s&&r.push(`No exact suggested home: ${s}`),r}function le(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ue(e,n){return T(n)-T(e)||e.candidatePath.localeCompare(n.candidatePath)}function T(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n-=8),e.recommendedTier==="no-exact-consumers"&&(n-=12),n}function de(e){let n=new Set(["."]);for(let t of e){let i=u(f.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=u(f.dirname(i))}return n}function me(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function P(e,n){let t=u(e),i=u(n);return i==="."||t===i||t.startsWith(`${i}/`)}function ge(e,n,t){let i=x(e),o=x(n);return(P(e,n)?i.slice(o.length):i).some(r=>t.has(r.toLowerCase()))}function M(e,n,t,i){return u(e)===u(t)||!ge(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function fe(...e){let n=new Set(O);for(let t of e)for(let i of t??[]){let o=he(i);o&&n.add(o)}return n}function he(e){let n=e.trim().toLowerCase();return n===""?null:n}function R(e,n){return v(e).includes(n)}function U(e,n){let t=v(e);return n.some(i=>t.includes(i))}function pe(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?G.has(t):!1}function D(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function u(e){let n=D(e);return n===""?".":n}function x(e){let n=D(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{De as a};
2
+ //# sourceMappingURL=chunk-UWYJDBDW.js.map
@@ -1,4 +1,4 @@
1
- import{a as t}from"./chunk-LGX2Y4BA.js";function l(e,n,i){let d=t(e,n)??n,o=t(e,i)??i,r=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
1
+ import{a as t}from"./chunk-RYXW3KRC.js";function l(e,n,i){let d=t(e,n)??n,o=t(e,i)??i,r=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 t}from"./chunk-LGX2Y4BA.js";function l(e,n,i){let d=t(e,n)??n,o=t(e,
53
53
  GROUP BY def_d.id, ref_d.id
54
54
  ORDER BY shared DESC
55
55
  LIMIT ?`,i).filter(s=>!e.isIgnored(s.file1)&&!e.isIgnored(s.file2)).map(s=>c(s.file1,s.file2,s.shared))}function c(e,n,i){return{file1:e,file2:n,sharedSymbols:i,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${i} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{l as a,_ as b};
56
- //# sourceMappingURL=chunk-GZQID3FS.js.map
56
+ //# sourceMappingURL=chunk-UYD7FJ3K.js.map
@@ -1,4 +1,4 @@
1
- import{b as c}from"./chunk-RY7CAOJF.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
1
+ import{b as c}from"./chunk-P5RYBRIO.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
2
2
  d1.relative_path AS from_file,
3
3
  d2.relative_path AS to_file
4
4
  FROM mentions m
@@ -17,4 +17,4 @@ import{b as c}from"./chunk-RY7CAOJF.js";import{a}from"./chunk-64MNV6AB.js";impor
17
17
  AND m.role != 1
18
18
  ${e.pathExclusionsFor("d1","d2")}
19
19
  ${s}`)}function f(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}export{p as a};
20
- //# sourceMappingURL=chunk-2YI45TNM.js.map
20
+ //# sourceMappingURL=chunk-VUKC6F77.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-XPOZO76D.js";import{a as h}from"./chunk-ZMU6IWDK.js";import{q as S}from"./chunk-AETMKBZR.js";import{a as d,b}from"./chunk-T633QLYF.js";import{k as y}from"./chunk-X3BJUFSN.js";import{c as m}from"./chunk-JM72FNGA.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
2
- //# sourceMappingURL=chunk-L4QKEQ4S.js.map
1
+ import{a as u}from"./chunk-GBEYTDY5.js";import{a as h}from"./chunk-SULEXAHO.js";import{q as S}from"./chunk-F6ICF7HL.js";import{a as d,b}from"./chunk-PTQVNJ4Q.js";import{l as y}from"./chunk-4N4WONI4.js";import{c as m}from"./chunk-JM72FNGA.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
2
+ //# sourceMappingURL=chunk-WG6KRH5F.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-ZMU6IWDK.js";import{a as u}from"./chunk-T633QLYF.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-LWTML2AN.js.map
1
+ import{a as g}from"./chunk-SULEXAHO.js";import{a as u}from"./chunk-PTQVNJ4Q.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
+ //# sourceMappingURL=chunk-XIVO4SDZ.js.map
@@ -1,3 +1,3 @@
1
- import{q as d}from"./chunk-AETMKBZR.js";import{a as h}from"./chunk-T633QLYF.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
1
+ import{q as d}from"./chunk-F6ICF7HL.js";import{a as h}from"./chunk-PTQVNJ4Q.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
2
2
  `);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
3
- //# sourceMappingURL=chunk-N7F5UM6J.js.map
3
+ //# sourceMappingURL=chunk-XSNRACLV.js.map