scip-query 0.6.9 → 0.7.1

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 (220) hide show
  1. package/README.md +3 -1
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-23YIGCYF.js +25 -0
  4. package/dist/{chunk-V4WRHJU3.js → chunk-2IYEIFPP.js} +6 -6
  5. package/dist/chunk-2JEFS2YJ.js +2 -0
  6. package/dist/chunk-33SSUPCB.js +7 -0
  7. package/dist/chunk-3GNFUVFA.js +2 -0
  8. package/dist/chunk-3OUC276S.js +2 -0
  9. package/dist/{chunk-JLFAQ2E2.js → chunk-4STLJYHI.js} +4 -4
  10. package/dist/chunk-563HLCDW.js +35 -0
  11. package/dist/chunk-5TT47UMX.js +44 -0
  12. package/dist/chunk-6H2XIIPY.js +71 -0
  13. package/dist/{chunk-I5BB33E6.js → chunk-72JOIFXL.js} +3 -3
  14. package/dist/chunk-7H4RJ4MC.js +2 -0
  15. package/dist/chunk-7O4MJYIW.js +63 -0
  16. package/dist/chunk-7OX2O53H.js +62 -0
  17. package/dist/chunk-A2AVLALL.js +2 -0
  18. package/dist/chunk-AQYBOORI.js +2 -0
  19. package/dist/chunk-ARBZM2NF.js +34 -0
  20. package/dist/{chunk-GRAEZYYU.js → chunk-BI4F6GXI.js} +2 -2
  21. package/dist/chunk-BOVNTAKQ.js +3 -0
  22. package/dist/chunk-CKIO6SVS.js +2 -0
  23. package/dist/chunk-D6Z67MZL.js +2 -0
  24. package/dist/chunk-DFK54IRN.js +2 -0
  25. package/dist/chunk-FD37DBTD.js +2 -0
  26. package/dist/chunk-FOQQDXE7.js +2 -0
  27. package/dist/chunk-GAQGJ52J.js +11 -0
  28. package/dist/chunk-IODTPF5H.js +20 -0
  29. package/dist/chunk-J6Z5YKGQ.js +4 -0
  30. package/dist/chunk-JB4PUN5S.js +40 -0
  31. package/dist/chunk-JTXKS5GK.js +3 -0
  32. package/dist/chunk-KJ3ZJIE5.js +2 -0
  33. package/dist/chunk-KJ6CW6EK.js +2 -0
  34. package/dist/{chunk-AXHDRSRI.js → chunk-KNA6Z7JB.js} +3 -3
  35. package/dist/{chunk-U3GYMGBX.js → chunk-LDV2B7ET.js} +8 -8
  36. package/dist/chunk-LWYIGRHR.js +5 -0
  37. package/dist/chunk-MDAYGS6T.js +2 -0
  38. package/dist/chunk-MX6F756F.js +2 -0
  39. package/dist/chunk-NHDPYW7O.js +2 -0
  40. package/dist/{chunk-IIKNAXAE.js → chunk-NKJKI6SE.js} +2 -2
  41. package/dist/chunk-NN3O7TPH.js +8 -0
  42. package/dist/chunk-NSTZMBAB.js +18 -0
  43. package/dist/chunk-NYEMZHUC.js +6 -0
  44. package/dist/chunk-OHEIZWIA.js +4 -0
  45. package/dist/chunk-PG3ZI5IH.js +2 -0
  46. package/dist/chunk-QAEDNTY7.js +2 -0
  47. package/dist/chunk-QE6MGGUY.js +2 -0
  48. package/dist/chunk-QPRIYXH4.js +2 -0
  49. package/dist/chunk-QWJBIBE6.js +3 -0
  50. package/dist/chunk-RCJEFQOK.js +4 -0
  51. package/dist/chunk-ROOHENEP.js +61 -0
  52. package/dist/{chunk-3JGBAAP7.js → chunk-ROZNBWIF.js} +2 -2
  53. package/dist/chunk-TGK5DFBJ.js +2 -0
  54. package/dist/chunk-TKDJQ2WD.js +59 -0
  55. package/dist/chunk-TRNAQABL.js +7 -0
  56. package/dist/chunk-U75WH4XG.js +2 -0
  57. package/dist/chunk-V53J46BX.js +2 -0
  58. package/dist/chunk-V76FCF5F.js +2 -0
  59. package/dist/chunk-VUBQBW7H.js +16 -0
  60. package/dist/chunk-WJQY2LGT.js +2 -0
  61. package/dist/{chunk-ZO5IFJRM.js → chunk-WODJHE6Z.js} +3 -3
  62. package/dist/{chunk-IX45SWX5.js → chunk-WPLKHAH7.js} +4 -4
  63. package/dist/chunk-XO6R3X5J.js +2 -0
  64. package/dist/chunk-YSZNAG4G.js +2 -0
  65. package/dist/chunk-ZNUPGRPR.js +3 -0
  66. package/dist/{chunk-UIM4WALN.js → chunk-ZXFTC5ET.js} +4 -4
  67. package/dist/cli.js +364 -527
  68. package/dist/config-types-CGIeLEpY.d.ts +108 -0
  69. package/dist/db-DdTPetj5.d.ts +69 -0
  70. package/dist/health-x7B4Xu_6.d.ts +119 -0
  71. package/dist/index.d.ts +100 -334
  72. package/dist/index.js +3 -131
  73. package/dist/postinstall.js +1 -1
  74. package/dist/queries/affected.d.ts +9 -2
  75. package/dist/queries/affected.js +1 -1
  76. package/dist/queries/bottlenecks.d.ts +12 -2
  77. package/dist/queries/bottlenecks.js +1 -1
  78. package/dist/queries/by-kind.d.ts +12 -2
  79. package/dist/queries/by-kind.js +1 -1
  80. package/dist/queries/call-graph.d.ts +19 -2
  81. package/dist/queries/call-graph.js +1 -1
  82. package/dist/queries/change-surface.d.ts +16 -2
  83. package/dist/queries/change-surface.js +1 -1
  84. package/dist/queries/code.d.ts +12 -2
  85. package/dist/queries/code.js +1 -1
  86. package/dist/queries/complexity-hotspots.d.ts +15 -2
  87. package/dist/queries/complexity-hotspots.js +1 -1
  88. package/dist/queries/complexity.d.ts +19 -2
  89. package/dist/queries/complexity.js +1 -1
  90. package/dist/queries/convergence.d.ts +22 -2
  91. package/dist/queries/convergence.js +1 -1
  92. package/dist/queries/coupling.d.ts +8 -2
  93. package/dist/queries/coupling.js +1 -1
  94. package/dist/queries/cycles.d.ts +16 -2
  95. package/dist/queries/cycles.js +1 -1
  96. package/dist/queries/dataflow.d.ts +32 -2
  97. package/dist/queries/dataflow.js +1 -1
  98. package/dist/queries/dead.d.ts +34 -2
  99. package/dist/queries/dead.js +1 -1
  100. package/dist/queries/deep-chains.d.ts +8 -2
  101. package/dist/queries/deep-chains.js +1 -1
  102. package/dist/queries/deps.d.ts +6 -2
  103. package/dist/queries/deps.js +1 -1
  104. package/dist/queries/diff-impact.d.ts +22 -2
  105. package/dist/queries/diff-impact.js +1 -1
  106. package/dist/queries/drift.d.ts +18 -2
  107. package/dist/queries/drift.js +1 -1
  108. package/dist/queries/extract-candidates.d.ts +19 -2
  109. package/dist/queries/extract-candidates.js +1 -1
  110. package/dist/queries/fan.d.ts +7 -2
  111. package/dist/queries/fan.js +1 -1
  112. package/dist/queries/files.d.ts +6 -2
  113. package/dist/queries/files.js +1 -1
  114. package/dist/queries/health.d.ts +4 -81
  115. package/dist/queries/health.js +1 -1
  116. package/dist/queries/hierarchy.d.ts +8 -2
  117. package/dist/queries/hierarchy.js +1 -1
  118. package/dist/queries/hotspots.d.ts +10 -2
  119. package/dist/queries/hotspots.js +1 -1
  120. package/dist/queries/imports.d.ts +13 -2
  121. package/dist/queries/imports.js +1 -1
  122. package/dist/queries/index.d.ts +45 -44
  123. package/dist/queries/index.js +1 -1
  124. package/dist/queries/isolated.d.ts +11 -2
  125. package/dist/queries/isolated.js +1 -1
  126. package/dist/queries/members.d.ts +10 -2
  127. package/dist/queries/members.js +1 -1
  128. package/dist/queries/methods.d.ts +8 -2
  129. package/dist/queries/methods.js +1 -1
  130. package/dist/queries/outline.d.ts +10 -2
  131. package/dist/queries/outline.js +1 -1
  132. package/dist/queries/passthrough-candidates.d.ts +14 -2
  133. package/dist/queries/passthrough-candidates.js +1 -1
  134. package/dist/queries/redundant-reexports.d.ts +13 -2
  135. package/dist/queries/redundant-reexports.js +1 -1
  136. package/dist/queries/refs.d.ts +7 -2
  137. package/dist/queries/refs.js +1 -1
  138. package/dist/queries/similar-chains.d.ts +21 -2
  139. package/dist/queries/similar-chains.js +1 -1
  140. package/dist/queries/similar-files.d.ts +12 -2
  141. package/dist/queries/similar-files.js +1 -1
  142. package/dist/queries/similar-signatures.d.ts +16 -2
  143. package/dist/queries/similar-signatures.js +1 -1
  144. package/dist/queries/similar.d.ts +21 -2
  145. package/dist/queries/similar.js +1 -1
  146. package/dist/queries/slice.d.ts +16 -2
  147. package/dist/queries/slice.js +1 -1
  148. package/dist/queries/stale-abstractions.d.ts +36 -3
  149. package/dist/queries/stale-abstractions.js +1 -1
  150. package/dist/queries/stats.d.ts +11 -2
  151. package/dist/queries/stats.js +1 -1
  152. package/dist/queries/surface.d.ts +8 -2
  153. package/dist/queries/surface.js +1 -1
  154. package/dist/queries/symbols.d.ts +10 -2
  155. package/dist/queries/symbols.js +1 -1
  156. package/dist/queries/system.d.ts +10 -2
  157. package/dist/queries/system.js +1 -1
  158. package/dist/queries/trace.d.ts +18 -2
  159. package/dist/queries/trace.js +1 -1
  160. package/dist/queries/wrapper-candidates.d.ts +14 -2
  161. package/dist/queries/wrapper-candidates.js +1 -1
  162. package/dist/reindex-worker.js +10 -10
  163. package/dist/reindex.d.ts +153 -0
  164. package/dist/reindex.js +69 -0
  165. package/dist/runtime.d.ts +108 -0
  166. package/dist/runtime.js +3 -0
  167. package/dist/scip-cli-a-xOztiK.d.ts +20 -0
  168. package/package.json +184 -4
  169. package/dist/chunk-2OP63JQQ.js +0 -2
  170. package/dist/chunk-33Z6HQBX.js +0 -5
  171. package/dist/chunk-3F453KPT.js +0 -2
  172. package/dist/chunk-3PKPUCIJ.js +0 -11
  173. package/dist/chunk-42BWO2NN.js +0 -2
  174. package/dist/chunk-4MDCFY3E.js +0 -2
  175. package/dist/chunk-4QWTQ6YV.js +0 -2
  176. package/dist/chunk-5IRX5I64.js +0 -5
  177. package/dist/chunk-5MPZ2A7J.js +0 -2
  178. package/dist/chunk-67OMD56K.js +0 -90
  179. package/dist/chunk-6UVVA5I4.js +0 -7
  180. package/dist/chunk-BAA4EJRX.js +0 -2
  181. package/dist/chunk-BT36WY5B.js +0 -114
  182. package/dist/chunk-CLKFDBS6.js +0 -39
  183. package/dist/chunk-CWMWTHV3.js +0 -2
  184. package/dist/chunk-DXO2ECRF.js +0 -7
  185. package/dist/chunk-EHEZLULQ.js +0 -85
  186. package/dist/chunk-FVH3Y44U.js +0 -1
  187. package/dist/chunk-GWBRU65E.js +0 -2
  188. package/dist/chunk-H4DXD2FB.js +0 -5
  189. package/dist/chunk-I2KUHGMX.js +0 -16
  190. package/dist/chunk-JMASYYSW.js +0 -2
  191. package/dist/chunk-KAM4C6ZD.js +0 -4
  192. package/dist/chunk-LBWLO7NA.js +0 -70
  193. package/dist/chunk-LJ2YWNQF.js +0 -2
  194. package/dist/chunk-LLDPR3DG.js +0 -6
  195. package/dist/chunk-LNUZWWWL.js +0 -2
  196. package/dist/chunk-NLJCXHFU.js +0 -84
  197. package/dist/chunk-NRAJIFQA.js +0 -2
  198. package/dist/chunk-OYRGWW6Z.js +0 -2
  199. package/dist/chunk-PVMRIOM6.js +0 -33
  200. package/dist/chunk-QRYEOK3M.js +0 -2
  201. package/dist/chunk-SF2HYG53.js +0 -4
  202. package/dist/chunk-SHGPRVWH.js +0 -2
  203. package/dist/chunk-SMOUOKAO.js +0 -2
  204. package/dist/chunk-TBJDUS4E.js +0 -71
  205. package/dist/chunk-TPXWXKL6.js +0 -2
  206. package/dist/chunk-TTCUMJ43.js +0 -19
  207. package/dist/chunk-TYR7QY5G.js +0 -2
  208. package/dist/chunk-UZG3QXTG.js +0 -2
  209. package/dist/chunk-VDMRAGBK.js +0 -6
  210. package/dist/chunk-W6SRVK2Y.js +0 -5
  211. package/dist/chunk-WGYJDGBI.js +0 -25
  212. package/dist/chunk-WYX3RU2K.js +0 -2
  213. package/dist/chunk-WZYA234B.js +0 -2
  214. package/dist/chunk-Y6ZFXZ7B.js +0 -2
  215. package/dist/chunk-YCN5XEST.js +0 -7
  216. package/dist/db-Rx8Ho_JF.d.ts +0 -838
  217. package/dist/queries/drift-policy.d.ts +0 -6
  218. package/dist/queries/drift-policy.js +0 -2
  219. package/dist/queries/health-cache-control.d.ts +0 -15
  220. package/dist/queries/health-cache-control.js +0 -2
@@ -0,0 +1,34 @@
1
+ import{b as v,i as k,j as O,k as D,q as F}from"./chunk-JB4PUN5S.js";import{c as N,e as T}from"./chunk-7O4MJYIW.js";import{d as M,f as w,s as L,t as I,w as A}from"./chunk-7OX2O53H.js";import{e as E,l as C}from"./chunk-5TT47UMX.js";import{b as R}from"./chunk-NHDPYW7O.js";function le(e,n,o={}){let l=P(e,[n],{additive:o.additive,semantic:o.semantic}),i=o.callableOnly?(l.get(n.symbolId)??[]).filter(a=>w(a.symbol)):l.get(n.symbolId)??[];return typeof o.limit=="number"?i.slice(0,o.limit):i}function ie(e,n,o={}){let l=G(e)?W(e,n,{semantic:o.semantic!==!1}):J(e).get(n.symbolId)??[];return typeof o.limit=="number"?l.slice(0,o.limit):l}var x=R("caller-rows"),$=2e4;function G(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>$}function J(e){return x.get(e,()=>{let n=I(e),o=P(e,n),l=new Map;for(let c of n)l.set(c.symbol,c.symbolId);let i=new Map,a=new Map;for(let c of n){let s=o.get(c.symbolId);if(!(!s||s.length===0))for(let d of s){let t=l.get(d.symbol);if(t===void 0||t===c.symbolId)continue;let r=i.get(t);r||(r=[],i.set(t,r),a.set(t,new Set));let f=`${c.symbol}|${c.relativePath}`;a.get(t).has(f)||(a.get(t).add(f),r.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion"}))}}return i})}function W(e,n,o){let l=[],i=new Set,a=s=>{if(s.symbol===n.symbol)return;let d=`${s.symbol}|${s.file}`;i.has(d)||(i.add(d),l.push(s))};for(let s of F(e,n))s.file!==n.relativePath&&a({symbol:s.enclosingSymbol??s.file,file:s.file,source:"resolved-reference"});let c=o.semantic?B(e,n):null;if(c)for(let s of N(e,c)){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let d=A(L(e,s.file),s.line);a({symbol:d?.symbol??s.file,file:s.file,source:"semantic-reference"})}return l}function B(e,n){return e.get(`SELECT
2
+ d.id AS documentId,
3
+ gs.id AS symbolId,
4
+ gs.symbol,
5
+ d.relative_path AS relativePath,
6
+ COALESCE(der.start_line, c.start_line) AS startLine,
7
+ COALESCE(der.end_line, c.end_line) AS endLine,
8
+ COALESCE(gs.display_name, '') AS leaf,
9
+ NULL AS parentTypeName,
10
+ CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
+ CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
12
+ gs.kind AS kind,
13
+ gs.documentation AS documentation,
14
+ gs.enclosing_symbol AS enclosingSymbol
15
+ FROM global_symbols gs
16
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
17
+ LEFT JOIN chunks c ON c.document_id = der.document_id
18
+ JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
19
+ WHERE gs.id = ?
20
+ LIMIT 1`,n.symbolId)??null}function P(e,n,o={}){if(n.length===0)return new Map;let l=o.additive??!1,i=[],a=[];for(let r of n)E(r.relativePath)&&C(e,r.relativePath)!==null?i.push(r):a.push(r);let c=new Map,s=new Map,d=r=>{for(let[f,p]of r){let b=c.get(f);b||(b=[],c.set(f,b));let y=s.get(f);y||(y=new Set,s.set(f,y));for(let m of p){let u=`${m.symbol}|${m.chunkId}`;y.has(u)||(y.add(u),b.push(m))}}};i.length>0&&d(U(e,i)),o.semantic!==!1&&d(q(T(e,n)));let t=l?n:a;return t.length>0&&d(Y(e,t)),c}function U(e,n){let o=new Map,l=j(n,o),i=D(e);for(let[a,c]of l){let s=C(e,a);if(s)for(let d of s){let t=K(c,d.line);if(!t)continue;let r=V(e,a,i,d.calleeLeaf,d.memberAccess);r&&r.symbol!==t.symbol&&o.get(t.symbolId).push({symbol:r.symbol,file:r.file,chunkId:d.line,source:"ast-callsite"})}}return o}function j(e,n){let o=new Map;for(let l of e){let i=o.get(l.relativePath);i?i.push(l):o.set(l.relativePath,[l]),n.set(l.symbolId,[])}for(let l of o.values())l.sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine));return o}function K(e,n){return e.find(o=>n>=o.startLine&&n<=o.endLine)??null}function V(e,n,o,l,i){let a=k(n,o.get(l)??[]);return a.length===0?null:O(e,n,a,i)}function Y(e,n){if(n.length===0)return new Map;let o=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
21
+ FROM mentions m
22
+ JOIN chunks c ON m.chunk_id = c.id
23
+ WHERE m.role != 1`),l=new Map;for(let t of o)l.has(t.document_id)||l.set(t.document_id,[]),l.get(t.document_id).push(t);let i=new Map(e.all("SELECT id, relative_path FROM documents").map(t=>[t.id,t.relative_path])),a=new Map,c=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
24
+ COALESCE(der.document_id, def_chunk.document_id) AS document_id
25
+ FROM global_symbols gs
26
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
27
+ LEFT JOIN (
28
+ SELECT m.symbol_id, MIN(c.document_id) AS document_id
29
+ FROM mentions m
30
+ JOIN chunks c ON m.chunk_id = c.id
31
+ WHERE m.role = 1
32
+ GROUP BY m.symbol_id
33
+ ) def_chunk ON def_chunk.symbol_id = gs.id`);for(let t of c)a.has(t.symbol_id)||a.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?i.get(t.document_id)??"":""});let s=new Map,d=i;for(let t of n){let r=l.get(t.documentId)??[],f=new Set,p=[],b=null,y=()=>{if(b)return b;let m=d.get(t.documentId)??"",u=new Set;if(m){let h=v(e,m),S=Math.max(0,t.startLine),_=Math.min(h.length-1,t.endLine);for(let g=S;g<=_;g+=1)for(let H of h[g])u.add(H)}return b=u,u};for(let m of r){if(m.symbol_id===t.symbolId)continue;let u=a.get(m.symbol_id);if(!u)continue;if(!(m.start_line>=t.startLine&&m.end_line<=t.endLine)){if(!(m.start_line<=t.endLine&&m.end_line>=t.startLine))continue;let g=M(u.symbol);if(!g||!y().has(g))continue}let S=`${u.symbol}|${m.chunk_id}`;f.has(S)||(f.add(S),p.push({...u,chunkId:m.chunk_id,source:"scip-chunk"}))}s.set(t.symbolId,p)}return s}function q(e){let n=new Map;for(let[o,l]of e){let i=[];for(let a of l)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(o,i)}return n}function se(e){x.invalidate(e)}export{le as a,ie as b,P as c,se as d};
34
+ //# sourceMappingURL=chunk-ARBZM2NF.js.map
@@ -1,2 +1,2 @@
1
- import{a as p,b as g}from"./chunk-IIKNAXAE.js";import{j as B}from"./chunk-EHEZLULQ.js";function w(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),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),d=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=d.join(" -> ");b.has(S)||(b.add(S),i.push({path:d,kind:R(d)}))}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=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":g(e)||g(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{w as a};
2
- //# sourceMappingURL=chunk-GRAEZYYU.js.map
1
+ import{a as d,b as m}from"./chunk-NKJKI6SE.js";import{a as B}from"./chunk-IODTPF5H.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-BI4F6GXI.js.map
@@ -0,0 +1,3 @@
1
+ import{b as v,c as j}from"./chunk-NHDPYW7O.js";import{a as P}from"./chunk-NN3O7TPH.js";function b(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 D=j("stripped-lines");function _t(t,n,e){return D.get(t,n,e,()=>b(e).split(`
2
+ `))}function Tt(t){D.invalidateAll(t),_=null,E=""}function Dt(t,n){D.invalidate(t,n),_=null,E=""}var _=null,E="";function Y(t){return _===t||(_=t,E=b(t)),E}function Rt(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${w(n)}\\b`,"m").test(t)}function yt(t,n){let e=new Set,r=new RegExp(`\\b${w(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 w(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(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 G,dirname as S,extname as p,join as g,relative as h,resolve as u}from"path";var K=v("indexed-paths"),m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],X=[".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"],J=[".php"],Q=new Set(m),R=new Set(X),M=new Set(k),$=new Set(A),y=new Set(L),B=new Set(W),F=new Set(H),C=new Set(U),z=new Set(J),Z=[{extensions:m,lookup:Q},{extensions:X,lookup:R},{extensions:k,lookup:M},{extensions:A,lookup:$},{extensions:L,lookup:y},{extensions:W,lookup:B},{extensions:H,lookup:F},{extensions:U,lookup:C},{extensions:J,lookup:z}];function x(t,n){return n.has(p(t).toLowerCase())}function q(t){return x(t,R)}function tt(t){return x(t,M)}function nt(t){return x(t,$)}function et(t){return x(t,y)}function rt(t){return x(t,B)}function ot(t){return x(t,F)}function wt(t){return p(t).toLowerCase()===".vb"}function st(t){return x(t,C)}function it(t){return x(t,z)}function ct(t){let n=p(t).toLowerCase();for(let e of Z)if(e.lookup.has(n))return e.extensions;return m}function at(t){return tt(t)||ot(t)||it(t)}function Xt(t,n,e){return q(n)?ut(t,n,e):nt(n)?gt(t,n,e):et(n)?pt(t,n,e):rt(n)?ft(t,n,e):at(n)?St(t,e.replace(/\\/g,"."),ct(n)):st(n)?xt(t,n,e):lt(t,n,e)}function lt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=N(t);for(let c of Nt(o)){let a=d(h(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(h(t.config.projectRoot,o))}function ut(t,n,e){let r=N(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 dt(o)){let c=d(h(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function gt(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,"/")),O(t,Et(s))}function pt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return O(t,ht(o))}function ft(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 O(t,o)}function St(t,n,e){let r=N(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}`,I=[...r].find(V=>V.endsWith(l));if(I)return I}for(let i of e){let l=[...r].find(I=>G(I)===`${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 xt(t,n,e){let r=N(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 mt(s)){let a=d(h(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function dt(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function O(t,n){let e=N(t);for(let r of n){let o=d(h(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function Et(t){let n=p(t);return $.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function ht(t){let n=p(t);return y.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.dart`,t]}function Nt(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of m)e.add(t.slice(0,-n.length)+r)}else for(let r of m)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function N(t){return K.get(t,()=>new Set(P(t,{includeIgnored:!1}).map(d)))}function d(t){return t.replace(/\\/g,"/")}export{m as a,X as b,k as c,A as d,L as e,W as f,H as g,U as h,J as i,wt as j,ct as k,Xt as l,ut as m,gt as n,pt as o,ft as p,St as q,xt as r,d as s,b as t,_t as u,Tt as v,Dt as w,Rt as x,$t as y,yt as z,w as A,Ct as B};
3
+ //# sourceMappingURL=chunk-BOVNTAKQ.js.map
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-DFK54IRN.js";import{v as e}from"./chunk-7OX2O53H.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
+ //# sourceMappingURL=chunk-CKIO6SVS.js.map
@@ -0,0 +1,2 @@
1
+ import{c as ae}from"./chunk-MX6F756F.js";import{a as K,b as C}from"./chunk-QAEDNTY7.js";import{d as A,e as j,f as O,g as B,h as H}from"./chunk-NKJKI6SE.js";import{b as N}from"./chunk-IODTPF5H.js";import{b as re,d as te}from"./chunk-ARBZM2NF.js";import{c as Y,d as Q,e as X,f as Z,h as v,l as ee,m as ne}from"./chunk-JB4PUN5S.js";import{a as R}from"./chunk-7O4MJYIW.js";import{b as T,d as w,e as M}from"./chunk-RCJEFQOK.js";import{v as L,w as _}from"./chunk-BOVNTAKQ.js";import{c as U,f as G,g as W,h as $,i as V,j as q,r as z,s as J,y as h}from"./chunk-7OX2O53H.js";import{b as I,c as F,h as k,i as E}from"./chunk-5TT47UMX.js";import{a as y}from"./chunk-NN3O7TPH.js";function ie(e){let n=new Map,r=t=>{let a=n.get(t);if(a)return a;let s=K(e,t);return a={ranges:s.map(i=>({startLine:i.startLine,endLine:i.endLine})),containers:new Set(s.map(i=>i.containerName).filter(i=>!!i))},n.set(t,a),a};return(t,a,s,i)=>{let l=r(t);for(let c of l.ranges)if(a>=c.startLine&&a<=c.endLine)return!0;if(i&&l.containers.has(i))return!0;for(let c of h(s))if(l.containers.has(c))return!0;return!1}}function oe(e){N(e),te(e),ee(e)}var Re=[{kind:"symbol-evidence",clearDatabase:oe},{kind:"semantic-provider",clearDatabase:R},{kind:"identifier-index",clearDatabase:Y,clearFile:Q},{kind:"language-parser",clearDatabase:w,clearFile:M},{kind:"source-stripper",clearDatabase:L,clearFile:_},{kind:"ast-tree",clearDatabase:k,clearFile:E},{kind:"source-text",clearDatabase:I,clearFile:F},{kind:"definition-catalog",clearFile:z}],se=["symbol-evidence","identifier-index","language-parser","source-stripper","ast-tree","source-text"],ce=["identifier-index","language-parser","source-stripper","ast-tree","source-text"];function le(e,n){let r=new Set(n.kinds);for(let t of Re)r.has(t.kind)&&(n.scope.kind==="database"?t.clearDatabase?.(e):t.clearFile?.(e,Ce(n.scope.relativePath)))}function en(e,n={}){le(e,{scope:{kind:"database"},kinds:n.semanticProvider===!0?[...se,"semantic-provider"]:se})}function D(e,n,r={}){le(e,{scope:{kind:"file",relativePath:n},kinds:r.definitions===!0?[...ce,"definition-catalog"]:ce})}function Ce(e){return e.replace(/\\/g,"/")}function de(e,n){return n.isIgnoredPath(e.relativePath)?m("ignored-file"):$(e.symbol)?m("module-like-symbol"):ue(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&ue(e.enclosingSymbol)?m("nested-non-callable-value"):!n.includeTests&&!x(e.relativePath)?m("test-file"):!n.includeTests&&n.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?m("excluded-file-region"):V(e.symbol)?m("rust-trait-impl-member"):q(e.symbol)?m("rust-test-module"):!n.includeMembers&&!xe(e)?m("member"):e.endLine-e.startLine+1<n.minLoc?m("below-min-loc"):{accepted:!0}:m("non-value-symbol")}function x(e){return[...new Set([...B,...H])].every(r=>!De(e,r))}function m(e){return{accepted:!1,rejectionReason:e}}function De(e,n){return new RegExp(`^${n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/%/g,".*").replace(/_/g,".")}$`).test(e)}function ue(e){return W(e)||e.endsWith("().")||e.endsWith(".")}function xe(e){return G(e.symbol)||h(e.symbol).length===0}function me(){return new Map}function fe(e,n,r){let t=new Map;for(let a of X(e,r))e.isIgnored(a.relative_path)||n.has(a.relative_path)||S(t,a.symbol_id,a.relative_path,a.ref_count,"scip-mention");return t}function pe(e,n,r){let t=new Set;for(let a of Z(e,n))e.isIgnored(a.relative_path)||r.has(a.relative_path)||t.add(a.symbol_id);return t}function P(e,n){let r=e.get(n);if(!r)return!1;for(let t of r.values())if(t.occurrences>0)return!0;return!1}function ge(e){return e?.occurrences??0}function S(e,n,r,t,a="source-fallback"){if(t<=0)return;let s=ye(e,n,r);s.occurrences+=t,s.sources.add(a)}function be(e,n,r,t,a){if(t<=0)return;let s=ye(e,n,r);s.occurrences=Math.max(t,s.occurrences),s.sources.add(a)}function ye(e,n,r){let t=e.get(n);t||(t=new Map,e.set(n,t));let a=t.get(r);return a||(a={occurrences:0,sources:new Set},t.set(r,a)),a}function Dn(e,n={}){let{scope:r,minLoc:t=1,includeTests:a=!1,skipBarrels:s=!1,includeMembers:i=!1,deadCodeOnly:l=!1,scanLimit:c,semantic:d=!0}=n,o=ae(Pe(e,{scope:r,minLoc:t,includeTests:a,includeMembers:i}),c),u=s?new Set(A(e)):new Set,p=l?me():fe(e,u,o.map(f=>f.symbolId)),g=l?pe(e,o.map(f=>f.symbolId),u):new Set,b=l?o.filter(f=>!g.has(f.symbolId)):o;l?ke(e,b,p,u):_e(e,b,p,u);let Se=l?b.filter(f=>!P(p,f.symbolId)):o;Ne(e,Se,p,{includeTests:a,inactiveBarrelPaths:u,includeSemantic:!l&&d});let ve=l?b.filter(f=>!P(p,f.symbolId)):o;return Le(e,Ie(ve,p))}function Pe(e,n){let r=ie(e),t=[];for(let a of y(e,{scope:n.scope}))try{for(let s of J(e,a))de(s,{minLoc:n.minLoc,includeTests:n.includeTests,includeMembers:n.includeMembers,isIgnoredPath:l=>e.isIgnored(l),isExcludedRegion:r}).accepted&&t.push(s)}finally{D(e,a,{definitions:!0})}return t}function Ie(e,n){return e.map(r=>Fe(r,n)).filter(r=>r.cross_file_refs===0).sort((r,t)=>t.loc-r.loc||r.relative_path.localeCompare(t.relative_path)||r.start_line-t.start_line)}function Fe(e,n){let r=n.get(e.symbolId)??new Map,t=ge(r.get(e.relativePath)),a=0;for(let[s,i]of r)s!==e.relativePath&&(a+=i.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:t,cross_file_refs:a}}function Le(e,n){let r=[],t=0,a=0,s=0;for(let i of n){if(e.isIgnored(i.relative_path)||j(e,i.relative_path)||O(e,i.symbol,i.relative_path))continue;let l=i.same_file_refs===0?"dead-code":"file-internal";l==="dead-code"?t++:a++,s+=i.loc,r.push({relativePath:i.relative_path,startLine:i.start_line,endLine:i.end_line,loc:i.loc,symbol:i.symbol,shortName:U(i.symbol),sameFileRefs:i.same_file_refs,kind:l})}return{symbols:r,totalCount:r.length,deadCodeCount:t,fileInternalCount:a,totalLoc:s}}function _e(e,n,r,t){if(n.length===0)return;let a=new C(e),s=new Set(n.map(c=>c.symbolId)),i=new Set(n.map(c=>c.leaf).filter(Boolean)),l=new Set(a.sourceFiles());for(let c of y(e))l.add(c);a.scanSourceReferences({paths:l,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:i,skipPath:c=>t.has(c)},c=>{s.has(c.target.symbolId)&&(we(e,c)||S(r,c.target.symbolId,c.sourceFile,Me(c),"source-fallback"))})}function ke(e,n,r,t){if(n.length===0)return;let a=new C(e),s=Ee(n),i=new Set(a.sourceFiles());for(let o of y(e))i.add(o);let l=new Set(s.keys()),c=new Map,d=o=>{let u=c.get(o);return u||(u=ne(e,o),c.set(o,u)),u};a.scanSourceReferences({paths:i,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:l,skipPath:o=>t.has(o),resolveTargets:({sourceFile:o,name:u,kind:p})=>{let g=s.get(u);return g?Te(o,u,g,d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{c.delete(o),D(e,o)}},o=>{let u=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&he(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:u})||S(r,o.target.symbolId,o.sourceFile,u,"source-fallback")})}function Ee(e){let n=new Map;for(let r of e){if(!r.leaf)continue;let t=n.get(r.leaf)??[];t.push(r),n.set(r.leaf,t)}return n}function Te(e,n,r,t,a){let s=r.filter(c=>c.relativePath===e);if(s.length>0)return s;let i=t.get(n);if(i)for(let c of i){let d=r.filter(o=>v(c,o.relativePath));if(d.length>0)return d}let l=new Set;for(let c of t.values())for(let d of c)l.add(d);for(let c of l){let d=r.filter(o=>v(c,o.relativePath));if(d.length>0&&d.length===r.length)return d}return a.permissive?[...r]:[]}function we(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&he(e,n)}function Me(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function he(e,n){return n.occurrences>1?!1:T(e,n.sourceFile).some(r=>r.used||r.sourcePath!==n.target.relativePath?!1:r.importedName===n.name||r.localName===n.name)}function Ne(e,n,r,t){for(let a of n){let s=re(e,a,{semantic:t.includeSemantic!==!1});if(s.length!==0)for(let i of s){let l=i.file;l===a.relativePath||e.isIgnored(l)||t.inactiveBarrelPaths.has(l)||!t.includeTests&&!x(l)||be(r,a.symbolId,l,1,"caller-map")}}}export{en as a,Dn as b};
2
+ //# sourceMappingURL=chunk-D6Z67MZL.js.map
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-ZNUPGRPR.js";import{a as c}from"./chunk-NN3O7TPH.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-DFK54IRN.js.map
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-V76FCF5F.js";import{b as p}from"./chunk-QAEDNTY7.js";import{c as i}from"./chunk-7OX2O53H.js";function x(e,r){let{scope:m,minLoc:o=10,limit:c=30,scanLimit:a}=r??{},s=new p(e);return u({candidates:()=>s.productionCallableDefinitions({scope:m,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:s.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:s.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>b(t,n,o),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:c})}function b(e,r,m){let o=e.endLine-e.startLine+1;if(o<m)return null;let c=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],s=a.filter(l=>l.file!==e.relativePath),t=new Set(s.map(l=>`${l.symbol}|${l.file}`)).size,n=new Set(a.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:i(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:c,fanOut:t,calleeCount:n,score:Math.round(o/50*(c/5)*Math.max(t/5,1)*100)/100}}export{x as a};
2
+ //# sourceMappingURL=chunk-FD37DBTD.js.map
@@ -0,0 +1,2 @@
1
+ import{d as m}from"./chunk-MX6F756F.js";import{a as g,b}from"./chunk-ARBZM2NF.js";import{r as y}from"./chunk-JB4PUN5S.js";import{a as c}from"./chunk-ZNUPGRPR.js";import{c as t}from"./chunk-7OX2O53H.js";function R(l,n,r={}){let o=c(l,n);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],i=y(l,o,{semantic:r.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?t(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:s}=S(l,o,i,{semantic:r.semantic!==!1});return{symbol:o.symbol,shortName:t(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:i,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:t(e.symbol),file:e.file})),consumers:s.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":t(e.symbol),file:e.file}))}}function S(l,n,r,o){let a=m(g(l,n,{limit:30,semantic:o.semantic}).map(s=>({symbol:s.symbol,file:s.file}))),i=m(b(l,n,{limit:30,semantic:o.semantic})),f=i.length>0?i:m(r.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:a,consumers:f}}export{R as a};
2
+ //# sourceMappingURL=chunk-FOQQDXE7.js.map
@@ -0,0 +1,11 @@
1
+ import{a as f}from"./chunk-DFK54IRN.js";import{b as d}from"./chunk-QAEDNTY7.js";import{d as c}from"./chunk-7O4MJYIW.js";import{c as u}from"./chunk-7OX2O53H.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
2
+ WHERE relative_path = ?
3
+ ${e.pathExclusionsFor("documents")}
4
+ LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents consumer_d ON consumer_d.id = c.document_id
8
+ WHERE m.symbol_id = ?
9
+ AND m.role != 1
10
+ AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
11
+ //# sourceMappingURL=chunk-GAQGJ52J.js.map
@@ -0,0 +1,20 @@
1
+ import{b as c}from"./chunk-RCJEFQOK.js";import{a as d}from"./chunk-NHDPYW7O.js";import{a}from"./chunk-NN3O7TPH.js";var g=d("file-dep-graph");function _(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>m(e,s,n,t,o);for(let t of l(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 l(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
2
+ d1.relative_path AS from_file,
3
+ d2.relative_path AS to_file
4
+ FROM mentions m
5
+ JOIN chunks c ON m.chunk_id = c.id
6
+ JOIN documents d1 ON c.document_id = d1.id
7
+ JOIN global_symbols gs ON m.symbol_id = gs.id
8
+ JOIN (
9
+ SELECT m2.symbol_id, c2.document_id
10
+ FROM mentions m2
11
+ JOIN chunks c2 ON m2.chunk_id = c2.id
12
+ WHERE m2.role = 1
13
+ GROUP BY m2.symbol_id
14
+ ) sym_def ON sym_def.symbol_id = gs.id
15
+ JOIN documents d2 ON sym_def.document_id = d2.id
16
+ WHERE d1.id != d2.id
17
+ AND m.role != 1
18
+ ${e.pathExclusionsFor("d1","d2")}
19
+ ${s}`)}function m(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)}function h(e){g.invalidateAll(e)}export{_ as a,h as b};
20
+ //# sourceMappingURL=chunk-IODTPF5H.js.map
@@ -0,0 +1,4 @@
1
+ import{r as f}from"./chunk-JB4PUN5S.js";import{a as d}from"./chunk-ZNUPGRPR.js";import{c as s,g as u,o as m,p as g}from"./chunk-7OX2O53H.js";import{a as c}from"./chunk-5TT47UMX.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
2
+ `).slice(i,n+1).join(`
3
+ `).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
4
+ //# sourceMappingURL=chunk-J6Z5YKGQ.js.map
@@ -0,0 +1,40 @@
1
+ import{c as $}from"./chunk-7O4MJYIW.js";import{c as R}from"./chunk-ZNUPGRPR.js";import{b as y}from"./chunk-RCJEFQOK.js";import{A as O,t as A,u as T}from"./chunk-BOVNTAKQ.js";import{c as L}from"./chunk-KJ6CW6EK.js";import{d,s as h,w as _}from"./chunk-7OX2O53H.js";import{a as p,e as m,j as P}from"./chunk-5TT47UMX.js";import{a as S,b as k}from"./chunk-NHDPYW7O.js";var X=new Set(["identifier","type_identifier","field_identifier"]),q=new Set(["identifier"]),ee=new Set(["identifier","property_identifier","type_identifier"]),ne=new Set(["rust","python"]),te=/\{([^{}]*)\}/g,ie=/\b([A-Za-z_][\w]*)\b/g;function I(e,t,i,n={}){if(!i)return[];let r=p(e,t);if(!r)return[];if(r.indexOf(i)===-1)return[];if(m(t))return(D(e,t).get(i)??[]).filter(f=>!B(f,n));let o=T(e,t,r),s=new RegExp(`\\b${O(i)}\\b`),a=[];for(let c=0;c<o.length;c++)B(c,n)||s.test(o[c]??"")&&a.push(c);return a}function B(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var x=S("file-identifiers");function H(e,t){return x.get(e,t,()=>new Set(D(e,t).keys()))}var N=S("file-ident-lines");function D(e,t){return N.get(e,t,()=>re(e,t))}var v=S("file-idents-by-line");function Se(e,t){return v.get(e,t,()=>{let i=D(e,t),n=0;for(let o of i.values()){let s=o[o.length-1];s!==void 0&&s>n&&(n=s)}let r=new Array(n+1);for(let o=0;o<=n;o+=1)r[o]=new Set;for(let[o,s]of i)for(let a of s)r[a].add(o);return r})}function ye(e){x.invalidateAll(e),N.invalidateAll(e),v.invalidateAll(e)}function he(e,t){x.invalidate(e,t),N.invalidate(e,t),v.invalidate(e,t)}function re(e,t){let i=new Map,n=(a,c)=>{let l=i.get(a);if(!l){i.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};if(m(t)){let a=P(e,t);if(a){let c=m(t),l=c==="rust"?X:c==="python"?q:ee,f=u=>{if(l.has(u.type)&&n(u.text,u.startPosition.row),c&&ne.has(c)&&u.type==="string_content"){let E=u.startPosition.row;for(let K of u.text.matchAll(te)){let V=K[1]??"";for(let F of V.matchAll(ie))F[1]&&n(F[1],E)}}for(let E of u.children)f(E)};return f(a.rootNode),i}}let r=p(e,t);if(!r)return i;let o=A(r).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let a=0;a<o.length;a+=1){let c=o[a]??"";for(let l of c.matchAll(s))l[1]&&n(l[1],a)}return i}function j(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function g(e,t){return j(e)===j(t)}function J(e,t){let i=new Map;for(let n of y(e,t)){if(!n.sourcePath)continue;let r=n.localName??n.importedName;if(r&&G(i,r,n.sourcePath),n.kind==="namespace")for(let o of n.usedMembers)G(i,o,n.sourcePath)}return i}function G(e,t,i){let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(i)}function Le(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
+ m.symbol_id,
3
+ d.relative_path,
4
+ COUNT(*) AS ref_count
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents d ON c.document_id = d.id
8
+ WHERE m.role != 1
9
+ ${n}
10
+ ${e.pathExclusionsFor("d")}
11
+ GROUP BY m.symbol_id, d.relative_path`,...i??[])})}function xe(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
+ FROM mentions m
13
+ JOIN chunks c ON m.chunk_id = c.id
14
+ JOIN documents d ON c.document_id = d.id
15
+ WHERE m.role != 1
16
+ ${n}
17
+ ${e.pathExclusionsFor("d")}`,...i??[])}).filter(i=>i.symbol_id!==null)}function Y(e,t){return C(e,t,i=>{let n=i?`AND m.symbol_id IN (${i.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
18
+ c.start_line AS chunk_start, c.end_line AS chunk_end
19
+ FROM mentions m
20
+ JOIN chunks c ON m.chunk_id = c.id
21
+ JOIN documents d ON c.document_id = d.id
22
+ WHERE m.role != 1
23
+ ${n}
24
+ ${e.pathExclusionsFor("d")}
25
+ ORDER BY d.relative_path, c.start_line`,...i??[])})}function C(e,t,i){if(!t)return i();if(t.length===0)return[];let n=[];for(let r=0;r<t.length;r+=750)n.push(...i(t.slice(r,r+750)));return n}function Fe(e,t){let i=z(e);return i?t.filter(n=>z(n.file)===i):t}function ke(e,t,i,n){let r=i.find(o=>o.file===t);if(r)return r;if(n){let o=new Set(y(e,t).map(s=>s.sourcePath).filter(s=>!!s));for(let s of i)for(let a of o)if(g(a,s.file))return s;return null}return i.length===1?i[0]:null}function z(e){let t=m(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var U=k("global-leaf-index");function w(e){return U.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
26
+ COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
27
+ FROM global_symbols gs
28
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
29
+ LEFT JOIN documents der_doc ON der_doc.id = der.document_id
30
+ LEFT JOIN (
31
+ SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
32
+ FROM mentions m
33
+ JOIN chunks c ON m.chunk_id = c.id
34
+ JOIN documents d ON c.document_id = d.id
35
+ WHERE m.role = 1
36
+ GROUP BY m.symbol_id
37
+ ) mention_doc ON mention_doc.symbol_id = gs.id
38
+ WHERE 1 = 1
39
+ ${e.symbolNoiseFor("gs")}`),i=new Map;for(let n of t){if(!n.relative_path||e.isIgnored(n.relative_path))continue;let r=d(n.symbol);if(!r)continue;let o=i.get(r);o||(o=[],i.set(r,o)),o.some(s=>s.symbolId===n.id)||o.push({symbol:n.symbol,symbolId:n.id,file:n.relative_path})}return i})}function Ae(e){U.invalidate(e)}function M(e,t,i){let n=w(e).get(i);if(!n||n.length===0)return[];if(n.length===1)return[b(n[0])];let r=n.filter(c=>c.file===t);if(r.length>0)return r.map(b);let o=J(e,t),s=o.get(i);if(s)for(let c of s){let l=n.filter(f=>g(c,f.file));if(l.length>0)return l.map(b)}let a=new Set;for(let c of o.values())for(let l of c)a.add(l);for(let c of a){let l=n.filter(f=>g(c,f.file));if(l.length>0&&l.length===n.length)return l.map(b)}return[]}function Ue(e,t,i){let n=M(e,t,i);if(n.length>0)return n;let r=w(e).get(i);return!r||r.length===0?[]:r.map(b)}function Z(e,t,i={}){let n=R(e,t);if(!n)return[];let r=d(n.symbol);if(!r)return[];if(i.semantic!==!1){let s=$(e,{...n,leaf:r,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let a=new Map;for(let c of s){let l=a.get(c.file)??[];l.push(c.line),a.set(c.file,l)}return W(e,a)}}let o=new Map;for(let s of L(e)){let a=p(e,s);if(!a||a.indexOf(r)===-1||s!==n.relativePath&&!M(e,s,r).some(f=>f.symbolId===n.symbolId))continue;let c=I(e,s,r,s===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});c.length>0&&o.set(s,c)}return W(e,o)}function We(e,t){let i=new Map;for(let o of t){if(!o.leaf)continue;let s=i.get(o.leaf)??[];s.push(o),i.set(o.leaf,s)}if(i.size===0)return new Map;let n=new Set(t.map(o=>o.symbolId)),r=new Map;for(let o of L(e)){let s=H(e,o);if(s.size!==0){for(let a of s)if(i.has(a))for(let c of M(e,o,a)){if(!n.has(c.symbolId)||o===c.relativePath)continue;let l=r.get(c.symbolId);l||(l=new Set,r.set(c.symbolId,l)),l.add(o)}}}return r}function b(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function W(e,t){let i=[],n=new Set;for(let[r,o]of t){let s=h(e,r);for(let a of o){let c=_(s,a),l=`${r}|${a}|${c?.symbol??""}`;n.has(l)||(n.add(l),i.push({file:r,line:a,enclosingSymbol:c?.symbol??null}))}}return i}function oe(e,t){let i=ue(e,t);return i?me(e,ce(e,i.match,i.identifier)):[]}function nn(e,t,i={}){return se(e,t,i).map(n=>({file:n.file,line:n.line,enclosingSymbol:n.enclosingSymbol}))}function se(e,t,i={}){let n=Z(e,t,{semantic:i.semantic}),r=n.length>0?Q(n,"source-attribution"):Q(oe(e,t),"scip-reference-chunk");return i.includeIgnored===!0?r:r.filter(o=>!e.isIgnored(o.file))}function Q(e,t){return e.map(i=>({...i,provenance:t}))}function ce(e,t,i){let n=new Map;for(let[r,o]of ae(e,t.symbolId))n.set(r,le(e,r,o,t,i));return n}function ae(e,t){let i=new Map;for(let n of Y(e,[t])){if(e.isIgnored(n.relative_path))continue;let r=i.get(n.relative_path);r||(r=[],i.set(n.relative_path,r)),r.push({start_line:n.chunk_start,end_line:n.chunk_end})}return i}function le(e,t,i,n,r){let o=t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{},s=r?I(e,t,r,o):[];return i.flatMap(a=>fe(s,a))}function fe(e,t){let i=e.filter(n=>n>=t.start_line&&n<=t.end_line);return i.length>0?i:[t.start_line]}function ue(e,t){let i=R(e,t);return i?{match:i,identifier:d(i.symbol)||null}:null}function me(e,t){let i=[],n=new Set;for(let[r,o]of t){let s=h(e,r);for(let a of o){let c=_(s,a),l=`${r}|${a}|${c?.symbol??""}`;n.has(l)||(n.add(l),i.push({file:r,line:a,enclosingSymbol:c?.symbol??null}))}}return i}export{D as a,Se as b,ye as c,he as d,Le as e,xe as f,Y as g,g as h,Fe as i,ke as j,w as k,Ae as l,J as m,M as n,Ue as o,We as p,oe as q,nn as r};
40
+ //# sourceMappingURL=chunk-JB4PUN5S.js.map
@@ -0,0 +1,3 @@
1
+ import{a as b}from"./chunk-RCJEFQOK.js";import{d as x}from"./chunk-7OX2O53H.js";import{a as d,e as g,j as y}from"./chunk-5TT47UMX.js";import{a as u}from"./chunk-NHDPYW7O.js";var C=u("definition-consumer-file-usage");function I(e,t,n){return e.callerFileMap(t,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function P(e,t,n){let i=[],r=0,s=0,p=x(t.symbol);for(let a of n)D(e,a,t.relativePath,p)?r++:S(e,a,p)?s++:i.push(a);return{realConsumers:i,barrelConsumers:r,importOnlyConsumers:s}}function S(e,t,n){if(!n)return!1;let i=g(t);if(!i)return!1;let r=C.get(e,t,()=>v(e,t,i));return r.importedLeaves.has(n)&&!r.usedLeaves.has(n)}function j(e){C.invalidateAll(e)}function v(e,t,n){let i=new Set,r=new Set,s=y(e,t);if(!s)return{importedLeaves:i,usedLeaves:r};let p=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let c=f||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(c?i.add(o.text):r.add(o.text));for(let l of o.children)a(l,c)};return a(s.rootNode,!1),{importedLeaves:i,usedLeaves:r}}function D(e,t,n,i){if(!i)return!1;let r=d(e,t);if(!r)return!1;let s=b(e,t);if(s.length===0)return!1;let p=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=r.split(`
2
+ `),f=0;for(let c=0;c<o.length;c++){if(!a.test(o[c]??""))continue;if(f++,!s.find(m=>m.startLine<=c&&c<=m.endLine))return!1}return f>0}export{I as a,P as b,S as c,j as d};
3
+ //# sourceMappingURL=chunk-JTXKS5GK.js.map
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-ARBZM2NF.js";import{a as u}from"./chunk-ZNUPGRPR.js";import{c as i}from"./chunk-7OX2O53H.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-KJ3ZJIE5.js.map
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-NHDPYW7O.js";import{a as S}from"./chunk-NN3O7TPH.js";import{readdirSync as x}from"fs";import{extname as l,join as f}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],j=[".vue"],p=new Set(m.map(t=>t.toLowerCase())),g=[...p].sort().join(","),y=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function w(t,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,e=o.extensions?.map(c=>c.toLowerCase()),r=e?new Set(e):p,u=e?[...r].sort().join(","):g,n=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return h.get(t,n,()=>{let c=new Set;if(s)for(let a of S(t,{includeIgnored:!1}))r.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of E(t.config.projectRoot,r))t.isIgnored(a)||c.add(a);return[...c].sort()})}var h=d("source-files");function E(t,o){let s=new Set,i=e=>{let r=e?f(t,e):t,u;try{u=x(r,{withFileTypes:!0})}catch{return}for(let n of u)if(!y.has(n.name)){if(n.isDirectory()){i(e?`${e}/${n.name}`:n.name);continue}o.has(l(n.name).toLowerCase())&&s.add(e?`${e}/${n.name}`:n.name)}};return i(""),s}export{j as a,y as b,w as c};
2
+ //# sourceMappingURL=chunk-KJ6CW6EK.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-BT36WY5B.js";import{r as g,s as m}from"./chunk-NLJCXHFU.js";function S(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
- WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let h=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:h,shortName:h,depth:p})}return b}export{S as a};
3
- //# sourceMappingURL=chunk-AXHDRSRI.js.map
1
+ import{a as d}from"./chunk-ZNUPGRPR.js";import{a as g,c as m}from"./chunk-7OX2O53H.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
+ WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
+ //# sourceMappingURL=chunk-KNA6Z7JB.js.map
@@ -1,8 +1,8 @@
1
- import{a as r}from"./chunk-LLDPR3DG.js";import{j as l}from"./chunk-EHEZLULQ.js";import{a as c}from"./chunk-BT36WY5B.js";import{s as d}from"./chunk-NLJCXHFU.js";function f(e,t){let o=c(e,t);if(!o)return[];let i=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
1
+ import{a as r}from"./chunk-DFK54IRN.js";import{a as c}from"./chunk-IODTPF5H.js";import{a as l}from"./chunk-ZNUPGRPR.js";import{c as d}from"./chunk-7OX2O53H.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 = ?
5
- AND m.role != 1`,o.symbolId);return[{name:d(o.symbol),count:i?.file_count??0}]}function y(e,t){let o=r(e,t);if(!o)return[];let n=e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
5
+ AND m.role != 1`,o.symbolId);return[{name:d(o.symbol),count:n?.file_count??0}]}function b(e,t){let o=r(e,t);if(!o)return[];let s=e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
6
6
  FROM mentions m
7
7
  JOIN chunks c ON m.chunk_id = c.id
8
8
  JOIN documents d ON c.document_id = d.id
@@ -19,7 +19,7 @@ import{a as r}from"./chunk-LLDPR3DG.js";import{j as l}from"./chunk-EHEZLULQ.js";
19
19
  AND m.role != 1
20
20
  AND def_d.id != d.id
21
21
  GROUP BY d.id
22
- ORDER BY symbol_count DESC`,o).filter(m=>!e.isIgnored(m.relative_path)).map(m=>({name:m.relative_path,count:m.symbol_count}));if(n.length>0)return n;let s=l(e).get(o);return!s||s.size===0?[]:[{name:o,count:s.size}]}function b(e,t={}){return _(e,t).map(o=>({name:d(o.symbol),count:o.file_count}))}function _(e,t){let{limit:o=30,scope:i}=t,n=i?`AND def_d.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT gs.symbol, COUNT(DISTINCT c.document_id) AS file_count
22
+ ORDER BY symbol_count DESC`,o).filter(m=>!e.isIgnored(m.relative_path)).map(m=>({name:m.relative_path,count:m.symbol_count}));if(s.length>0)return s;let i=c(e).get(o);return!i||i.size===0?[]:[{name:o,count:i.size}]}function y(e,t={}){return _(e,t).map(o=>({name:d(o.symbol),count:o.file_count}))}function _(e,t){let{limit:o=30,scope:n}=t,s=n?`AND def_d.relative_path LIKE '%${n}%'`:"";return e.all(`SELECT gs.symbol, COUNT(DISTINCT c.document_id) AS file_count
23
23
  FROM mentions m
24
24
  JOIN chunks c ON m.chunk_id = c.id
25
25
  JOIN global_symbols gs ON m.symbol_id = gs.id
@@ -34,11 +34,11 @@ import{a as r}from"./chunk-LLDPR3DG.js";import{j as l}from"./chunk-EHEZLULQ.js";
34
34
  WHERE m.role != 1
35
35
  ${e.pathExclusionsFor("def_d")}
36
36
  ${e.symbolNoiseFor("gs")}
37
- ${n}
37
+ ${s}
38
38
  GROUP BY gs.id
39
39
  HAVING file_count > 1
40
40
  ORDER BY file_count DESC
41
- LIMIT ?`,o)}function I(e,t={}){let{limit:o=30,scope:i}=t,n=i?`AND d.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
41
+ LIMIT ?`,o)}function I(e,t={}){let{limit:o=30,scope:n}=t,s=n?`AND d.relative_path LIKE '%${n}%'`:"";return e.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
42
42
  FROM mentions m
43
43
  JOIN chunks c ON m.chunk_id = c.id
44
44
  JOIN documents d ON c.document_id = d.id
@@ -55,8 +55,8 @@ import{a as r}from"./chunk-LLDPR3DG.js";import{j as l}from"./chunk-EHEZLULQ.js";
55
55
  AND def_d.id != d.id
56
56
  ${e.pathExclusionsFor("d")}
57
57
  ${e.symbolNoiseFor("gs")}
58
- ${n}
58
+ ${s}
59
59
  GROUP BY d.id
60
60
  ORDER BY symbol_count DESC
61
- LIMIT ?`,o).filter(s=>!e.isIgnored(s.relative_path)).map(s=>({name:s.relative_path,count:s.symbol_count}))}export{f as a,y as b,b as c,I as d};
62
- //# sourceMappingURL=chunk-U3GYMGBX.js.map
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-LDV2B7ET.js.map
@@ -0,0 +1,5 @@
1
+ import{execFileSync as p}from"child_process";import{platform as u}from"os";var g=u()==="win32";function n(e){let r=g?"where":"which";try{return p(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as t}from"child_process";import{platform as l,arch as m}from"os";var a="v0.7.0";function x(){return n("scip")}function C(){try{return t("scip",["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function f(){let e=l(),r=m(),i,o,s;switch(e){case"darwin":i="darwin",s="tar.gz";break;case"linux":i="linux",s="tar.gz";break;case"win32":i="windows",s="zip";break;default:return null}switch(r){case"arm64":o="arm64";break;case"x64":o="amd64";break;default:return null}let c=`scip-${i}-${o}.${s}`;return{url:`https://github.com/sourcegraph/scip/releases/download/${a}/${c}`,filename:c}}function S(){let e=f();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),l()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
2
+ `),console.log("Or download manually:")):console.log("Download from:"),console.log(e?` ${e.url}
3
+ `:` https://github.com/sourcegraph/scip/releases/tag/${a}
4
+ `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function $(e){if(l()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(t("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(t("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e("Install manually from: https://github.com/sourcegraph/scip/releases"),!1}export{n as a,x as b,C as c,S as d,$ as e};
5
+ //# sourceMappingURL=chunk-LWYIGRHR.js.map
@@ -0,0 +1,2 @@
1
+ import{b}from"./chunk-DFK54IRN.js";import{l as u,v as f}from"./chunk-7OX2O53H.js";function S(a,p){let L=b(a,p),o=f(a,L,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!u(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-MDAYGS6T.js.map
@@ -0,0 +1,2 @@
1
+ function r(e){return e.endLine-e.startLine+1}function u(e,n){return r(e)-r(n)||e.relativePath.localeCompare(n.relativePath)}function d(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function f(e){let n=new Set,o=[];for(let t of e){let i=`${t.symbol}|${t.file}`;n.has(i)||(n.add(i),o.push(t))}return o}export{r as a,u as b,d as c,f as d};
2
+ //# sourceMappingURL=chunk-MX6F756F.js.map
@@ -0,0 +1,2 @@
1
+ function l(o){let t=new WeakMap,r=a=>{let e=t.get(a);return e||(e=new Map,t.set(a,e)),e};return{get(a,e,i){let n=r(a);if(n.has(e))return n.get(e);let c=i();return n.set(e,c),c},invalidate(a,e){t.get(a)?.delete(e)},invalidateAll(a){t.delete(a)},size(a){return t.get(a)?.size??0}}}function p(o){let t=new WeakMap;return{get(r,a){let e=t.get(r);if(e)return e.value;let i=a();return t.set(r,{value:i}),i},invalidate(r){t.delete(r)},has(r){return t.has(r)}}}function b(o){let t=new WeakMap,r=a=>{let e=t.get(a);return e||(e=new Map,t.set(a,e)),e};return{get(a,e,i,n){let c=r(a),s=c.get(e);if(s&&s.source===i)return s.value;let u=n();return c.set(e,{source:i,value:u}),u},invalidate(a,e){t.get(a)?.delete(e)},invalidateAll(a){t.delete(a)}}}export{l as a,p as b,b as c};
2
+ //# sourceMappingURL=chunk-NHDPYW7O.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-5IRX5I64.js";import{j as p}from"./chunk-EHEZLULQ.js";import{b as f}from"./chunk-NLJCXHFU.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var v=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,v as g,B as h};
2
- //# sourceMappingURL=chunk-IIKNAXAE.js.map
1
+ import{a as p}from"./chunk-IODTPF5H.js";import{c as a}from"./chunk-KJ6CW6EK.js";import{b as f}from"./chunk-NHDPYW7O.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var v=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,v as g,B as h};
2
+ //# sourceMappingURL=chunk-NKJKI6SE.js.map
@@ -0,0 +1,8 @@
1
+ function c(n,e={}){let s=e.scope?"AND relative_path LIKE ?":"",o=e.like?"AND relative_path LIKE ?":"",r=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],i=n.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${n.pathExclusionsFor("documents")}
5
+ ${s}
6
+ ${o}
7
+ ORDER BY relative_path`,...r).map(t=>t.relative_path),a=e.extensions?i.filter(t=>e.extensions.some(l=>t.toLowerCase().endsWith(l.toLowerCase()))):i;return e.includeIgnored===!1?a.filter(t=>!n.isIgnored(t)):a}export{c as a};
8
+ //# sourceMappingURL=chunk-NN3O7TPH.js.map
@@ -0,0 +1,18 @@
1
+ import{b as m}from"./chunk-QAEDNTY7.js";import{a as S}from"./chunk-NKJKI6SE.js";import{b as h}from"./chunk-7O4MJYIW.js";import{b as d}from"./chunk-RCJEFQOK.js";import{a as y}from"./chunk-NN3O7TPH.js";import f from"path";function l(e){let n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n.length<=1?"(root)":n.length>=3&&["src","lib","app","server","client"].includes(n[0])?`${n[0]}/${n[1]}`:n[0]}function p(e,t){if(e===t)return"ok";let n=g(e),i=g(t);return n&&i?v(n,i)?"ok":"violation":w(e,t)}function D(e,t){let n=g(l(e)),i=g(l(t));return!!n&&!!i}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function v(e,t){return t==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","semantic","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(t)??!1}function w(e,t){if(t==="shared")return"ok";let n={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return n[e]?n[e].has(t)?"ok":"violation":null}function G(e,t){let{scope:n,minDeviation:i=5}=t??{},r=t?.semantic!==!1,c=new m(e).fileDependencyGraph(n),a=O(e,n);return _([...R(e,c,a,{semantic:r}),...k(c),...I(c,i)])}function R(e,t,n,i){let r=[];for(let[s,c]of t){if(u(s))continue;let a=n.get(s)??new Set;for(let o of c)if(!u(o)&&!a.has(o)){if(i.semantic&&L(e,s,o)||A(e,s,o)||T(e,s,o)||F(o)||j(e,s,o)||V(o))continue;r.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}return r}function k(e){let t=[],n=$(e);for(let[i,r]of e){if(u(i))continue;let s=l(i);for(let c of r){if(u(c))continue;let a=l(c);if(s===a)continue;(p(s,a)??n.get(`${s}->${a}`))==="violation"&&t.push({file:i,kind:"layer-violation",description:`Imports from ${a}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${a}/`})}}return t}function I(e,t){let n=[];for(let[i,r]of M(e)){let s=r.filter(a=>!u(a));if(s.length<t)continue;let c=x(e,s);for(let a of s)for(let o of e.get(a)??[])u(o)||(c.get(o)??0)===1&&f.dirname(o)!==i&&f.dirname(o)!==f.dirname(i)&&(D(a,o)||n.push({file:a,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${o}`,dep:o}))}return n}function _(e){return{results:e,unusedImports:e.filter(t=>t.kind==="unused-import").length,layerViolations:e.filter(t=>t.kind==="layer-violation").length,patternDeviations:e.filter(t=>t.kind==="pattern-deviation").length}}function M(e){let t=new Map;for(let n of e.keys()){let i=f.dirname(n),r=t.get(i);r||(r=[],t.set(i,r)),r.push(n)}return t}function x(e,t){let n=new Map;for(let i of t)for(let r of e.get(i)??[])u(r)||n.set(r,(n.get(r)??0)+1);return n}function O(e,t){let n=new Map;return E(e,n,t),P(e,n),n}function E(e,t,n){for(let i of N(e,n))b(e,t,i.from_file,i.to_file)}function N(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d1 ON c.document_id = d1.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ JOIN documents d2 ON sym_def.document_id = d2.id
14
+ WHERE d1.id != d2.id
15
+ AND m.role != 1
16
+ ${e.pathExclusionsFor("d1","d2")}
17
+ ${n}`)}function P(e,t){new m(e).scanSourceReferences({paths:y(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},i=>{i.target.relativePath!==i.sourceFile&&(e.isIgnored(i.target.relativePath)||b(e,t,i.sourceFile,i.target.relativePath))})}function b(e,t,n,i){if(e.isIgnored(n)||e.isIgnored(i))return;let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(i)}function $(e){let t=new Map;for(let[i,r]of e){if(u(i))continue;let s=l(i);for(let c of r){if(u(c))continue;let a=l(c);if(s===a||p(s,a))continue;let o=`${s}->${a}`;t.set(o,(t.get(o)??0)+1)}}let n=new Map;for(let[i,r]of t)n.set(i,r<=2?"violation":"ok");return n}function F(e){return e.includes("types")||e.endsWith(".d.ts")}function L(e,t,n){let i=h(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.isUsed)}function A(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.used)}function T(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function V(e){return e.endsWith(".vue")}function j(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function u(e){let t=S(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||J(f.basename(e)))}function J(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{G as a};
18
+ //# sourceMappingURL=chunk-NSTZMBAB.js.map
@@ -0,0 +1,6 @@
1
+ import{a as F,b as y,d as R,e as T}from"./chunk-RKTDEIHF.js";import{c as N}from"./chunk-MX6F756F.js";import{b as k}from"./chunk-QAEDNTY7.js";import{a as M}from"./chunk-ARBZM2NF.js";import{a as A}from"./chunk-ZNUPGRPR.js";import{c as p,d as P,g as w,j as q}from"./chunk-7OX2O53H.js";import{a as z}from"./chunk-5TT47UMX.js";function ae(i,t,e={}){let{minSimilarity:s=.4,limit:r=20}=e,a=U(i,t,{semantic:e.semantic!==!1});if(!a)return[];if(!w(a.symbol))return[];let n=V(i,a,s,{scanLimit:e.scanLimit,semantic:e.semantic!==!1});return n.length>0?n.slice(0,r):K(i,t,{minSimilarity:s,limit:r})}function V(i,t,e,s){let r=v(i,{minCallees:3,excludeSymbol:t.symbol,scanLimit:s.scanLimit,semantic:s.semantic}),a=R([t,...r].map(o=>o.callees)),n=[];for(let o of r){if(o.callees.size<3)continue;let l=$(t,o,a,{minSimilarity:e,requireSignificantShared:1,requireSharedCount:0});l&&n.push(l)}return n.sort((o,l)=>l.similarity-o.similarity),n}function $(i,t,e,s){let{similarity:r,significantShared:a}=T(i.callees,t.callees,e);if(r<s.minSimilarity)return null;let n=F(i.callees,t.callees).size;if(a.length<s.requireSignificantShared&&n<s.requireSharedCount)return null;let o=a.length>0?a:[...F(i.callees,t.callees)];return{symbolA:i.symbol,shortNameA:p(i.symbol),fileA:i.file,symbolB:t.symbol,shortNameB:p(t.symbol),fileB:t.file,similarity:r,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(i.callees,t.callees)].map(p),uniqueToB:[...y(t.callees,i.callees)].map(p)}}function le(i,t={}){let{minSimilarity:e=.5,limit:s=20,scope:r,minCallees:a=4,crossFileOnly:n=!1,scanLimit:o}=t,l=v(i,{minCallees:a,scope:r,scanLimit:o,semantic:t.semantic!==!1}),c=R(l.map(m=>m.callees)),u=new Map;for(let m of l)for(let f of m.callees)u.set(f,(u.get(f)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(l.length))),x=new Map;for(let m=0;m<l.length;m+=1)for(let f of l[m].callees){if((u.get(f)??0)>h)continue;let g=x.get(f);g||(g=[],x.set(f,g)),g.push(m)}let C=[],L=new Set;e:for(let m=0;m<l.length;m+=1){let f=l[m],g=new Set;for(let D of f.callees){let S=x.get(D);if(S)for(let b of S)b>m&&g.add(b)}for(let D of g){let S=`${m}|${D}`;if(L.has(S))continue;L.add(S);let b=l[D];if(n&&f.file===b.file)continue;if(f.paramCount>=0&&b.paramCount>=0){let _=Math.abs(f.paramCount-b.paramCount),O=Math.max(2,Math.ceil(Math.max(f.paramCount,b.paramCount)*.5));if(_>O)continue}let B=$(f,b,c,{minSimilarity:e,requireSignificantShared:2,requireSharedCount:4});if(B&&(C.push(B),C.length>s*5))break e}}return C.sort((m,f)=>f.similarity-m.similarity),C.slice(0,s)}var Z=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function U(i,t,e){let s=A(i,t),r=new k(i);if(!s)return null;let a=M(i,s,{semantic:e.semantic});return{symbol:s.symbol,file:s.relativePath,callees:E(a.map(n=>n.symbol)),paramCount:r.callableSignature(s)?.paramCount??-1}}function v(i,t){let{minCallees:e,scope:s,excludeSymbol:r,scanLimit:a}=t,n=new k(i),o=N(n.productionCallableDefinitions({scope:s,minLoc:5,excludeSymbol:r,sortByLocDesc:typeof a=="number"&&a>0}),a),l=n.calleeMap(o,{semantic:t.semantic!==!1});return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:E((l.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:n.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=e)}function E(i){return new Set([...i].filter(t=>!W(t)))}function W(i){return Z.some(t=>i.includes(t))}function K(i,t,e){let s=G(i,t);if(!s||s.tokens.size<3)return[];let r=e.minSimilarity>=.5?e.minSimilarity:.3,a=[];for(let n of J(i)){if(n.symbol===s.symbol||n.tokens.size<3)continue;let o=F(s.tokens,n.tokens);if(o.size<2)continue;let l=new Set([...s.tokens,...n.tokens]),c=l.size>0?o.size/l.size:0;c<r||a.push({symbolA:s.symbol,shortNameA:p(s.symbol),fileA:s.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(s.tokens,n.tokens)].sort(),uniqueToB:[...y(n.tokens,s.tokens)].sort()})}return a.sort((n,o)=>o.similarity-n.similarity||n.shortNameB.localeCompare(o.shortNameB)),a.slice(0,e.limit)}function G(i,t){let e=A(i,t);if(!e||!w(e.symbol))return null;let s=H(i,e);return s?{symbol:e.symbol,file:e.relativePath,tokens:s}:null}function H(i,t){let e=P(t.symbol),s=I(i,t.relativePath,t.startLine,t.endLine,e),r=j(s,e);return r.size>0?r:null}function J(i){let t=new k(i);return t.scopedDefinitions().filter(e=>e.isFunctionLike).filter(e=>t.fileKind(e.relativePath)!=="test").filter(e=>!q(e.symbol)).map(e=>({symbol:e.symbol,file:e.relativePath,tokens:j(I(i,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)})).filter(e=>e.tokens.size>0)}function I(i,t,e,s,r){let a=z(i,t);if(!a)return"";let n=a.split(`
2
+ `);if(s>=e&&s-e<=12)return n.slice(e,s+1).join(`
3
+ `);let o=[new RegExp(`\\bdef\\s+${d(r)}\\b`),new RegExp(`\\bfun\\s+${d(r)}\\b`),new RegExp(`\\bfn\\s+${d(r)}\\b`),new RegExp(`\\bfunction\\s+${d(r)}\\b`),new RegExp(`\\b${d(r)}\\s*\\(`)],l=n.findIndex(c=>o.some(u=>u.test(c)));if(l>=0){let c=l;for(let u=l+1;u<n.length&&u<=l+8;u++){let h=n[u]??"";if(u>l&&X(h)||(c=u,h.trim()===""&&u>l+1))break}return n.slice(l,c+1).join(`
4
+ `)}return n.slice(e,Math.min(n.length,e+8)).join(`
5
+ `)}function j(i,t){if(!i)return new Set;let e=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),s=Q(t),a=i.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>!e.has(n)).filter(n=>!s.has(n));return new Set(a)}function Q(i){return new Set(i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(t=>t.toLowerCase()).filter(t=>t.length>1))}function X(i){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(i)}function d(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ae as a,le as b};
6
+ //# sourceMappingURL=chunk-NYEMZHUC.js.map
@@ -0,0 +1,4 @@
1
+ import{a as h,b as v,c as P}from"./chunk-JTXKS5GK.js";import{a as b,c as L}from"./chunk-MX6F756F.js";import{b as D}from"./chunk-QAEDNTY7.js";import{a as I,c as S,d as p}from"./chunk-7OX2O53H.js";import{a as y,m as x}from"./chunk-5TT47UMX.js";function ie(t,n){let{scope:e,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:c=!1,scanLimit:l}=n??{},d=n?.semantic!==!1,a=new D(t),f=a.scopedDefinitions(e),u=V(a,e),g=L($(t,a,f,{minLoc:i,maxLoc:s}).sort((o,m)=>b(m)-b(o)||o.relativePath.localeCompare(m.relativePath)),l),F=A(a,g,{semantic:d}),k=O(t,a,f,g,{semantic:d}),R=B(g);return N(t,g,F,R).filter(o=>!k.has(o.definition.symbolId)).filter(o=>!o.transitivelyReachable).filter(o=>o.realConsumers.length<=1).filter(o=>!(o.realConsumers.length===0&&o.barrelConsumers>0)).filter(o=>Z(o.definition,o.realConsumers.length,u)).map(o=>j(t,o)).filter(o=>c||o.confidence!=="low").sort((o,m)=>{let C={high:0,medium:1,low:2};return C[o.confidence]-C[m.confidence]||m.loc-o.loc||o.file.localeCompare(m.file)||o.startLine-m.startLine}).slice(0,r)}function $(t,n,e,i){return e.filter(s=>s.isTypeLike&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!H(s.symbol)).filter(s=>!n.hasSuppressionComment(s))}function A(t,n,e){return h(t,n,{semantic:e.semantic})}function B(t){let n=new Map;for(let e of t){let i=n.get(e.relativePath);i||(i=new Map,n.set(e.relativePath,i));let s=p(e.symbol);s&&i.set(s,e)}return n}function N(t,n,e,i){return n.map(s=>{let c=[...e.get(s.symbolId)??new Set].filter(u=>u!==s.relativePath&&!t.isIgnored(u)),{realConsumers:l,barrelConsumers:d,importOnlyConsumers:a}=v(t,s,c),f=_(t,s,e,i);return{definition:s,realConsumers:l,barrelConsumers:d+a,transitivelyReachable:f}})}function j(t,n){let e=w(t,n.definition.relativePath,n.definition.startLine),i=T(n.definition.relativePath)?!0:q(t,n.definition),{confidence:s,reason:r}=G(n.realConsumers.length,e,i);return{symbol:n.definition.symbol,shortName:S(n.definition.symbol),file:n.definition.relativePath,startLine:n.definition.startLine,endLine:n.definition.endLine,loc:b(n.definition),consumers:n.realConsumers.length,barrelConsumers:n.barrelConsumers,kind:e,definerUsesType:i,confidence:s,reason:r}}function O(t,n,e,i,s){let r=W(t,U(e),i),c=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=h(n,c,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:f}of r)E(t,a,l)&&d.add(f);return d}function U(t){let n=new Map;for(let e of t){let i=p(e.symbol);i&&n.set(M(e.relativePath,i),e)}return n}function W(t,n,e){let i=[];for(let s of e){let r=z(t,n,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function z(t,n,e){if(w(t,e.relativePath,e.startLine)!=="class")return null;let i=p(e.symbol);if(!i)return null;let s=K(t,e.relativePath,i);return s?n.get(M(e.relativePath,s))??null:null}function E(t,n,e){let i=p(n.symbol),s=e.get(n.symbolId);return!i||!s?!1:[...s].some(r=>r!==n.relativePath&&!t.isIgnored(r)&&!P(t,r,i))}function M(t,n){return`${t}\0${n}`}function K(t,n,e){let i=y(t,n);if(!i)return null;let s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function V(t,n){return new Set(t.scopedDefinitions(n).filter(e=>e.isFunctionLike).map(e=>e.relativePath))}function H(t){let n=I(t);if("kind"in n)return!1;let e=n.descriptors;if(e.length<2)return!1;let i=e[e.length-1],s=e[e.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let e=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(e==="types"||e.endsWith("-types")||e==="models"||e==="schema"||e==="common"||e==="protocol"||e==="proto"||e==="dto"||e==="mod"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t))}function Z(t,n,e){return!(T(t.relativePath)&&n>0||n===0&&e.has(t.relativePath))}function _(t,n,e,i){let s=x(t,n.relativePath),r=p(n.symbol);if(!r)return!1;let c=s.get(r);if(!c||c.size===0)return!1;let l=i.get(n.relativePath);if(!l)return!1;for(let d of c){let a=l.get(d);if(!a)continue;let f=e.get(a.symbolId);if(f){for(let u of f)if(u!==n.relativePath&&!t.isIgnored(u))return!0}}return!1}function w(t,n,e){let i=y(t,n);if(!i)return"other";let s=i.split(`
2
+ `),r=Math.max(0,e-2),c=Math.min(s.length-1,e+2);for(let l=r;l<=c;l++){let a=(s[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function q(t,n){let e=y(t,n.relativePath);if(!e)return!1;let i=p(n.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),c=e.split(`
3
+ `);for(let l=0;l<c.length;l++)if(!(l>=n.startLine&&l<=n.endLine)&&r.test(c[l]??""))return!0;return!1}function G(t,n,e){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&n==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!e?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{ie as a};
4
+ //# sourceMappingURL=chunk-OHEIZWIA.js.map
@@ -0,0 +1,2 @@
1
+ import{a as r}from"./chunk-NN3O7TPH.js";function a(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function o(e,t){let i=a(t);return r(e,{like:i,includeIgnored:!1}).map(s=>({relativePath:s}))}export{o as a};
2
+ //# sourceMappingURL=chunk-PG3ZI5IH.js.map
@@ -0,0 +1,2 @@
1
+ import{a as C,e as P}from"./chunk-NKJKI6SE.js";import{a as v}from"./chunk-IODTPF5H.js";import{c as Y}from"./chunk-ARBZM2NF.js";import{a as K,g as W,i as z,j as B,k as $,n as L,o as J,p as X}from"./chunk-JB4PUN5S.js";import{d as U}from"./chunk-7O4MJYIW.js";import{c as F}from"./chunk-KJ6CW6EK.js";import{f as T,g as H,i as V,j as O,s as j,t as G,u as q}from"./chunk-7OX2O53H.js";import{d as R,e as p,f as I,g as A,j as S,l as M,n as x,o as N}from"./chunk-5TT47UMX.js";import{a as _}from"./chunk-NN3O7TPH.js";var h=new WeakMap;function Ke(e,t){let i=p(t);return i==="rust"?pe(e,t):i==="typescript"||i==="tsx"||i==="javascript"?fe(e,t):[]}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function fe(e,t){let i=S(e,t);if(!i)return[];let o=h.get(i);if(o)return o;let r=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(t)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(t),n=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(t),s=!1,c=i.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let u=l.namedChild(0);if(!u||u.type!=="call_expression")continue;let f=u.namedChild(0);if(!f)continue;let d=f.type==="member_expression"?f.namedChild(f.namedChildCount-1)?.text:f.text;if(d&&ue.has(d)){s=!0;break}}let a=[];s&&a.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(r||n)&&a.push({startLine:0,endLine:c.endPosition.row,reason:r?"Next.js / Remix route file":"Vite/Vue route component"});for(let l of c.namedChildren){let u=null,f=null;if(l.type==="function_declaration")u=l.namedChild(0)?.text??null,f=l;else if(l.type==="export_statement"){let d=l.namedChild(0);d?.type==="function_declaration"&&(u=d.namedChild(0)?.text??null,f=d)}else if(l.type==="lexical_declaration"){let d=l.namedChild(0);if(d?.type==="variable_declarator"){let b=d.namedChild(0)?.text,m=d.namedChild(1);b&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(u=b,f=d)}}u&&/^use[A-Z]/.test(u)&&f&&a.push({startLine:f.startPosition.row,endLine:f.endPosition.row,reason:"React custom hook (use*)"})}return a.push(...ee(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),h.set(i,a),a}var de=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function me(e){return de.test(e)}function ee(e,t,i){let o=[],r=n=>{if(t.has(n.type)&&n.parent){let c=n.parent.children,a=-1;for(let l=0;l<c.length;l+=1)if(c[l].startIndex===n.startIndex&&c[l].type===n.type){a=l;break}if(a>0)for(let l=a-1;l>=0;l-=1){let u=c[l];if(i.has(u.type)){if(me(u.text)){o.push({startLine:n.startPosition.row,endLine:n.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(u.type==="attribute_item"||u.type==="inner_attribute_item"))break}}for(let s of n.namedChildren)r(s)};return r(e.rootNode),o}function pe(e,t){let i=S(e,t);if(!i)return[];let o=h.get(i);if(o)return o;let r=[],n=be(i);return n?(h.set(i,n),n):(te(i.rootNode,r,!1,!1),r.push(...ee(i,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...Re(i.rootNode)),h.set(i,r),r)}function be(e){return xe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function te(e,t,i,o){let r=i,n=o;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(n=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?ye(e,t,i,o):o&&_e(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ge(e,t,i):e.type==="mod_item"&&w(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(r=!0);for(let s of e.namedChildren)te(s,t,r,n)}function ye(e,t,i,o){let r=w(e),n=null;o?n="trait impl method (dynamic dispatch)":i&&(n="inside #[cfg(test)] mod");for(let s of r){let c=Se(s);if(c){n=c;break}if(ne(s)){n="#[allow(dead_code)]";break}}n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n})}function ge(e,t,i){let o=w(e),r=e.namedChildren.find(n=>n.type==="type_identifier")?.text;o.some(he)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),o.some(ne)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),i&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function w(e){let t=e.parent;if(!t)return[];let i=t.children,o=-1;for(let n=0;n<i.length;n+=1)if(i[n].startIndex===e.startIndex&&i[n].type===e.type){o=n;break}if(o<=0)return[];let r=[];for(let n=o-1;n>=0;n-=1){let s=i[n];if(s.type==="attribute_item"||s.type==="inner_attribute_item")r.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return r}function Se(e){return/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null}function he(e){return/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1}function ne(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function _e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Re(e){let t=ke(e);if(t.size===0)return[];let i=[];for(let o of e.descendantsOfType("mod_item")){let r=o.childForFieldName("name")?.text;r&&t.has(r)&&i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return i}function xe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let i=e.namedChild(t);if(!i||i.type!=="line_comment"&&i.type!=="block_comment")break;if(/@generated\b/.test(i.text)||/This file is .*generated\b/i.test(i.text)||/Code generated by/i.test(i.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(i.text)||/openapi-generator/i.test(i.text)&&/Generated by/i.test(i.text))return!0}return!1}var Ce=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],ie=/^#!?\[\s*serde\s*\(/,Le=/^#!?\[\s*schemars\s*\(/,we=/^#!?\[\s*validate\s*\(/,Z=/\bwith\s*=\s*"([^"]+)"/g;function g(e,t){return x(e,t,Ee,()=>new Set,(i,o,r)=>{if(o==="rust"){for(let n of i.rootNode.descendantsOfType("attribute_item"))Q(n.text,r);for(let n of i.rootNode.descendantsOfType("inner_attribute_item"))Q(n.text,r)}})??new Set}var Ee=new WeakMap;function Q(e,t){let i=ie.test(e),o=Le.test(e),r=we.test(e);if(!(!i&&!o&&!r))for(let{re:n}of Ce){n.lastIndex=0;let s;for(;(s=n.exec(e))!==null;){let c=s[1],a=c.split("::").pop()??c;a==="is_none"&&/\bOption\b/.test(c)||a==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(c)||a&&t.add(a)}}}function ke(e){let t=new Set;for(let i of e.descendantsOfType("attribute_item")){if(!ie.test(i.text))continue;Z.lastIndex=0;let o;for(;(o=Z.exec(i.text))!==null;){let r=o[1],n=r.split("::").pop()??r;n&&t.add(n)}}return t}var De=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function re(e,t){return x(e,t,Ie,()=>new Set,(i,o,r)=>{if(!(o!=="typescript"&&o!=="tsx"&&o!=="javascript"))for(let n of i.rootNode.descendantsOfType("call_expression")){let s=n.namedChild(0);if(!s)continue;let c=N(s);if(!c||!De.has(c))continue;let a=n.namedChildren.find(f=>f.type==="arguments");if(!a)continue;let l=a.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_fragment");u&&r.add(u.text)}})??new Set}var Ie=new WeakMap;function oe(e,t,i={}){let o=new Map;if(t&&t.length===0)return o;let r=_(e,{includeIgnored:!1}),n=$(e),s=t??G(e),c=new Set(s.map(a=>a.symbolId));return Ae(e,o,r,n,c),Me(e,o,s,c),Pe(e,o,r,n,c),i.semantic!==!1&&He(o,U(e,Te(s))),o}function Ae(e,t,i,o,r){for(let n of i){if(!p(n))continue;let s=M(e,n);if(s)for(let c of s){let a=z(n,o.get(c.calleeLeaf)??[]);if(!a||a.length===0)continue;let l=B(e,n,a,c.memberAccess);l&&r.has(l.symbolId)&&l.file!==n&&E(t,l.symbolId,n)}}}function Me(e,t,i,o){let r=ve(i);for(let n of Ne(e,o))e.isIgnored(n.relative_path)||Fe(n,r.get(n.symbol_id))||E(t,n.symbol_id,n.relative_path)}function Ne(e,t){return W(e,t?[...t]:void 0)}function ve(e){let t=new Map;for(let i of e)t.set(i.symbolId,{docId:i.documentId,startLine:i.startLine,endLine:i.endLine});return t}function Fe(e,t){return!!t&&t.docId===e.document_id&&e.chunk_start>=t.startLine&&e.chunk_end<=t.endLine}function Pe(e,t,i,o,r){for(let n of i){if(p(n)!=="rust")continue;let s=g(e,n);if(s.size!==0)for(let c of s){let a=o.get(c);if(a)for(let l of a)r.has(l.symbolId)&&l.file!==n&&E(t,l.symbolId,n)}}}function E(e,t,i){let o=e.get(t);o||(o=new Set,e.set(t,o)),o.add(i)}function Te(e){return e.filter(t=>"relativePath"in t&&"symbol"in t&&"leaf"in t)}function He(e,t){for(let[i,o]of t){let r=e.get(i);r||(r=new Set,e.set(i,r));for(let n of o)r.add(n)}}var se=new WeakMap;function ae(e,t,i,o){let r=p(t);if(!r)return null;let n=S(e,t);if(!n)return null;let s=se.get(n);return s||(s=Ve(n,r),se.set(n,s)),s.get(`${i}:${o}`)??null}function Ve(e,t){let i=A(t),o=new Map,r=n=>{if(i.has(n.type)){let s=n.namedChildren.find(a=>a.type==="parameters"||a.type==="formal_parameters"),c=0;if(s)for(let a of s.namedChildren)a.type==="comment"||a.type==="line_comment"||a.type==="block_comment"||(c+=1);o.set(`${n.startPosition.row}:${n.endPosition.row}`,{paramCount:c})}for(let s of n.children)r(s)};return r(e.rootNode),o}function le(e,t,i){let o=t.identifierResolution==="strict"?L:J;for(let r of t.paths){let n=p(r);if(!(!n&&!(t.includeVueSfc&&I(r)))&&!e.isIgnored(r)&&!t.skipPath?.(r))try{let s=(a,l,u,f)=>{if(t.candidateNames&&!t.candidateNames.has(a))return;let d=t.resolveTargets?t.resolveTargets({sourceFile:r,name:a,kind:l,defaultTargets:f}):f();for(let b of d)i({sourceFile:r,name:a,target:b,occurrences:u,kind:l})},c=K(e,r);for(let[a,l]of c)s(a,"identifier",l.length,()=>o(e,r,a));if(t.includeCrossLanguageDispatchNames)for(let a of re(e,r))s(a,"cross-language-dispatch",1,()=>L(e,r,a));if(t.includeRustAttributeNames&&n==="rust")for(let a of g(e,r))s(a,"rust-attribute",1,()=>o(e,r,a))}finally{t.afterPath?.(r)}}}var ce=class{constructor(t){this.db=t}db;scopedDefinitions(t){return q(this.db,t)}definitionsForFile(t){return j(this.db,t)}productionCallableDefinitions(t={}){let{scope:i,minLoc:o=1,maxLoc:r=Number.POSITIVE_INFINITY,excludeSymbol:n,excludeEntrySurfaces:s=!1,excludeTypesFiles:c=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:l=!1,excludeRustTraitImplMembers:u=!1,includeSuppressed:f=!1,sortByLocDesc:d=!1}=t,b=[];for(let m of this.scopedDefinitions(i)){let y=m.relativePath;if(this.db.isIgnored(y)||s&&P(this.db,y)||!Oe(m,{requireFunctionLikeSymbol:a,requireCallableSymbol:l})||n!==void 0&&m.symbol===n)continue;let D=k(m);D<o||D>r||c&&je(y)||u&&V(m.symbol)||C(y)!=="test"&&(O(m.symbol)||!f&&R(this.db,y,m.startLine)||b.push(m))}return d?b.sort((m,y)=>k(y)-k(m)):b}calleeMap(t,i={}){return Y(this.db,t,i)}crossFileCallerMap(t,i={}){return oe(this.db,t,i)}sourceFallbackCallerFiles(t){return X(this.db,t)}callerFileMap(t,i={}){let o=this.crossFileCallerMap(t,{semantic:i.semantic});return i.sourceFallback===!1?o:Ge(o,this.sourceFallbackCallerFiles(t))}frameworkReferencedSymbolIds(t){let i=new Map;for(let r of t){if(!r.leaf)continue;let n=i.get(r.leaf)??[];n.push(r.symbolId),i.set(r.leaf,n)}let o=new Set;for(let r of _(this.db,{includeIgnored:!1}))if(p(r)==="rust")for(let n of g(this.db,r))for(let s of i.get(n)??[])o.add(s);return o}symbolsWithNonSelfCallees(t,i={}){if(t.length===0)return new Set;let o=new Map(t.map(n=>[n.symbolId,n.symbol])),r=this.calleeMap(t,i);return new Set([...r.entries()].filter(([n,s])=>{let c=o.get(n);return s.some(a=>a.symbol!==c)}).map(([n])=>n))}fileDependencyGraph(t){return v(this.db,t)}fileKind(t){return C(t)}hasSuppressionComment(t){return R(this.db,t.relativePath,t.startLine)}sourceFiles(){return F(this.db)}scanSourceReferences(t,i){le(this.db,t,i)}callableSignature(t){return ae(this.db,t.relativePath,t.startLine,t.endLine)}};function Oe(e,t){return t.requireCallableSymbol?T(e.symbol):t.requireFunctionLikeSymbol?H(e.symbol):e.isFunctionLike}function k(e){return e.endLine-e.startLine+1}function je(e){return(e.split("/").pop()??"").includes("types")}function Ge(e,t){let i=new Map;for(let[o,r]of e)i.set(o,new Set(r));for(let[o,r]of t){let n=i.get(o)??new Set;for(let s of r)n.add(s);i.set(o,n)}return i}export{Ke as a,ce as b};
2
+ //# sourceMappingURL=chunk-QAEDNTY7.js.map
@@ -0,0 +1,2 @@
1
+ import{c as d}from"./chunk-RKTDEIHF.js";import{a}from"./chunk-IODTPF5H.js";function F(n,i={}){let{minSimilarity:f=.5,limit:t=20,scope:o,filePattern:s}=i,p=i.minDeps??(s?1:3),e=g(n,{scope:o,minDeps:p}),u=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&u.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&u.push(c)}if(u.length>t*5)break}return u.sort((r,l)=>l.similarity-r.similarity),u.slice(0,t)}function g(n,i){let{scope:f,minDeps:t}=i,o=a(n,f),s=h(o),p=[];for(let[e,u]of o)u.size>=t&&p.push({file:e,deps:new Set([...u].filter(r=>!s.has(r)))});return p}function h(n){let i=new Set,f=n.size;if(f===0)return i;let t=new Map;for(let o of n.values())for(let s of o)t.set(s,(t.get(s)??0)+1);for(let[o,s]of t)s>=5&&s/f>.3&&i.add(o);return i}function m(n,i,f){let t=new Set;for(let e of n.deps)i.deps.has(e)&&t.add(e);if(t.size<3||n.deps.size<4||i.deps.size<4)return null;let o=d(n.deps,i.deps);if(o<f)return null;let s=[];for(let e of n.deps)i.deps.has(e)||s.push(e);let p=[];for(let e of i.deps)n.deps.has(e)||p.push(e);return{fileA:n.file,fileB:i.file,similarity:o,sharedDeps:[...t],uniqueToA:s,uniqueToB:p}}export{F as a};
2
+ //# sourceMappingURL=chunk-QE6MGGUY.js.map
@@ -0,0 +1,2 @@
1
+ import{a as f,c as y}from"./chunk-MX6F756F.js";import{f as L}from"./chunk-7O4MJYIW.js";import{B as d}from"./chunk-BOVNTAKQ.js";import{c as b,o as h,p as S,t as x}from"./chunk-7OX2O53H.js";import{a as g}from"./chunk-5TT47UMX.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-QPRIYXH4.js.map
@@ -0,0 +1,3 @@
1
+ import{r as d}from"./chunk-JB4PUN5S.js";import{a as h}from"./chunk-ZNUPGRPR.js";import{g}from"./chunk-7OX2O53H.js";import{a as m}from"./chunk-5TT47UMX.js";import{a as p}from"./chunk-NN3O7TPH.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
+ `);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-QWJBIBE6.js.map