scip-query 0.6.7 → 0.6.9

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 (175) hide show
  1. package/dist/chunk-2OP63JQQ.js +2 -0
  2. package/dist/chunk-33Z6HQBX.js +5 -0
  3. package/dist/chunk-3F453KPT.js +2 -0
  4. package/dist/{chunk-2YA36CXK.js → chunk-3JGBAAP7.js} +2 -2
  5. package/dist/chunk-3PKPUCIJ.js +11 -0
  6. package/dist/chunk-42BWO2NN.js +2 -0
  7. package/dist/chunk-4MDCFY3E.js +2 -0
  8. package/dist/chunk-4QWTQ6YV.js +2 -0
  9. package/dist/{chunk-WPY46NIL.js → chunk-5IRX5I64.js} +2 -2
  10. package/dist/chunk-5MPZ2A7J.js +2 -0
  11. package/dist/{chunk-G47V5V3U.js → chunk-67OMD56K.js} +2 -2
  12. package/dist/chunk-6UVVA5I4.js +7 -0
  13. package/dist/{chunk-2R7OKZE5.js → chunk-AXHDRSRI.js} +2 -2
  14. package/dist/{chunk-R373SHXM.js → chunk-BAA4EJRX.js} +2 -2
  15. package/dist/{chunk-QYWGC7JV.js → chunk-BT36WY5B.js} +2 -2
  16. package/dist/chunk-CLKFDBS6.js +39 -0
  17. package/dist/chunk-CWMWTHV3.js +2 -0
  18. package/dist/chunk-DXO2ECRF.js +7 -0
  19. package/dist/chunk-EHEZLULQ.js +85 -0
  20. package/dist/{chunk-2CC7RA6B.js → chunk-GRAEZYYU.js} +2 -2
  21. package/dist/chunk-GWBRU65E.js +2 -0
  22. package/dist/{chunk-6XRB6ATD.js → chunk-I2KUHGMX.js} +2 -2
  23. package/dist/{chunk-HTJ5BOYP.js → chunk-I5BB33E6.js} +2 -2
  24. package/dist/{chunk-TYRPQE6R.js → chunk-IIKNAXAE.js} +2 -2
  25. package/dist/{chunk-RRWPHKZA.js → chunk-IX45SWX5.js} +2 -2
  26. package/dist/{chunk-PQTGBYXV.js → chunk-JLFAQ2E2.js} +2 -2
  27. package/dist/chunk-JMASYYSW.js +2 -0
  28. package/dist/{chunk-IBWYWAWE.js → chunk-LBWLO7NA.js} +2 -2
  29. package/dist/{chunk-55ZJ2FCW.js → chunk-LLDPR3DG.js} +2 -2
  30. package/dist/chunk-LNUZWWWL.js +2 -0
  31. package/dist/{chunk-KYGNCIJ6.js → chunk-NLJCXHFU.js} +8 -8
  32. package/dist/chunk-NRAJIFQA.js +2 -0
  33. package/dist/chunk-OYRGWW6Z.js +2 -0
  34. package/dist/chunk-PVMRIOM6.js +33 -0
  35. package/dist/chunk-SF2HYG53.js +4 -0
  36. package/dist/chunk-SHGPRVWH.js +2 -0
  37. package/dist/chunk-SMOUOKAO.js +2 -0
  38. package/dist/chunk-TPXWXKL6.js +2 -0
  39. package/dist/chunk-TTCUMJ43.js +19 -0
  40. package/dist/chunk-TYR7QY5G.js +2 -0
  41. package/dist/{chunk-FYO3FPFH.js → chunk-U3GYMGBX.js} +2 -2
  42. package/dist/{chunk-OCQN6WF4.js → chunk-UIM4WALN.js} +2 -2
  43. package/dist/chunk-UZG3QXTG.js +2 -0
  44. package/dist/{chunk-KQWFRAQI.js → chunk-V4WRHJU3.js} +2 -2
  45. package/dist/chunk-VDMRAGBK.js +6 -0
  46. package/dist/chunk-W6SRVK2Y.js +5 -0
  47. package/dist/{chunk-7TGEXAN5.js → chunk-WGYJDGBI.js} +2 -2
  48. package/dist/{chunk-JVMXNDRU.js → chunk-WYX3RU2K.js} +2 -2
  49. package/dist/chunk-WZYA234B.js +2 -0
  50. package/dist/{chunk-K345WFTU.js → chunk-Y6ZFXZ7B.js} +2 -2
  51. package/dist/chunk-YCN5XEST.js +7 -0
  52. package/dist/{chunk-ILQSK2KJ.js → chunk-ZO5IFJRM.js} +2 -2
  53. package/dist/cli.js +186 -165
  54. package/dist/{db-DdlToIC-.d.ts → db-Rx8Ho_JF.d.ts} +3 -0
  55. package/dist/index.d.ts +11 -4
  56. package/dist/index.js +23 -23
  57. package/dist/queries/affected.d.ts +1 -1
  58. package/dist/queries/affected.js +1 -1
  59. package/dist/queries/bottlenecks.d.ts +3 -1
  60. package/dist/queries/bottlenecks.js +1 -1
  61. package/dist/queries/by-kind.d.ts +1 -1
  62. package/dist/queries/by-kind.js +1 -1
  63. package/dist/queries/call-graph.d.ts +4 -2
  64. package/dist/queries/call-graph.js +1 -1
  65. package/dist/queries/change-surface.d.ts +4 -2
  66. package/dist/queries/change-surface.js +1 -1
  67. package/dist/queries/code.d.ts +1 -1
  68. package/dist/queries/code.js +1 -1
  69. package/dist/queries/complexity-hotspots.d.ts +2 -1
  70. package/dist/queries/complexity-hotspots.js +1 -1
  71. package/dist/queries/complexity.d.ts +4 -2
  72. package/dist/queries/complexity.js +1 -1
  73. package/dist/queries/convergence.d.ts +4 -2
  74. package/dist/queries/convergence.js +1 -1
  75. package/dist/queries/coupling.d.ts +1 -1
  76. package/dist/queries/coupling.js +1 -1
  77. package/dist/queries/cycles.d.ts +1 -1
  78. package/dist/queries/cycles.js +1 -1
  79. package/dist/queries/dataflow.d.ts +4 -2
  80. package/dist/queries/dataflow.js +1 -1
  81. package/dist/queries/dead.d.ts +1 -1
  82. package/dist/queries/dead.js +1 -1
  83. package/dist/queries/deep-chains.d.ts +1 -1
  84. package/dist/queries/deep-chains.js +1 -1
  85. package/dist/queries/deps.d.ts +1 -1
  86. package/dist/queries/deps.js +1 -1
  87. package/dist/queries/diff-impact.d.ts +1 -1
  88. package/dist/queries/diff-impact.js +1 -1
  89. package/dist/queries/drift.d.ts +2 -1
  90. package/dist/queries/drift.js +1 -1
  91. package/dist/queries/extract-candidates.d.ts +2 -1
  92. package/dist/queries/extract-candidates.js +1 -1
  93. package/dist/queries/fan.d.ts +1 -1
  94. package/dist/queries/fan.js +1 -1
  95. package/dist/queries/files.d.ts +1 -1
  96. package/dist/queries/health-cache-control.d.ts +1 -1
  97. package/dist/queries/health-cache-control.js +1 -1
  98. package/dist/queries/health.d.ts +1 -1
  99. package/dist/queries/health.js +1 -1
  100. package/dist/queries/hierarchy.d.ts +1 -1
  101. package/dist/queries/hierarchy.js +1 -1
  102. package/dist/queries/hotspots.d.ts +1 -1
  103. package/dist/queries/hotspots.js +1 -1
  104. package/dist/queries/imports.d.ts +7 -3
  105. package/dist/queries/imports.js +1 -1
  106. package/dist/queries/index.d.ts +1 -1
  107. package/dist/queries/index.js +1 -1
  108. package/dist/queries/isolated.d.ts +3 -1
  109. package/dist/queries/isolated.js +1 -1
  110. package/dist/queries/members.d.ts +1 -1
  111. package/dist/queries/members.js +1 -1
  112. package/dist/queries/methods.d.ts +1 -1
  113. package/dist/queries/methods.js +1 -1
  114. package/dist/queries/outline.d.ts +1 -1
  115. package/dist/queries/outline.js +1 -1
  116. package/dist/queries/passthrough-candidates.d.ts +2 -1
  117. package/dist/queries/passthrough-candidates.js +1 -1
  118. package/dist/queries/redundant-reexports.d.ts +1 -1
  119. package/dist/queries/redundant-reexports.js +1 -1
  120. package/dist/queries/refs.d.ts +4 -2
  121. package/dist/queries/refs.js +1 -1
  122. package/dist/queries/similar-chains.d.ts +1 -1
  123. package/dist/queries/similar-chains.js +1 -1
  124. package/dist/queries/similar-files.d.ts +1 -1
  125. package/dist/queries/similar-files.js +1 -1
  126. package/dist/queries/similar-signatures.d.ts +3 -1
  127. package/dist/queries/similar-signatures.js +1 -1
  128. package/dist/queries/similar.d.ts +4 -1
  129. package/dist/queries/similar.js +1 -1
  130. package/dist/queries/slice.d.ts +2 -1
  131. package/dist/queries/slice.js +1 -1
  132. package/dist/queries/stale-abstractions.d.ts +2 -1
  133. package/dist/queries/stale-abstractions.js +1 -1
  134. package/dist/queries/stats.d.ts +1 -1
  135. package/dist/queries/surface.d.ts +1 -1
  136. package/dist/queries/surface.js +1 -1
  137. package/dist/queries/symbols.d.ts +1 -1
  138. package/dist/queries/symbols.js +1 -1
  139. package/dist/queries/system.d.ts +1 -1
  140. package/dist/queries/system.js +1 -1
  141. package/dist/queries/trace.d.ts +4 -2
  142. package/dist/queries/trace.js +1 -1
  143. package/dist/queries/wrapper-candidates.d.ts +2 -1
  144. package/dist/queries/wrapper-candidates.js +1 -1
  145. package/package.json +1 -1
  146. package/dist/chunk-2AUZ3PLO.js +0 -2
  147. package/dist/chunk-3A2M7AF3.js +0 -4
  148. package/dist/chunk-3EJRPTTB.js +0 -2
  149. package/dist/chunk-3SWWYJPB.js +0 -6
  150. package/dist/chunk-4M4FEWBL.js +0 -7
  151. package/dist/chunk-4Y6KUJDO.js +0 -39
  152. package/dist/chunk-6FLGPRBR.js +0 -5
  153. package/dist/chunk-7EQ4J66C.js +0 -2
  154. package/dist/chunk-ABLXPGAZ.js +0 -2
  155. package/dist/chunk-BG7YU4DJ.js +0 -2
  156. package/dist/chunk-D2R6IIEO.js +0 -2
  157. package/dist/chunk-E47WMJ5F.js +0 -2
  158. package/dist/chunk-EEA3R37V.js +0 -11
  159. package/dist/chunk-FAN2CVZT.js +0 -2
  160. package/dist/chunk-GS55K4WJ.js +0 -85
  161. package/dist/chunk-HADDFTMU.js +0 -2
  162. package/dist/chunk-IARIBTCL.js +0 -2
  163. package/dist/chunk-K6ULLR7M.js +0 -19
  164. package/dist/chunk-KCC3GMCX.js +0 -2
  165. package/dist/chunk-KRVRD6KZ.js +0 -5
  166. package/dist/chunk-LHLXHH43.js +0 -2
  167. package/dist/chunk-M7GBLQG4.js +0 -7
  168. package/dist/chunk-MEVK6R7N.js +0 -2
  169. package/dist/chunk-RUAJV3TN.js +0 -2
  170. package/dist/chunk-S57GUI2T.js +0 -7
  171. package/dist/chunk-SVUVC5VS.js +0 -2
  172. package/dist/chunk-T426XELO.js +0 -12
  173. package/dist/chunk-TX7BHRMT.js +0 -2
  174. package/dist/chunk-X3Z4KZNX.js +0 -2
  175. package/dist/chunk-ZNNCDAYX.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-ILQSK2KJ.js";import"../chunk-55ZJ2FCW.js";import"../chunk-SVUVC5VS.js";import"../chunk-TYRPQE6R.js";import"../chunk-7EQ4J66C.js";import"../chunk-WPY46NIL.js";import"../chunk-GS55K4WJ.js";import"../chunk-6FLGPRBR.js";import"../chunk-G47V5V3U.js";import"../chunk-QYWGC7JV.js";import"../chunk-KYGNCIJ6.js";export{a as surface};
1
+ import{a}from"../chunk-ZO5IFJRM.js";import"../chunk-LLDPR3DG.js";import"../chunk-LNUZWWWL.js";import"../chunk-IIKNAXAE.js";import"../chunk-JMASYYSW.js";import"../chunk-5IRX5I64.js";import"../chunk-EHEZLULQ.js";import"../chunk-33Z6HQBX.js";import"../chunk-67OMD56K.js";import"../chunk-BT36WY5B.js";import"../chunk-NLJCXHFU.js";export{a as surface};
2
2
  //# sourceMappingURL=surface.js.map
@@ -1,4 +1,4 @@
1
- import { S as ScipDatabase, u as SymbolResult } from '../db-DdlToIC-.js';
1
+ import { S as ScipDatabase, u as SymbolResult } from '../db-Rx8Ho_JF.js';
2
2
  import 'better-sqlite3';
3
3
 
4
4
  declare function symbols(db: ScipDatabase, filePattern: string): SymbolResult[];
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-3EJRPTTB.js";import"../chunk-55ZJ2FCW.js";import"../chunk-QYWGC7JV.js";import"../chunk-KYGNCIJ6.js";export{a as symbols};
1
+ import{a}from"../chunk-SMOUOKAO.js";import"../chunk-LLDPR3DG.js";import"../chunk-BT36WY5B.js";import"../chunk-NLJCXHFU.js";export{a as symbols};
2
2
  //# sourceMappingURL=symbols.js.map
@@ -1,4 +1,4 @@
1
- import { S as ScipDatabase, v as SystemResult } from '../db-DdlToIC-.js';
1
+ import { S as ScipDatabase, v as SystemResult } from '../db-Rx8Ho_JF.js';
2
2
  import 'better-sqlite3';
3
3
 
4
4
  /** Full system map for a module path: files, symbols, deps in/out.
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-RRWPHKZA.js";import"../chunk-55ZJ2FCW.js";import"../chunk-QYWGC7JV.js";import"../chunk-KYGNCIJ6.js";export{a as system};
1
+ import{a}from"../chunk-IX45SWX5.js";import"../chunk-LLDPR3DG.js";import"../chunk-BT36WY5B.js";import"../chunk-NLJCXHFU.js";export{a as system};
2
2
  //# sourceMappingURL=system.js.map
@@ -1,6 +1,8 @@
1
- import { S as ScipDatabase, T as TraceResult } from '../db-DdlToIC-.js';
1
+ import { S as ScipDatabase, T as TraceResult } from '../db-Rx8Ho_JF.js';
2
2
  import 'better-sqlite3';
3
3
 
4
- declare function trace(db: ScipDatabase, symbolPattern: string): TraceResult;
4
+ declare function trace(db: ScipDatabase, symbolPattern: string, opts?: {
5
+ semantic?: boolean;
6
+ }): TraceResult;
5
7
 
6
8
  export { trace };
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-3A2M7AF3.js";import"../chunk-7EQ4J66C.js";import"../chunk-WPY46NIL.js";import"../chunk-GS55K4WJ.js";import"../chunk-6FLGPRBR.js";import"../chunk-G47V5V3U.js";import"../chunk-QYWGC7JV.js";import"../chunk-KYGNCIJ6.js";export{a as trace};
1
+ import{a}from"../chunk-SF2HYG53.js";import"../chunk-JMASYYSW.js";import"../chunk-5IRX5I64.js";import"../chunk-EHEZLULQ.js";import"../chunk-33Z6HQBX.js";import"../chunk-67OMD56K.js";import"../chunk-BT36WY5B.js";import"../chunk-NLJCXHFU.js";export{a as trace};
2
2
  //# sourceMappingURL=trace.js.map
@@ -1,4 +1,4 @@
1
- import { S as ScipDatabase, W as WrapperCandidate } from '../db-DdlToIC-.js';
1
+ import { S as ScipDatabase, W as WrapperCandidate } from '../db-Rx8Ho_JF.js';
2
2
  import 'better-sqlite3';
3
3
 
4
4
  /**
@@ -13,6 +13,7 @@ declare function wrapperCandidates(db: ScipDatabase, opts?: {
13
13
  maxLoc?: number;
14
14
  limit?: number;
15
15
  scanLimit?: number;
16
+ semantic?: boolean;
16
17
  }): WrapperCandidate[];
17
18
 
18
19
  export { wrapperCandidates };
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-4M4FEWBL.js";import"../chunk-SVUVC5VS.js";import"../chunk-TYRPQE6R.js";import"../chunk-7EQ4J66C.js";import"../chunk-WPY46NIL.js";import"../chunk-GS55K4WJ.js";import"../chunk-6FLGPRBR.js";import"../chunk-G47V5V3U.js";import"../chunk-QYWGC7JV.js";import"../chunk-KYGNCIJ6.js";export{a as wrapperCandidates};
1
+ import{a}from"../chunk-DXO2ECRF.js";import"../chunk-LNUZWWWL.js";import"../chunk-IIKNAXAE.js";import"../chunk-JMASYYSW.js";import"../chunk-5IRX5I64.js";import"../chunk-EHEZLULQ.js";import"../chunk-33Z6HQBX.js";import"../chunk-67OMD56K.js";import"../chunk-BT36WY5B.js";import"../chunk-NLJCXHFU.js";export{a as wrapperCandidates};
2
2
  //# sourceMappingURL=wrapper-candidates.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scip-query",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "Language-agnostic code intelligence CLI powered by SCIP indexes",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import{g as c,h as n}from"./chunk-GS55K4WJ.js";import{c as o,h as m}from"./chunk-6FLGPRBR.js";import{n as r}from"./chunk-G47V5V3U.js";import{e as t,i}from"./chunk-KYGNCIJ6.js";import{getHeapStatistics as s}from"v8";var p=64*1024*1024;function P(e,a={}){n(e),a.semanticProvider===!0&&r(e),c(e),m(e),o(e),i(e),t(e)}function _(){let e=globalThis.gc;if(!e)return;let a=s();a.heap_size_limit-a.used_heap_size<p||e()}export{P as a,_ as b};
2
- //# sourceMappingURL=chunk-2AUZ3PLO.js.map
@@ -1,4 +0,0 @@
1
- import{c as S}from"./chunk-7EQ4J66C.js";import{l as d}from"./chunk-GS55K4WJ.js";import{a as f}from"./chunk-QYWGC7JV.js";import{A as m,B as g,d as a,q as s,u}from"./chunk-KYGNCIJ6.js";function _(n,o){let e=f(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=g(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=a(n,o);if(!t)return null;let l=t.split(`
2
- `).slice(e,i+1).join(`
3
- `).trimEnd();return l.length>0?l:null}function b(n,o,e){let i=m(n);if(i&&!h(i))return i;let t=(o??"").trim();return t?u(e)&&!t.endsWith("()")?`${t}()`:t:s(e)}function h(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{_ as a};
4
- //# sourceMappingURL=chunk-3A2M7AF3.js.map
@@ -1,2 +0,0 @@
1
- import{b as e}from"./chunk-55ZJ2FCW.js";import{F as o}from"./chunk-KYGNCIJ6.js";function l(t,r){let s=e(t,r);return o(t,s).map(({relativePath:m,...a})=>a)}export{l as a};
2
- //# sourceMappingURL=chunk-3EJRPTTB.js.map
@@ -1,6 +0,0 @@
1
- import{a as F,b as y,d as A,e as $}from"./chunk-RKTDEIHF.js";import{a as k}from"./chunk-SVUVC5VS.js";import{j as T}from"./chunk-GS55K4WJ.js";import{a as R}from"./chunk-QYWGC7JV.js";import{d as M,q as p,r as q,u as x,x as B}from"./chunk-KYGNCIJ6.js";function se(e,i,t={}){let{minSimilarity:r=.4,limit:l=20}=t,s=Z(e,i);if(!s)return[];if(!x(s.symbol))return[];let n=O(e,s,r);return n.length>0?n.slice(0,l):K(e,i,{minSimilarity:r,limit:l})}function O(e,i,t){let r=E(e,{minCallees:3,excludeSymbol:i.symbol}),l=A([i,...r].map(n=>n.callees)),s=[];for(let n of r){if(n.callees.size<3)continue;let o=v(i,n,l,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0});o&&s.push(o)}return s.sort((n,o)=>o.similarity-n.similarity),s}function v(e,i,t,r){let{similarity:l,significantShared:s}=$(e.callees,i.callees,t);if(l<r.minSimilarity)return null;let n=F(e.callees,i.callees).size;if(s.length<r.requireSignificantShared&&n<r.requireSharedCount)return null;let o=s.length>0?s:[...F(e.callees,i.callees)];return{symbolA:e.symbol,shortNameA:p(e.symbol),fileA:e.file,symbolB:i.symbol,shortNameB:p(i.symbol),fileB:i.file,similarity:l,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(e.callees,i.callees)].map(p),uniqueToB:[...y(i.callees,e.callees)].map(p)}}function le(e,i={}){let{minSimilarity:t=.5,limit:r=20,scope:l,minCallees:s=4,crossFileOnly:n=!1,scanLimit:o}=i,a=E(e,{minCallees:s,scope:l,scanLimit:o}),c=A(a.map(m=>m.callees)),u=new Map;for(let m of a)for(let f of m.callees)u.set(f,(u.get(f)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(a.length))),w=new Map;for(let m=0;m<a.length;m+=1)for(let f of a[m].callees){if((u.get(f)??0)>h)continue;let g=w.get(f);g||(g=[],w.set(f,g)),g.push(m)}let C=[],z=new Set;e:for(let m=0;m<a.length;m+=1){let f=a[m],g=new Set;for(let D of f.callees){let S=w.get(D);if(S)for(let b of S)b>m&&g.add(b)}for(let D of g){let S=`${m}|${D}`;if(z.has(S))continue;z.add(S);let b=a[D];if(n&&f.file===b.file)continue;if(f.paramCount>=0&&b.paramCount>=0){let j=Math.abs(f.paramCount-b.paramCount),_=Math.max(2,Math.ceil(Math.max(f.paramCount,b.paramCount)*.5));if(j>_)continue}let P=v(f,b,c,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4});if(P&&(C.push(P),C.length>r*5))break e}}return C.sort((m,f)=>f.similarity-m.similarity),C.slice(0,r)}var V=["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 Z(e,i){let t=R(e,i),r=new k(e);if(!t)return null;let l=T(e,t);return{symbol:t.symbol,file:t.relativePath,callees:I(l.map(s=>s.symbol)),paramCount:r.callableSignature(t)?.paramCount??-1}}function E(e,i){let{minCallees:t,scope:r,excludeSymbol:l,scanLimit:s}=i,n=new k(e),o=U(n.productionCallableDefinitions({scope:r,minLoc:5,excludeSymbol:l,sortByLocDesc:typeof s=="number"&&s>0}),s),a=n.calleeMap(o);return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:I((a.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:n.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=t)}function U(e,i){return typeof i!="number"||i<=0||e.length<=i?e:e.slice(0,i)}function I(e){return new Set([...e].filter(i=>!W(i)))}function W(e){return V.some(i=>e.includes(i))}function K(e,i,t){let r=G(e,i);if(!r||r.tokens.size<3)return[];let l=t.minSimilarity>=.5?t.minSimilarity:.3,s=[];for(let n of J(e)){if(n.symbol===r.symbol||n.tokens.size<3)continue;let o=F(r.tokens,n.tokens);if(o.size<2)continue;let a=new Set([...r.tokens,...n.tokens]),c=a.size>0?o.size/a.size:0;c<l||s.push({symbolA:r.symbol,shortNameA:p(r.symbol),fileA:r.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(r.tokens,n.tokens)].sort(),uniqueToB:[...y(n.tokens,r.tokens)].sort()})}return s.sort((n,o)=>o.similarity-n.similarity||n.shortNameB.localeCompare(o.shortNameB)),s.slice(0,t.limit)}function G(e,i){let t=R(e,i);if(!t||!x(t.symbol))return null;let r=H(e,t);return r?{symbol:t.symbol,file:t.relativePath,tokens:r}:null}function H(e,i){let t=q(i.symbol),r=L(e,i.relativePath,i.startLine,i.endLine,t),l=N(r,t);return l.size>0?l:null}function J(e){let i=new k(e);return i.scopedDefinitions().filter(t=>t.isFunctionLike).filter(t=>i.fileKind(t.relativePath)!=="test").filter(t=>!B(t.symbol)).map(t=>({symbol:t.symbol,file:t.relativePath,tokens:N(L(e,t.relativePath,t.startLine,t.endLine,t.leaf),t.leaf)})).filter(t=>t.tokens.size>0)}function L(e,i,t,r,l){let s=M(e,i);if(!s)return"";let n=s.split(`
2
- `);if(r>=t&&r-t<=12)return n.slice(t,r+1).join(`
3
- `);let o=[new RegExp(`\\bdef\\s+${d(l)}\\b`),new RegExp(`\\bfun\\s+${d(l)}\\b`),new RegExp(`\\bfn\\s+${d(l)}\\b`),new RegExp(`\\bfunction\\s+${d(l)}\\b`),new RegExp(`\\b${d(l)}\\s*\\(`)],a=n.findIndex(c=>o.some(u=>u.test(c)));if(a>=0){let c=a;for(let u=a+1;u<n.length&&u<=a+8;u++){let h=n[u]??"";if(u>a&&X(h)||(c=u,h.trim()===""&&u>a+1))break}return n.slice(a,c+1).join(`
4
- `)}return n.slice(t,Math.min(n.length,t+8)).join(`
5
- `)}function N(e,i){if(!e)return new Set;let t=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"]),r=Q(i),s=e.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=>!t.has(n)).filter(n=>!r.has(n));return new Set(s)}function Q(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(i=>i.toLowerCase()).filter(i=>i.length>1))}function X(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{se as a,le as b};
6
- //# sourceMappingURL=chunk-3SWWYJPB.js.map
@@ -1,7 +0,0 @@
1
- import{a as F}from"./chunk-SVUVC5VS.js";import{f as g}from"./chunk-GS55K4WJ.js";import{G as M,q as p,r as I,x as C}from"./chunk-KYGNCIJ6.js";import{basename as f,extname as d}from"path";function A(t,e){let{scope:n,maxLoc:o=15,limit:r=30,scanLimit:i}=e??{},a=new F(t),l=_(a.fileDependencyGraph(n)),u=j(x(a,n,o).sort((c,s)=>b(c)-b(s)||c.relativePath.localeCompare(s.relativePath)),i),h=P(a.crossFileCallerMap(u),a.sourceFallbackCallerFiles(u)),m=[];for(let c of u){let s=S(t,a,c,{callerFileMap:h,reverseFanIn:l});s&&m.push(s)}return m.sort((c,s)=>s.callerFanIn-c.callerFanIn||s.loc-c.loc),m.slice(0,r)}function S(t,e,n,o){let r=D(e,n,o.callerFileMap);if(r.length!==1)return null;let i=r[0],a=L(t,n.symbolId,i);if(!a)return null;let l=y(e,t,i,n.symbol,a);if(l&&C(l.symbol))return null;let u=v(o.callerFileMap,o.reverseFanIn,i,l);return u<=3?null:{symbol:n.symbol,shortName:p(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:b(n),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?p(l.symbol):f(i),callerFanIn:u}}function b(t){return t.endLine-t.startLine+1}function x(t,e,n){return t.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:n,requireFunctionLikeSymbol:!0})}function D(t,e,n){let o=f(e.relativePath,d(e.relativePath));return[...n.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>f(r,d(r))!==o).filter(r=>{let i=t.fileKind(r);return i!=="barrel"&&i!=="entry"&&i!=="test"})}function L(t,e,n){return t.get(`SELECT c.start_line, c.end_line
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
- LIMIT 1`,e,n)}function y(t,e,n,o,r){let i=t.definitionsForFile(n),a=k(e,n,o,r.start_line,r.end_line);return M(i,a)}function v(t,e,n,o){if(o?.isFunctionLike){let r=[...t.get(o.symbolId)??[]].filter(i=>i!==o.relativePath);if(r.length>0)return r.length}return N(e,n)}function k(t,e,n,o,r){let i=I(n);if(!i)return o;let a=g(t,e).get(i);if(!a||a.length===0)return o;for(let l of a)if(l>=o&&l<=r)return l;return o}function P(...t){let e=new Map;for(let n of t)for(let[o,r]of n){let i=e.get(o);i||(i=new Set,e.set(o,i));for(let a of r)i.add(a)}return e}function _(t){let e=new Map;for(let[n,o]of t){e.has(n)||e.set(n,e.get(n)??0);for(let r of o)e.set(r,(e.get(r)??0)+1)}return e}function N(t,e){let n=t.get(e)??0;if(n>0)return n;let o=f(e,d(e)),r=0;for(let[i,a]of t)i!==e&&f(i,d(i))===o&&a>r&&(r=a);return r}function j(t,e){return typeof e!="number"||e<=0||t.length<=e?t:t.slice(0,e)}export{A as a};
7
- //# sourceMappingURL=chunk-4M4FEWBL.js.map
@@ -1,39 +0,0 @@
1
- import{a as g}from"./chunk-55ZJ2FCW.js";import{f as a}from"./chunk-6FLGPRBR.js";import{o as u}from"./chunk-G47V5V3U.js";import{a as p}from"./chunk-QYWGC7JV.js";import{q as l,r as c,v as f}from"./chunk-KYGNCIJ6.js";function T(t,r){return h(t,r)?.map(e=>({symbol:e.symbol,shortName:e.shortName,fromFile:e.fromFile}))??[]}function M(t,r){let e=E(t,r);return e.length>0?e:N(t,r)}function J(t,r){return h(t,r)?.filter(e=>!e.used).map(e=>({symbol:e.symbol,shortName:e.shortName,importedIn:e.importer}))??[]}function E(t,r){return t.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- JOIN global_symbols gs ON m.symbol_id = gs.id
6
- WHERE gs.symbol LIKE ?
7
- AND m.role = 2
8
- ORDER BY d.relative_path`,`%${r}%`).filter(s=>!t.isIgnored(s.importer)).map(s=>({symbol:s.symbol,shortName:l(s.symbol),fromFile:s.importer}))}function N(t,r){let e=p(t,r),s=e?.relativePath??null,o=e?c(e.symbol):r.replace(/\(\)$/,""),i=e?f(e.symbol):!1,m=t.all(`SELECT relative_path
9
- FROM documents
10
- WHERE 1 = 1
11
- ${t.pathExclusionsFor("documents")}
12
- ORDER BY relative_path`),d=new Set;for(let n of m)if(!t.isIgnored(n.relative_path))for(let b of a(t,n.relative_path))S(b,n.relative_path,{targetFile:s,targetLeaf:o,targetIsModule:i})&&d.add(n.relative_path);return[...d].sort().map(n=>({symbol:e?.symbol??o,shortName:e?l(e.symbol):o,fromFile:n}))}function S(t,r,e){return!t.sourcePath||e.targetFile&&_(t.sourcePath)!==_(e.targetFile)?!1:t.kind==="side-effect"||e.targetFile&&R(r)||e.targetIsModule||t.kind==="named"&&t.importedName===e.targetLeaf?!0:t.kind==="namespace"&&t.usedMembers.includes(e.targetLeaf)}function h(t,r){let e=g(t,r);return e?O(t,e)??F(t,e)??y(t,e):null}function O(t,r){let s=t.all(`SELECT DISTINCT
13
- gs.symbol,
14
- def_d.relative_path AS from_file,
15
- imp_d.relative_path AS importer,
16
- EXISTS (
17
- SELECT 1
18
- FROM mentions ref_m
19
- JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
20
- WHERE ref_m.symbol_id = gs.id
21
- AND ref_m.role != 1
22
- AND ref_c.document_id = imp_d.id
23
- ) AS used
24
- FROM mentions m
25
- JOIN chunks c ON m.chunk_id = c.id
26
- JOIN documents imp_d ON c.document_id = imp_d.id
27
- JOIN global_symbols gs ON m.symbol_id = gs.id
28
- LEFT JOIN (
29
- SELECT m2.symbol_id, c2.document_id
30
- FROM mentions m2
31
- JOIN chunks c2 ON m2.chunk_id = c2.id
32
- WHERE m2.role = 1
33
- GROUP BY m2.symbol_id
34
- ) sym_def ON sym_def.symbol_id = gs.id
35
- LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
36
- WHERE imp_d.relative_path = ?
37
- AND m.role = 2
38
- ORDER BY def_d.relative_path, gs.symbol`,r).filter(o=>!t.isIgnored(o.importer));if(s.length>0){let o=u(t,r);return s.map(i=>({symbol:i.symbol,shortName:l(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||o.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function F(t,r){let e=u(t,r);return e.length>0?e.map(s=>{let o=I(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:r,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function y(t,r){return a(t,r).map(e=>{let s=I(e.importedName,e.localName,e.kind),o=e.kind==="side-effect"?!0:e.used;return{symbol:s,shortName:s,fromFile:e.sourcePath??"(external)",importer:r,used:o}})}function I(t,r,e){return e==="namespace"&&t==="*"&&r?`* as ${r}`:e==="default"&&r?`default as ${r}`:e==="side-effect"?"(side effect import)":r&&r!==t?`${t} as ${r}`:t}function _(t){return t.replace(/\\/g,"/")}function R(t){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(t)}export{T as a,M as b,J as c};
39
- //# sourceMappingURL=chunk-4Y6KUJDO.js.map
@@ -1,5 +0,0 @@
1
- import{a as b,b as j,c as U,d as Z,e as K,f as T,g as O,h as _,i as B,j as W,k as h,l as J,m as z}from"./chunk-G47V5V3U.js";import{a as $,c as Q,d as k,g as L,h as X,j as g}from"./chunk-KYGNCIJ6.js";function Y(e){return e.replace(/'''[\s\S]*?'''/g,C).replace(/"""[\s\S]*?"""/g,C).replace(/#.*$/gm,C).replace(/\/\/.*$/gm,C).replace(/\/\*[\s\S]*?\*\//g,C).replace(/`(?:\\[\s\S]|[^`])*`/g,C).replace(/'(?:\\.|[^'\\\r\n])*'/g,C).replace(/"(?:\\.|[^"\\\r\n])*"/g,C)}function C(e){return e.replace(/[^\r\n]/g," ")}var G=Q("stripped-lines");function Dt(e,r,t){return G.get(e,r,t,()=>Y(t).split(`
2
- `))}function kt(e){G.invalidateAll(e),F=null,w=""}var F=null,w="";function _e(e){return F===e||(F=e,w=Y(e)),w}function E(e,r,t){let s=_e(e);return`${s.slice(0,r)}${" ".repeat(t-r)}${s.slice(t)}`}function S(e,r){return new RegExp(`\\b${ee(r)}\\b`,"m").test(e)}function A(e,r){let t=new Set,s=new RegExp(`\\b${ee(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let n of e.matchAll(s)){let i=n[1];i&&t.add(i)}return[...t]}function ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ce=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(e){let r=[],t=0,s=0;for(let n=0;n<e.length;n++){let i=e[n];(i==="{"||i==="["||i==="(")&&t++,(i==="}"||i==="]"||i===")")&&t--,i===","&&t===0&&(r.push(e.slice(s,n)),s=n+1)}return r.push(e.slice(s)),r}function y(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function f(e,r){let t=new Set,s=(n,i)=>{let o=i||r.has(n.type);!o&&Ce.has(n.type)&&t.add(n.text);for(let a of n.children)s(a,o)};return s(e.rootNode,!1),t}function P(e,r,t,s,n,i,o){return{importedName:n,localName:i,sourcePath:o??h(e,s,K(r)),kind:"named",used:S(t,i),usedMembers:[]}}function N(e,r,t){let s=[];for(let n of e.matchAll(r)){let i=n[0];if(!i||typeof n.index!="number")continue;let o=E(e,n.index,n.index+i.length);for(let a of t(n,o))s.push(a)}return s}function re(e,r,t){let s=g(e,r);return s?Ee(e,r,s):we(t).flatMap(n=>qe(e,r,n.clause,n.specifier,n.start,n.end,t))}function Ee(e,r,t){let s=Re(e,r,t),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))n.push(...Te(e,r,t,i,s));return n}function Re(e,r,t){let s=f(t,new Set(["import_statement"]));if(X(r))for(let n of Ke(e,r))s.add(n);return s}function Te(e,r,t,s,n){let i=Oe(s);if(!i)return[];let o=T(e,r,i),a=y(s,"import_clause");return a?De(t,a,o,n,ve(s.text)):[ke(o)]}function De(e,r,t,s,n){let i=[];for(let o of r.namedChildren)if(o.type==="identifier")i.push(Ae(o.text,t,s,n));else if(o.type==="namespace_import"){let a=Me(e,o,t,s,n);a&&i.push(a)}else o.type==="named_imports"&&i.push(...$e(o,t,s,n));return i}function ke(e){return{importedName:"*",localName:null,sourcePath:e,kind:"side-effect",used:!0,usedMembers:[]}}function Ae(e,r,t,s){return{importedName:"default",localName:e,sourcePath:r,kind:"default",used:t.has(e),usedMembers:[],isTypeOnly:s}}function Me(e,r,t,s,n){let o=y(r,"identifier")?.text??"";if(!o)return null;let a=je(e,o);return{importedName:"*",localName:o,sourcePath:t,kind:"namespace",used:a.length>0||s.has(o),usedMembers:a,isTypeOnly:n}}function $e(e,r,t,s){let n=[];for(let i of e.namedChildren){if(i.type!=="import_specifier")continue;let o=i.namedChild(0),a=i.namedChild(1);if(!o)continue;let c=o.text,p=a?.text??c;n.push({importedName:c,localName:p,sourcePath:r,kind:"named",used:t.has(p),usedMembers:[],isTypeOnly:s||Le(i.text)})}return n}function Oe(e){let r=y(e,"string");if(!r)return null;let t=y(r,"string_fragment");return t?t.text:null}function ve(e){return/^\s*import\s+type\b/.test(e)}function Le(e){return/^\s*type\b/.test(e.trim())}function je(e,r){let t=new Set;for(let s of e.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),i=s.namedChild(1);!n||!i||n.type!=="identifier"||n.text!==r||(i.type==="property_identifier"||i.type==="identifier")&&t.add(i.text)}return[...t]}function we(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(t)){let i=n[0],o=n[1],a=n[2];!i||!a||typeof n.index!="number"||r.push({clause:o,specifier:a,start:n.index,end:n.index+i.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(s)){let i=n[0],o=n[1];!i||!o||typeof n.index!="number"||r.push({clause:null,specifier:o,start:n.index,end:n.index+i.length})}return r.sort((n,i)=>n.start-i.start)}function qe(e,r,t,s,n,i,o){let a=T(e,r,s),c=E(o,n,i);return t?Ue(t).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let m=A(c,u.localName);return{...u,used:m.length>0||S(c,u.localName),usedMembers:m}}return u.kind==="side-effect"?{...u,used:!0,usedMembers:[]}:{...u,used:u.localName?S(c,u.localName):!1,usedMembers:[]}}):[{importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]}]}function Ue(e){let r=e.trim(),t=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,i]=Be(s),o=[];return n&&o.push(...te(n,t)),i&&o.push(...te(i,t)),o}function te(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let s=t.slice(1,-1).trim();return s?x(s).map(n=>{let i=n.trim(),o=r||/^type\b/.test(i),a=i.replace(/^type\s+/,""),[c,p]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(p??c).trim(),kind:"named",isTypeOnly:o}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Be(e){let r=0;for(let t=0;t<e.length;t++){let s=e[t];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function se(e,r){let t=g(e,r);if(t)return He(e,r,t);let s=k(e,r);return s?We(e,r,s):[]}function We(e,r,t){return[...Je(e,r,t),...ze(e,r,t),...Fe(e,r,t)]}function Je(e,r,t){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=i[2]??"",c=x(o).map(m=>Ve(m.trim())).filter(m=>!!m),p=M(t,i.index),u=M(t,i.index+i[0].length-1);s.push({kind:"named",sourcePath:T(e,r,a),names:c,startLine:p,endLine:u})}return s}function ze(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[2]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star-as",sourcePath:T(e,r,o),names:[],startLine:a,endLine:c})}return s}function Fe(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star",sourcePath:T(e,r,o),names:[],startLine:a,endLine:c})}return s}function Ve(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function M(e,r){let t=0;for(let s=0;s<r&&s<e.length;s++)e.charCodeAt(s)===10&&t++;return t}function He(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("export_statement")){let i=Qe(e,r,n);if(i===void 0)continue;let o=n.startPosition.row,a=n.endPosition.row,c=Xe(n,i,o,a);s.push(c)}return s}function Qe(e,r,t){let s=y(t,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return T(e,r,n.text)}function Xe(e,r,t,s){let n=y(e,"export_clause");if(n){let o=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&o.push((p??c).text)}return{kind:"named",sourcePath:r,names:o,startLine:t,endLine:s}}return y(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:s}}var Ze=$("vue-non-script-identifiers");function Ke(e,r){return Ze.get(e,r,()=>{let t=new Set,s=k(e,r);if(!s)return t;let i=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,o=>o.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,o=>o.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,o=>o.replace(/[^\r\n]/g," "));for(let o of i.matchAll(/[A-Za-z_$][\w$]*/g))t.add(o[0]);return t})}import{basename as ne}from"path";function oe(e,r,t){let s=g(e,r);return s?Ye(e,r,s):N(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,i)=>{let o=n[1]?.trim();if(!o)return[];let a=ne(o).replace(/\.[^.]+$/,"");return[{importedName:o,localName:a,sourcePath:W(e,r,o),kind:"named",used:S(i,a),usedMembers:[]}]})}function Ye(e,r,t){let s=f(t,new Set(["preproc_include"])),n=[];for(let i of t.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of i.namedChildren){if(c.type==="system_lib_string"){o=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){o=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!o)continue;let a=ne(o).replace(/\.[^.]+$/,"");n.push({importedName:o,localName:a,sourcePath:W(e,r,o),kind:"named",used:s.has(a),usedMembers:[]})}return n}function ie(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let i=n[1]?.trim(),o=n[2]?.trim()??null,a=n[0];if(!i||!a||typeof n.index!="number")continue;let c=E(t,n.index,n.index+a.length);s.push({importedName:i,localName:o,sourcePath:J(e,r,i),kind:o?"namespace":"side-effect",used:o?S(c,o):!0,usedMembers:o?A(c,o):[]})}return s}function ae(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let i=n[1]?.trim();i&&s.push({specifier:i,sourcePath:J(e,r,i)})}return s}function ce(e,r,t){let s=g(e,r),n=L(r);if(s&&n==="csharp")return et(e,r,s);if(s&&n==="vb")return Ge(e,r,s);let i=Z(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(t,i,(o,a)=>{let c=o[1]?.trim();if(!c)return[];let[p,u]=c.split(/\s*=\s*/),m=!!u,l=(m?u:p)?.trim()??c,d=l.split(".").pop()??l,I=m?p?.trim()??d:d;return[P(e,r,a,l,d,I,h(e,l,j))]})}function Ge(e,r,t){let s=f(t,new Set(["imports_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("imports_statement")){let o=i.namedChildren.filter(l=>l.type==="namespace_name");if(o.length===0)continue;let a=o[o.length-1],c=o.length>1?o[0]:null,p=a.text,u=p.split(".").pop()??p,m=c?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,j),kind:c?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function et(e,r,t){let s=f(t,new Set(["using_directive"])),n=[];for(let i of t.rootNode.descendantsOfType("using_directive")){let o=i.namedChildren;if(o.length===0)continue;let a=null,c;o.length>=2&&o[0].type==="identifier"&&(o[1].type==="qualified_name"||o[1].type==="identifier")?(a=o[0],c=o[1]):c=o[o.length-1];let p=c.text,u=p.split(".").pop()??p,m=a?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,j),kind:a?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function pe(e,r,t){let s=g(e,r),n=L(r);return s&&n==="java"?tt(e,r,s):s&&n==="kotlin"?rt(e,r,s):s&&n==="scala"?st(e,r,s):N(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(i,o)=>{let a=i[1]?.trim();return a?nt(e,r,a,o):[]})}function tt(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.children.some(m=>m.type==="asterisk"),c=i.namedChildren.find(m=>m.type==="scoped_identifier")??i.namedChildren.find(m=>m.type==="identifier");if(!c)continue;let p=c.text;if(o){n.push({importedName:"*",localName:null,sourcePath:h(e,p,b),kind:"namespace",used:!0,usedMembers:[]});continue}let u=p.split(".").pop()??p;n.push({importedName:u,localName:u,sourcePath:h(e,p,b),kind:"named",used:s.has(u),usedMembers:[]})}return n}function rt(e,r,t){let s=f(t,new Set(["import_header","import_list"])),n=[];for(let i of t.rootNode.descendantsOfType("import_header")){let o=i.namedChildren.find(d=>d.type==="identifier");if(!o)continue;let a=i.namedChildren.some(d=>d.type==="wildcard_import"),c=i.namedChildren.find(d=>d.type==="import_alias");if(a){n.push({importedName:"*",localName:null,sourcePath:h(e,o.text,b),kind:"namespace",used:!0,usedMembers:[]});continue}let p=o.text,u=p.split(".").pop()??p,l=c?.namedChild(0)?.text??u;n.push({importedName:u,localName:l,sourcePath:h(e,p,b),kind:"named",used:s.has(l),usedMembers:[]})}return n}function st(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.namedChildren.find(m=>m.type==="namespace_selectors"||m.type==="namespace_wildcard"),a=i.namedChildren.filter(m=>m!==o&&(m.type==="identifier"||m.type==="stable_identifier")),c=a.map(m=>m.text).join(".");if(!c)continue;if(o?.type==="namespace_wildcard"){n.push({importedName:"*",localName:null,sourcePath:h(e,c,b),kind:"namespace",used:!0,usedMembers:[]});continue}if(o?.type==="namespace_selectors"){for(let m of o.namedChildren)if(m.type==="arrow_renamed_identifier"){let[l,d]=m.namedChildren;if(!l)continue;let I=l.text,R=d?.text??I;if(I==="_")continue;n.push({importedName:I,localName:R,sourcePath:h(e,`${c}.${I}`,b),kind:"named",used:s.has(R),usedMembers:[]})}else if(m.type==="identifier"){let l=m.text;n.push({importedName:l,localName:l,sourcePath:h(e,`${c}.${l}`,b),kind:"named",used:s.has(l),usedMembers:[]})}continue}let p=a[a.length-1]?.text??c,u=a.slice(0,-1).map(m=>m.text).join(".")||c;n.push({importedName:p,localName:p,sourcePath:h(e,u&&a.length>1?`${u}.${p}`:c,b),kind:"named",used:s.has(p),usedMembers:[]})}return n}function nt(e,r,t,s){if(t.includes("{")&&t.includes("}")){let n=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),i=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let m=(p??u.split(".").pop()??u).trim(),l=u==="_"?n:`${n}.${u}`.replace(/\.\./g,".");return[P(e,r,s,l,u,m)]})}return[P(e,r,s,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function ue(e,r,t){let s=g(e,r);return s?ot(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?x(o).flatMap(a=>{let c=a.trim();if(!c)return[];let[p,u]=c.split(/\s+as\s+/i),m=p?.trim()??c,l=m.split("\\").pop()??m,d=(u??l).trim();return[P(e,r,i,m,l,d,h(e,m.replace(/\\/g,"."),U))]}):[]})}function ot(e,r,t){let s=f(t,new Set(["namespace_use_declaration"])),n=[],i=(o,a,c)=>{n.push({importedName:a,localName:c,sourcePath:h(e,o.replace(/\\/g,"."),U),kind:"named",used:s.has(c),usedMembers:[]})};for(let o of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=o.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=o.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:u,localName:m,qualified:l}=me(p,c);u&&i(l,u,m)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=me(c,"");p&&i(m,p,u)}}return n}function me(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),s=e.namedChildren.filter(p=>p.type==="name"),n="";t?n=t.text:s.length>=1&&(n=s[0].text);let i=t&&s.length>0?s[s.length-1]:null,o=n.split("\\").pop()??n,a=i?.text??o,c=r?`${r}\\${n}`:n;return{importedName:o,localName:a,qualified:c}}function fe(e,r,t){let s=g(e,r);return s?it(e,r,s):ct(t).flatMap(n=>mt(e,r,n,t))}function it(e,r,t){let s=f(t,new Set(["import_statement","import_from_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))for(let o of i.namedChildren){let a=le(o);if(!a)continue;let c=O(e,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let i of t.rootNode.descendantsOfType("import_from_statement")){let o=i.namedChild(0);if(!o)continue;let a=at(o);if(a===null)continue;let c=O(e,r,a);for(let p=1;p<i.namedChildCount;p+=1){let u=i.namedChild(p);if(u.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let m=le(u);m&&n.push({importedName:m.qualifiedName,localName:m.localName,sourcePath:c,kind:"named",used:s.has(m.localName),usedMembers:[]})}}return n}function le(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function at(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=y(e,"import_prefix")?.text??"",t=y(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function ct(e){let r=e.split(`
3
- `),t=[],s=0;for(let n=0;n<r.length;n++){let i=r[n],o=i.trimStart(),a=s;if(s+=i.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=i,p=a+i.length,u=de(i);for(;n+1<r.length&&(u>0||c.trimEnd().endsWith("\\"));){n++;let l=r[n];c+=`
4
- ${l}`,p+=1+l.length,u+=de(l),s+=l.length+1}let m=pt(c);m&&t.push({...m,start:a,end:p})}return t}function pt(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let s=t[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:t[1],clause:s}}function mt(e,r,t,s){let n=E(s,t.start,t.end),i=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return x(i).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[u,m]=p.split(/\s+as\s+/),l=u.trim(),d=(m??l.split(".")[0]??l).trim(),I=O(e,r,l),R=A(n,d);return[{importedName:l,localName:d,sourcePath:I,kind:"namespace",used:S(n,d)||R.length>0,usedMembers:R}]});let o=t.module?O(e,r,t.module):null,a=[];for(let c of x(i)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:o,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,m]=p.split(/\s+as\s+/),l=(m??u).trim();a.push({importedName:u.trim(),localName:l,sourcePath:o,kind:"named",used:S(n,l),usedMembers:[]})}return a}function de(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as ut}from"path";function ge(e,r,t){let s=g(e,r);return s?lt(e,r,s):N(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,i)=>{let o=n[1],a=n[2];if(!o||!a)return[];let c=o==="require_relative"?B(e,r,a):null;if(c){let p=he(a);return[{importedName:p,localName:p,sourcePath:c,kind:"named",used:S(i,p),usedMembers:[]}]}return[{importedName:a,localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]}]})}function lt(e,r,t){let s=f(t,new Set([])),n=[],i=new Set(["require","require_relative","load"]);for(let o of t.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!i.has(a.text))continue;let p=o.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let m=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!m)continue;let l=a.text==="require_relative"?B(e,r,m):null;if(l){let d=he(m);n.push({importedName:d,localName:d,sourcePath:l,kind:"named",used:s.has(d),usedMembers:[]})}else n.push({importedName:m,localName:null,sourcePath:l,kind:"side-effect",used:!0,usedMembers:[]})}return n}function he(e){return ut(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Se(e,r,t){let s=g(e,r);return s?dt(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?ft(e,r,o,i):[]})}function dt(e,r,t){let s=f(t,new Set(["use_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("use_declaration")){let o=i.namedChild(0);if(o)for(let a of v(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=_(e,r,a.qualifiedName)??_(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push({importedName:a.importedName,localName:a.localName,sourcePath:c,kind:"named",used:s.has(a.localName),usedMembers:[]})}}return n}function v(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:q(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,s=t.split("::").pop()??t;return[{qualifiedName:q(r,t),importedName:s,localName:s}]}case"scoped_use_list":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=q(r,t.text),i=[];for(let o of s.namedChildren)i.push(...v(o,n));return i}case"use_list":{let t=[];for(let s of e.namedChildren)t.push(...v(s,r));return t}case"use_as_clause":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=v(t,r),i=s.text;return n.map(o=>({...o,localName:i}))}case"use_wildcard":{let t=e.namedChild(0),s=t?t.text:"";return[{qualifiedName:q(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function q(e,r){return e?r?`${e}::${r}`:e:r}function ft(e,r,t,s){let n=t.trim();if(n.includes("{")&&n.includes("}")){let u=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),m=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(m).flatMap(l=>{let d=l.trim();if(!d||d==="self")return[];let[I,R]=d.split(/\s+as\s+/),D=I?.trim();if(!D)return[];let Pe=(R??D.split("::").pop()??D).trim(),be=`${u}::${D}`.replace(/::::/g,"::");return[P(e,r,s,be,D.split("::").pop()??D,Pe,_(e,r,u))]})}let[i,o]=n.split(/\s+as\s+/),a=i?.trim()??n,c=(o??a.split("::").pop()??a).trim(),p=_(e,r,a)??_(e,r,a.split("::").slice(0,-1).join("::"));return[P(e,r,s,a,a.split("::").pop()??a,c,p)]}function xe(e,r,t){let s=g(e,r);if(s)return gt(e,r,s);let n=[];for(let i of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=i[1]?.trim();o&&n.push(...St(e,r,o))}return n}function gt(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("use_declaration")){if(!ht(n))continue;let i=n.namedChildren.find(o=>o.type!=="visibility_modifier");if(i)for(let o of v(i,""))o.importedName&&s.push(V(e,r,o.qualifiedName))}return s}function ht(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function St(e,r,t){let s=t.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),i=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${n}::${c?.trim()??a}`.replace(/::::/g,"::");return[V(e,r,p)]})}return[V(e,r,s)]}function V(e,r,t){return{specifier:t,sourcePath:_(e,r,t)??_(e,r,t.split("::").slice(0,-1).join("::"))}}function ye(e,r){let t=r.toLowerCase();for(let s of e)for(let n of s.extensions)if(t.endsWith(n))return s;return null}var xt={language:"javascript",extensions:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],parseImports:re},yt={language:"python",extensions:[".py",".pyi"],parseImports:fe},Nt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:pe},It={language:"rust",extensions:[".rs"],parseImports:Se,parseExports:xe},Pt={language:"ruby",extensions:[".rb"],parseImports:ge},bt={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:oe},_t={language:"dotnet",extensions:[".cs",".vb"],parseImports:ce},Ct={language:"dart",extensions:[".dart"],parseImports:ie,parseExports:ae},Et={language:"php",extensions:[".php"],parseImports:ue},Rt=[xt,yt,Nt,It,Pt,bt,_t,Ct,Et];function H(e){return ye(Rt,e)}function Br(e,r){return se(e,r)}var Ne=$("source-imports"),Ie=$("source-exports");function Wr(e,r){let t=z(r);return Ne.get(e,t,()=>{let s=H(t);if(!s)return[];let n=k(e,t);return n?s.parseImports(e,t,n):[]})}function Jr(e,r){let t=z(r);return Ie.get(e,t,()=>{let s=H(t);if(!s?.parseExports)return[];let n=k(e,t);return n?s.parseExports(e,t,n):[]})}function zr(e){Ne.invalidateAll(e),Ie.invalidateAll(e)}export{Y as a,Dt as b,kt as c,ee as d,Br as e,Wr as f,Jr as g,zr as h};
5
- //# sourceMappingURL=chunk-6FLGPRBR.js.map
@@ -1,2 +0,0 @@
1
- import{c as p}from"./chunk-WPY46NIL.js";import{d as b,e as S,n as u}from"./chunk-GS55K4WJ.js";import{f as y}from"./chunk-6FLGPRBR.js";import{p as L}from"./chunk-G47V5V3U.js";import{c as x}from"./chunk-QYWGC7JV.js";import{C as I,G as R,d,r as h}from"./chunk-KYGNCIJ6.js";function g(n,a,t){let e=u(n).get(t);if(!e||e.length===0)return[];if(e.length===1)return[m(e[0])];let s=e.filter(r=>r.file===a);if(s.length>0)return s.map(m);let i=F(n,a),o=i.get(t);if(o)for(let r of o){let f=e.filter(l=>w(r,l.file));if(f.length>0)return f.map(m)}let c=new Set;for(let r of i.values())for(let f of r)c.add(f);for(let r of c){let f=e.filter(l=>w(r,l.file));if(f.length>0&&f.length===e.length)return f.map(m)}return[]}function C(n,a,t){let e=g(n,a,t);if(e.length>0)return e;let s=u(n).get(t);return!s||s.length===0?[]:s.map(m)}function E(n,a){let t=x(n,a);if(!t)return[];let e=h(t.symbol);if(!e)return[];let s=L(n,{...t,leaf:e,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let r=o.get(c.file)??[];r.push(c.line),o.set(c.file,r)}return D(n,o)}let i=new Map;for(let o of p(n)){let c=d(n,o);if(!c||c.indexOf(e)===-1||o!==t.relativePath&&!g(n,o,e).some(l=>l.symbolId===t.symbolId))continue;let r=b(n,o,e,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});r.length>0&&i.set(o,r)}return D(n,i)}function A(n,a){let t=new Map;for(let i of a){if(!i.leaf)continue;let o=t.get(i.leaf)??[];o.push(i),t.set(i.leaf,o)}if(t.size===0)return new Map;let e=new Set(a.map(i=>i.symbolId)),s=new Map;for(let i of p(n)){let o=S(n,i);if(o.size!==0){for(let c of o)if(t.has(c))for(let r of g(n,i,c)){if(!e.has(r.symbolId)||i===r.relativePath)continue;let f=s.get(r.symbolId);f||(f=new Set,s.set(r.symbolId,f)),f.add(i)}}}return s}function F(n,a){let t=new Map;for(let e of y(n,a)){if(!e.sourcePath)continue;let s=e.localName??e.importedName;if(s){let i=t.get(s);i||(i=new Set,t.set(s,i)),i.add(e.sourcePath)}if(e.kind==="namespace")for(let i of e.usedMembers){let o=t.get(i);o||(o=new Set,t.set(i,o)),o.add(e.sourcePath)}}return t}function w(n,a){let t=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return t(n)===t(a)}function m(n){return{symbolId:n.symbolId,symbol:n.symbol,relativePath:n.file}}function D(n,a){let t=[],e=new Set;for(let[s,i]of a){let o=I(n,s);for(let c of i){let r=R(o,c),f=`${s}|${c}|${r?.symbol??""}`;e.has(f)||(e.add(f),t.push({file:s,line:c,enclosingSymbol:r?.symbol??null}))}}return t}export{g as a,C as b,E as c,A as d};
2
- //# sourceMappingURL=chunk-7EQ4J66C.js.map
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-SVUVC5VS.js";import{q as m}from"./chunk-KYGNCIJ6.js";function L(o,t){let{scope:n,minLoc:r=10,limit:a=30,scanLimit:b}=t??{},{definitions:d,callerMap:y,calleeMap:f}=C(o,n,b);return d.map(e=>{let s=e.endLine-e.startLine+1,c=y.get(e.symbolId)?.size??0,p=f.get(e.symbolId)??[],x=p.filter(l=>l.file!==e.relativePath),i=new Set(x.map(l=>`${l.symbol}|${l.file}`)).size,M=new Set(p.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:m(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:s,fanIn:c,fanOut:i,calleeCount:M,score:Math.round(s/50*(c/5)*Math.max(i/5,1)*100)/100}}).filter(e=>e.loc>=r).sort((e,s)=>s.score-e.score||s.loc-e.loc).slice(0,a)}function C(o,t,n){let r=new u(o),a=S(r.productionCallableDefinitions({scope:t,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof n=="number"&&n>0}),n);return{definitions:a,callerMap:r.crossFileCallerMap(a),calleeMap:r.calleeMap(a)}}function S(o,t){return typeof t!="number"||t<=0||o.length<=t?o:o.slice(0,t)}export{L as a};
2
- //# sourceMappingURL=chunk-ABLXPGAZ.js.map
@@ -1,2 +0,0 @@
1
- import{a as l}from"./chunk-SVUVC5VS.js";import{a as i}from"./chunk-QYWGC7JV.js";import{q as s,s as m,y as n}from"./chunk-KYGNCIJ6.js";function c(r,a){let t=i(r,a);return t?new l(r).definitionsForFile(t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>n(t.symbol,e.symbol)).sort((e,o)=>e.startLine-o.startLine||e.endLine-o.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:m(e.symbol)??"unknown"})):[]}export{c as a};
2
- //# sourceMappingURL=chunk-BG7YU4DJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-SVUVC5VS.js";import{q as f}from"./chunk-KYGNCIJ6.js";function E(e,l={}){let{scope:t,minLoc:o=10,minCallees:s=6,limit:n=20,scanLimit:c}=l,r=new m(e),i=r.productionCallableDefinitions({scope:t,minLoc:o,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),g=L(i,c),p=r.calleeMap(g),d=[];for(let a of g){let u=b(a,p.get(a.symbolId)??[],s);u&&d.push(u)}return d.sort((a,u)=>u.clusters.length-a.clusters.length||u.loc-a.loc),d.slice(0,n)}function b(e,l,t){let o=new Set(l.map(r=>r.symbol));if(o.size<t)return null;let s=h(o,l),n=S(o,s);if(n.length<2)return null;let c=C(n,s);return c.length===0?null:{symbol:e.symbol,shortName:f(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:x(e),totalCallees:o.size,clusters:c}}function h(e,l){let t=new Map;for(let s of e)t.set(s,new Set);let o=new Map;for(let s of l){let n=o.get(s.chunkId);n||(n=new Set,o.set(s.chunkId,n)),n.add(s.symbol)}for(let s of o.values()){let n=[...s];for(let c=0;c<n.length;c++)for(let r=c+1;r<n.length;r++)t.get(n[c]).add(n[r]),t.get(n[r]).add(n[c])}return t}function S(e,l){let t=new Set,o=[];for(let s of e){if(t.has(s))continue;let n=new Set,c=[s];for(;c.length>0;){let r=c.pop();if(!t.has(r)){t.add(r),n.add(r);for(let i of l.get(r)??[])t.has(i)||c.push(i)}}o.push(n)}return o}function C(e,l){return e.filter(t=>t.size>=3).map(t=>y(t,e,l)).filter(t=>t.isolation>.5).sort((t,o)=>o.isolation-t.isolation)}function y(e,l,t){let o=new Set;for(let r of l)if(r!==e)for(let i of r)o.add(i);let s=0;for(let r of e)for(let i of t.get(r)??[])o.has(i)&&s++;let n=e.size*o.size,c=n>0?1-s/n:1;return{callees:[...e].map(f),isolation:c}}function x(e){return e.endLine-e.startLine+1}function L(e,l){return typeof l!="number"||l<=0||e.length<=l?e:e.slice(0,l)}export{E as a};
2
- //# sourceMappingURL=chunk-D2R6IIEO.js.map
@@ -1,2 +0,0 @@
1
- import{j as a,k as n}from"./chunk-GS55K4WJ.js";import{a as m}from"./chunk-QYWGC7JV.js";import{q as i}from"./chunk-KYGNCIJ6.js";function p(e,s){let o=m(e,s);if(!o)return null;let t=n(e,o,{limit:50}),r=y(a(e,o,{limit:50,additive:!0,callableOnly:!0}));return{symbol:o.symbol,shortName:i(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file}))}}function y(e){let s=new Set,o=[];for(let t of e){let r=`${t.symbol}|${t.file}`;s.has(r)||(s.add(r),o.push(t))}return o}export{p as a};
2
- //# sourceMappingURL=chunk-E47WMJ5F.js.map
@@ -1,11 +0,0 @@
1
- import{a as d}from"./chunk-55ZJ2FCW.js";import{a as c}from"./chunk-SVUVC5VS.js";import{q as m}from"./chunk-G47V5V3U.js";import{q as u}from"./chunk-KYGNCIJ6.js";function I(e,n){let r=d(e,n);if(!r)return null;let t=p(e,r);if(!t||e.isIgnored(t.relative_path))return null;let s=[],i=0,l=h(e,t.relative_path),f=m(e,l);for(let o of l){let a=g(e,t,o,f.get(o.symbolId)??new Set);i+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:S(a)})}return{file:t.relative_path,symbols:s,totalExternalConsumers:i}}function p(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 h(e,n){return new c(e).definitionsForFile(n).sort((r,t)=>r.startLine-t.startLine||r.endLine-t.endLine)}function g(e,n,r,t){let s=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 != ?`,r.symbolId,n.id);return new Set([...s.map(i=>i.relative_path),...[...t].filter(i=>i!==n.relative_path)]).size}function S(e){return e>10?"high":e>0?"medium":"low"}export{I as a};
11
- //# sourceMappingURL=chunk-EEA3R37V.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-SVUVC5VS.js";import{g as y,j as g,q as m,u as p}from"./chunk-KYGNCIJ6.js";function C(n,t,s,o){let r=y(t);if(!r)return!0;let i=g(n,t);if(!i)return!0;let l=x.get(i);return l||(l=L(i,r),x.set(i,l)),l.get(`${s}:${o}`)??!0}var x=new WeakMap;function L(n,t){let s=t==="rust"?new Set(["function_item","function_signature_item"]):t==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),o=new Map,r=i=>{s.has(i.type)&&o.set(`${i.startPosition.row}:${i.endPosition.row}`,_(i,t));for(let l of i.children)r(l)};return r(n.rootNode),o}function _(n,t){let s=n.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!s)return!1;let o=s.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(o.length!==1)return!1;let r=o[0],i=null;if(r.type==="return_statement"||r.type==="expression_statement"?i=r.namedChild(0)??null:t==="rust"&&(r.type==="call_expression"||r.type==="macro_invocation")&&(i=r),!i)return!1;let l=t==="python"?"call":"call_expression";if(i.type!==l)return!1;let u=i.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!u)return!1;let d=u.namedChildren.filter(e=>e.type!=="comment"),c=n.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!c)return!1;let a=[];for(let e of c.namedChildren)if(e.type==="identifier")a.push(e.text);else{let f=e.namedChildren.find(S=>S.type==="identifier");f&&a.push(f.text)}if(d.length!==a.length)return!1;for(let e=0;e<a.length;e+=1){let f=d[e];if(f.type!=="identifier"||f.text!==a[e])return!1}return!0}function j(n,t){let{scope:s,maxLoc:o=15,limit:r=30,scanLimit:i}=t??{},l=new b(n),u=D(w(l,s,o).sort((a,e)=>h(a)-h(e)||a.relativePath.localeCompare(e.relativePath)),i),d=l.calleeMap(u),c=[];for(let a of u){let e=P(n,a,d.get(a.symbolId)??[]);e&&c.push(e)}return c.sort((a,e)=>a.loc-e.loc||a.file.localeCompare(e.file)),c.slice(0,r)}function P(n,t,s){let o=T(s);if(o.size!==1||!C(n,t.relativePath,t.startLine,t.endLine))return null;let[,r]=[...o.entries()][0];return{symbol:t.symbol,shortName:m(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:h(t),forwardsTo:r.symbol,forwardsToShort:m(r.symbol),forwardsToFile:r.file}}function T(n){let t=n.some(o=>p(o.symbol))?n.filter(o=>p(o.symbol)):n,s=new Map;for(let o of t)s.has(o.symbol)||s.set(o.symbol,o);return s}function w(n,t,s){return n.productionCallableDefinitions({scope:t,minLoc:3,maxLoc:s,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}function h(n){return n.endLine-n.startLine+1}function D(n,t){return typeof t!="number"||t<=0||n.length<=t?n:n.slice(0,t)}export{j as a};
2
- //# sourceMappingURL=chunk-FAN2CVZT.js.map
@@ -1,85 +0,0 @@
1
- import{a as H,b as $,d as J,f as N}from"./chunk-6FLGPRBR.js";import{p as B,q as j,r as z}from"./chunk-G47V5V3U.js";import{c as W}from"./chunk-QYWGC7JV.js";import{C as M,D as k,G as v,a as h,b as w,d as A,g as y,j as S,k as C,m as x,o as P,r as L,t as G}from"./chunk-KYGNCIJ6.js";var E=new WeakMap;function St(e,t){let n=y(t);return n==="rust"?Se(e,t):n==="typescript"||n==="tsx"||n==="javascript"?ye(e,t):[]}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function ye(e,t){let n=S(e,t);if(!n)return[];let s=E.get(n);if(s)return s;let o=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(t)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(t),i=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(t),r=!1,l=n.rootNode;for(let a of l.namedChildren){if(a.type!=="expression_statement")continue;let u=a.namedChild(0);if(!u||u.type!=="call_expression")continue;let d=u.namedChild(0);if(!d)continue;let f=d.type==="member_expression"?d.namedChild(d.namedChildCount-1)?.text:d.text;if(f&&be.has(f)){r=!0;break}}let c=[];r&&c.push({startLine:0,endLine:l.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(o||i)&&c.push({startLine:0,endLine:l.endPosition.row,reason:o?"Next.js / Remix route file":"Vite/Vue route component"});for(let a of l.namedChildren){let u=null,d=null;if(a.type==="function_declaration")u=a.namedChild(0)?.text??null,d=a;else if(a.type==="export_statement"){let f=a.namedChild(0);f?.type==="function_declaration"&&(u=f.namedChild(0)?.text??null,d=f)}else if(a.type==="lexical_declaration"){let f=a.namedChild(0);if(f?.type==="variable_declarator"){let p=f.namedChild(0)?.text,g=f.namedChild(1);p&&(g?.type==="arrow_function"||g?.type==="function_expression")&&(u=p,d=f)}}u&&/^use[A-Z]/.test(u)&&d&&c.push({startLine:d.startPosition.row,endLine:d.endPosition.row,reason:"React custom hook (use*)"})}return c.push(...V(n,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),E.set(n,c),c}var _e=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function he(e){return _e.test(e)}function V(e,t,n){let s=[],o=i=>{if(t.has(i.type)&&i.parent){let l=i.parent.children,c=-1;for(let a=0;a<l.length;a+=1)if(l[a].startIndex===i.startIndex&&l[a].type===i.type){c=a;break}if(c>0)for(let a=c-1;a>=0;a-=1){let u=l[a];if(n.has(u.type)){if(he(u.text)){s.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(u.type==="attribute_item"||u.type==="inner_attribute_item"))break}}for(let r of i.namedChildren)o(r)};return o(e.rootNode),s}function Se(e,t){let n=S(e,t);if(!n)return[];let s=E.get(n);if(s)return s;let o=[],i=Ee(n);return i?(E.set(n,i),i):(K(n.rootNode,o,!1,!1),o.push(...V(n,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"]))),o.push(...Ae(n.rootNode)),E.set(n,o),o)}function Ee(e){return xe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function K(e,t,n,s){let o=n,i=s;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")&&(i=!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"?Re(e,t,n,s):s&&we(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"?Ce(e,t,n):e.type==="mod_item"&&D(e).some(r=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(r))&&(o=!0);for(let r of e.namedChildren)K(r,t,o,i)}function Re(e,t,n,s){let o=D(e),i=null;s?i="trait impl method (dynamic dispatch)":n&&(i="inside #[cfg(test)] mod");for(let r of o){let l=Le(r);if(l){i=l;break}if(Z(r)){i="#[allow(dead_code)]";break}}i&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:i})}function Ce(e,t,n){let s=D(e),o=e.namedChildren.find(i=>i.type==="type_identifier")?.text;s.some(Ie)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:o}),s.some(Z)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:o}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:o})}function D(e){let t=e.parent;if(!t)return[];let n=t.children,s=-1;for(let i=0;i<n.length;i+=1)if(n[i].startIndex===e.startIndex&&n[i].type===e.type){s=i;break}if(s<=0)return[];let o=[];for(let i=s-1;i>=0;i-=1){let r=n[i];if(r.type==="attribute_item"||r.type==="inner_attribute_item")o.push(r.text);else{if(r.type==="line_comment"||r.type==="block_comment")continue;break}}return o}function Le(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 Ie(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 Z(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function we(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ae(e){let t=De(e);if(t.size===0)return[];let n=[];for(let s of e.descendantsOfType("mod_item")){let o=s.childForFieldName("name")?.text;o&&t.has(o)&&n.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:o})}return n}function xe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ne=[{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}],q=/^#!?\[\s*serde\s*\(/,Me=/^#!?\[\s*schemars\s*\(/,ke=/^#!?\[\s*validate\s*\(/,U=/\bwith\s*=\s*"([^"]+)"/g;function X(e,t){return x(e,t,ve,()=>new Set,(n,s,o)=>{if(s==="rust"){for(let i of n.rootNode.descendantsOfType("attribute_item"))Y(i.text,o);for(let i of n.rootNode.descendantsOfType("inner_attribute_item"))Y(i.text,o)}})??new Set}var ve=new WeakMap;function Y(e,t){let n=q.test(e),s=Me.test(e),o=ke.test(e);if(!(!n&&!s&&!o))for(let{re:i}of Ne){i.lastIndex=0;let r;for(;(r=i.exec(e))!==null;){let l=r[1],c=l.split("::").pop()??l;c==="is_none"&&/\bOption\b/.test(l)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(l)||c&&t.add(c)}}}function De(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!q.test(n.text))continue;U.lastIndex=0;let s;for(;(s=U.exec(n.text))!==null;){let o=s[1],i=o.split("::").pop()??o;i&&t.add(i)}}return t}var Oe=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Et(e,t){return x(e,t,Te,()=>new Set,(n,s,o)=>{if(!(s!=="typescript"&&s!=="tsx"&&s!=="javascript"))for(let i of n.rootNode.descendantsOfType("call_expression")){let r=i.namedChild(0);if(!r)continue;let l=P(r);if(!l||!Oe.has(l))continue;let c=i.namedChildren.find(d=>d.type==="arguments");if(!c)continue;let a=c.namedChild(0);if(!a||a.type!=="string")continue;let u=a.namedChildren.find(d=>d.type==="string_fragment");u&&o.add(u.text)}})??new Set}var Te=new WeakMap;var Fe=new Set(["identifier","type_identifier","field_identifier"]),Pe=new Set(["identifier"]),He=new Set(["identifier","property_identifier","type_identifier"]),$e=new Set(["rust","python"]),Je=/\{([^{}]*)\}/g,Ge=/\b([A-Za-z_][\w]*)\b/g;function ee(e,t,n,s={}){if(!n)return[];let o=A(e,t);if(!o)return[];if(o.indexOf(n)===-1)return[];if(y(t))return(O(e,t).get(n)??[]).filter(u=>!Q(u,s));let i=$(e,t,o),r=new RegExp(`\\b${J(n)}\\b`),l=[];for(let c=0;c<i.length;c++)Q(c,s)||r.test(i[c]??"")&&l.push(c);return l}function Q(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var te=h("file-identifiers");function At(e,t){return te.get(e,t,()=>new Set(O(e,t).keys()))}var ne=h("file-ident-lines");function O(e,t){return ne.get(e,t,()=>We(e,t))}var ie=h("file-idents-by-line");function se(e,t){return ie.get(e,t,()=>{let n=O(e,t),s=0;for(let i of n.values()){let r=i[i.length-1];r!==void 0&&r>s&&(s=r)}let o=new Array(s+1);for(let i=0;i<=s;i+=1)o[i]=new Set;for(let[i,r]of n)for(let l of r)o[l].add(i);return o})}function xt(e){te.invalidateAll(e),ne.invalidateAll(e),ie.invalidateAll(e)}function We(e,t){let n=new Map,s=(l,c)=>{let a=n.get(l);if(!a){n.set(l,[c]);return}a[a.length-1]!==c&&a.push(c)};if(y(t)){let l=S(e,t);if(l){let c=y(t),a=c==="rust"?Fe:c==="python"?Pe:He,u=d=>{if(a.has(d.type)&&s(d.text,d.startPosition.row),c&&$e.has(c)&&d.type==="string_content"){let f=d.startPosition.row;for(let p of d.text.matchAll(Je)){let g=p[1]??"";for(let m of g.matchAll(Ge))m[1]&&s(m[1],f)}}for(let f of d.children)u(f)};return u(l.rootNode),n}}let o=A(e,t);if(!o)return n;let i=H(o).split(/\r?\n/),r=/\b([A-Za-z_$][\w$]*)\b/g;for(let l=0;l<i.length;l+=1){let c=i[l]??"";for(let a of c.matchAll(r))a[1]&&s(a[1],l)}return n}var le=h("file-dep-graph");function $t(e){le.invalidateAll(e),ce.invalidate(e),me.invalidate(e)}function Jt(e,t){return le.get(e,t??"",()=>{let n=new Map,s=je(e),o=(i,r)=>ze(e,n,s,i,r);for(let i of Be(e,t))o(i.from_file,i.to_file);for(let i of s)if(!(t&&!i.includes(t)))for(let r of N(e,i))r.sourcePath&&o(i,r.sourcePath);return n})}function Be(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";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
- ${n}`)}function je(e){return new Set(e.all(`SELECT relative_path
20
- FROM documents
21
- WHERE 1 = 1
22
- ${e.pathExclusionsFor("documents")}
23
- ORDER BY relative_path`).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)))}function ze(e,t,n,s,o){if(s===o||e.isIgnored(s)||e.isIgnored(o)||!n.has(o))return;let i=t.get(s);i||(i=new Set,t.set(s,i)),i.add(o)}function Gt(e,t,n={}){let s=ue(e,[t],{additive:n.additive}),o=n.callableOnly?(s.get(t.symbolId)??[]).filter(i=>G(i.symbol)):s.get(t.symbolId)??[];return typeof n.limit=="number"?o.slice(0,n.limit):o}function Wt(e,t,n={}){let s=Ye(e)?Ke(e,t):Ve(e).get(t.symbolId)??[];return typeof n.limit=="number"?s.slice(0,n.limit):s}var ce=w("caller-rows"),Ue=2e4;function Ye(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Ue}function Ve(e){return ce.get(e,()=>{let t=k(e),n=ue(e,t),s=new Map;for(let r of t)s.set(r.symbol,r.symbolId);let o=new Map,i=new Map;for(let r of t){let l=n.get(r.symbolId);if(!(!l||l.length===0))for(let c of l){let a=s.get(c.symbol);if(a===void 0||a===r.symbolId)continue;let u=o.get(a);u||(u=[],o.set(a,u),i.set(a,new Set));let d=`${r.symbol}|${r.relativePath}`;i.get(a).has(d)||(i.get(a).add(d),u.push({symbol:r.symbol,file:r.relativePath}))}}return o})}function Ke(e,t){let n=[],s=new Set,o=r=>{if(r.symbol===t.symbol)return;let l=`${r.symbol}|${r.file}`;s.has(l)||(s.add(l),n.push(r))};for(let r of qe(e,t))r.file!==t.relativePath&&o({symbol:r.enclosingSymbol??r.file,file:r.file});let i=Ze(e,t);if(i)for(let r of B(e,i)){if(r.file===t.relativePath||e.isIgnored(r.file))continue;let l=v(M(e,r.file),r.line);o({symbol:l?.symbol??r.file,file:r.file})}return n}function Ze(e,t){return e.get(`SELECT
24
- d.id AS documentId,
25
- gs.id AS symbolId,
26
- gs.symbol,
27
- d.relative_path AS relativePath,
28
- COALESCE(der.start_line, c.start_line) AS startLine,
29
- COALESCE(der.end_line, c.end_line) AS endLine,
30
- COALESCE(gs.display_name, '') AS leaf,
31
- NULL AS parentTypeName,
32
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
33
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
34
- gs.kind AS kind,
35
- gs.documentation AS documentation,
36
- gs.enclosing_symbol AS enclosingSymbol
37
- FROM global_symbols gs
38
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
39
- LEFT JOIN chunks c ON c.document_id = der.document_id
40
- JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
41
- WHERE gs.id = ?
42
- LIMIT 1`,t.symbolId)??null}function qe(e,t){let n=nt(e,t);return n?it(e,Xe(e,n.match,n.identifier)):[]}function Xe(e,t,n){let s=new Map;for(let[o,i]of Qe(e,t.symbolId))s.set(o,et(e,o,i,t,n));return s}function Qe(e,t){let n=new Map,s=e.all(`SELECT DISTINCT d.relative_path, c.start_line, c.end_line
43
- FROM mentions m
44
- JOIN chunks c ON m.chunk_id = c.id
45
- JOIN documents d ON c.document_id = d.id
46
- WHERE m.symbol_id = ?
47
- AND m.role != 1
48
- ${e.pathExclusionsFor("d")}
49
- ORDER BY d.relative_path, c.start_line`,t);for(let o of s){if(e.isIgnored(o.relative_path))continue;let i=n.get(o.relative_path);i||(i=[],n.set(o.relative_path,i)),i.push({start_line:o.start_line,end_line:o.end_line})}return n}function et(e,t,n,s,o){let i=t===s.relativePath?{excludeStartLine:s.startLine,excludeEndLine:s.endLine}:{},r=o?ee(e,t,o,i):[];return n.flatMap(l=>tt(r,l))}function tt(e,t){let n=e.filter(s=>s>=t.start_line&&s<=t.end_line);return n.length>0?n:[t.start_line]}function nt(e,t){let n=W(e,t);return n?{match:n,identifier:L(n.symbol)||null}:null}function it(e,t){let n=[],s=new Set;for(let[o,i]of t){let r=M(e,o);for(let l of i){let c=v(r,l),a=`${o}|${l}|${c?.symbol??""}`;s.has(a)||(s.add(a),n.push({file:o,line:l,enclosingSymbol:c?.symbol??null}))}}return n}function ue(e,t,n={}){if(t.length===0)return new Map;let s=n.additive??!1,o=[],i=[];for(let u of t)y(u.relativePath)&&C(e,u.relativePath)!==null?o.push(u):i.push(u);let r=new Map,l=new Map,c=u=>{for(let[d,f]of u){let p=r.get(d);p||(p=[],r.set(d,p));let g=l.get(d);g||(g=new Set,l.set(d,g));for(let m of f){let b=`${m.symbol}|${m.chunkId}`;g.has(b)||(g.add(b),p.push(m))}}};o.length>0&&c(st(e,o)),c(yt(z(e,t)));let a=s?t:i;return a.length>0&&c(ct(e,a)),r}function st(e,t){let n=new Map,s=ot(t,n),o=pe(e);for(let[i,r]of s){let l=C(e,i);if(l)for(let c of l){let a=rt(r,c.line);if(!a)continue;let u=at(e,i,o,c.calleeLeaf,c.memberAccess);u&&u.symbol!==a.symbol&&n.get(a.symbolId).push({symbol:u.symbol,file:u.file,chunkId:c.line})}}return n}function ot(e,t){let n=new Map;for(let s of e){let o=n.get(s.relativePath);o?o.push(s):n.set(s.relativePath,[s]),t.set(s.symbolId,[])}for(let s of n.values())s.sort((o,i)=>o.endLine-o.startLine-(i.endLine-i.startLine));return n}function rt(e,t){return e.find(n=>t>=n.startLine&&t<=n.endLine)??null}function at(e,t,n,s,o){let i=de(t,n.get(s)??[]);return i.length===0?null:fe(e,t,i,o)}function de(e,t){let n=oe(e);return n?t.filter(s=>oe(s.file)===n):t}function fe(e,t,n,s){let o=n.find(i=>i.file===t);if(o)return o;if(s){let i=new Set(N(e,t).map(r=>r.sourcePath).filter(r=>!!r));for(let r of n)for(let l of i)if(lt(l,r.file))return r;return null}return n.length===1?n[0]:null}function lt(e,t){let n=s=>s.replace(/\\/g,"/").replace(/^\.\//,"");return n(e)===n(t)}function oe(e){let t=y(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var me=w("global-leaf-index");function pe(e){return me.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
50
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
51
- FROM global_symbols gs
52
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
53
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
54
- LEFT JOIN (
55
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
56
- FROM mentions m
57
- JOIN chunks c ON m.chunk_id = c.id
58
- JOIN documents d ON c.document_id = d.id
59
- WHERE m.role = 1
60
- GROUP BY m.symbol_id
61
- ) mention_doc ON mention_doc.symbol_id = gs.id
62
- WHERE 1 = 1
63
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let s of t){if(!s.relative_path||e.isIgnored(s.relative_path))continue;let o=L(s.symbol);if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.some(r=>r.symbolId===s.id)||i.push({symbol:s.symbol,symbolId:s.id,file:s.relative_path})}return n})}function ct(e,t){if(t.length===0)return new Map;let n=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
64
- FROM mentions m
65
- JOIN chunks c ON m.chunk_id = c.id
66
- WHERE m.role != 1`),s=new Map;for(let a of n)s.has(a.document_id)||s.set(a.document_id,[]),s.get(a.document_id).push(a);let o=new Map(e.all("SELECT id, relative_path FROM documents").map(a=>[a.id,a.relative_path])),i=new Map,r=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
67
- COALESCE(der.document_id, def_chunk.document_id) AS document_id
68
- FROM global_symbols gs
69
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
70
- LEFT JOIN (
71
- SELECT m.symbol_id, MIN(c.document_id) AS document_id
72
- FROM mentions m
73
- JOIN chunks c ON m.chunk_id = c.id
74
- WHERE m.role = 1
75
- GROUP BY m.symbol_id
76
- ) def_chunk ON def_chunk.symbol_id = gs.id`);for(let a of r)i.has(a.symbol_id)||i.set(a.symbol_id,{symbol:a.symbol,file:a.document_id!==null?o.get(a.document_id)??"":""});let l=new Map,c=o;for(let a of t){let u=s.get(a.documentId)??[],d=new Set,f=[],p=null,g=()=>{if(p)return p;let m=c.get(a.documentId)??"",b=new Set;if(m){let I=se(e,m),R=Math.max(0,a.startLine),F=Math.min(I.length-1,a.endLine);for(let _=R;_<=F;_+=1)for(let ge of I[_])b.add(ge)}return p=b,b};for(let m of u){if(m.symbol_id===a.symbolId)continue;let b=i.get(m.symbol_id);if(!b)continue;if(!(m.start_line>=a.startLine&&m.end_line<=a.endLine)){if(!(m.start_line<=a.endLine&&m.end_line>=a.startLine))continue;let _=L(b.symbol);if(!_||!g().has(_))continue}let R=`${b.symbol}|${m.chunk_id}`;d.has(R)||(d.add(R),f.push({...b,chunkId:m.chunk_id}))}l.set(a.symbolId,f)}return l}function Bt(e,t){let n=new Map;if(t&&t.length===0)return n;let s=e.all(`SELECT relative_path FROM documents
77
- WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`),o=pe(e),i=t??k(e),r=new Set(i.map(l=>l.symbolId));return ut(e,n,s,o,r),dt(e,n,i,r),gt(e,n,s,o,r),_t(n,j(e,bt(i))),n}function ut(e,t,n,s,o){for(let i of n){if(!y(i.relative_path)||e.isIgnored(i.relative_path))continue;let r=C(e,i.relative_path);if(r)for(let l of r){let c=de(i.relative_path,s.get(l.calleeLeaf)??[]);if(!c||c.length===0)continue;let a=fe(e,i.relative_path,c,l.memberAccess);a&&o.has(a.symbolId)&&a.file!==i.relative_path&&T(t,a.symbolId,i.relative_path)}}}function dt(e,t,n,s){let o=mt(n);for(let i of ft(e,s))e.isIgnored(i.relative_path)||pt(i,o.get(i.symbol_id))||T(t,i.symbol_id,i.relative_path)}function ft(e,t){if(!t)return ae(e);let n=[...t];if(n.length===0)return[];let s=[];for(let o=0;o<n.length;o+=re)s.push(...ae(e,n.slice(o,o+re)));return s}var re=750;function ae(e,t){let n=t&&t.length>0?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
78
- c.start_line AS chunk_start, c.end_line AS chunk_end
79
- FROM mentions m
80
- JOIN chunks c ON m.chunk_id = c.id
81
- JOIN documents d ON c.document_id = d.id
82
- WHERE m.role != 1
83
- ${n}
84
- ${e.pathExclusionsFor("d")}`,...t??[])}function mt(e){let t=new Map;for(let n of e)t.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return t}function pt(e,t){return!!t&&t.docId===e.document_id&&e.chunk_start>=t.startLine&&e.chunk_end<=t.endLine}function gt(e,t,n,s,o){for(let i of n){if(e.isIgnored(i.relative_path)||y(i.relative_path)!=="rust")continue;let r=X(e,i.relative_path);if(r.size!==0)for(let l of r){let c=s.get(l);if(c)for(let a of c)o.has(a.symbolId)&&a.file!==i.relative_path&&T(t,a.symbolId,i.relative_path)}}}function T(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function bt(e){return e.filter(t=>"relativePath"in t&&"symbol"in t&&"leaf"in t)}function yt(e){let t=new Map;for(let[n,s]of e){let o=[];for(let i of s)o.push({symbol:i.symbol,file:i.file,chunkId:-1});t.set(n,o)}return t}function _t(e,t){for(let[n,s]of t){let o=e.get(n);o||(o=new Set,e.set(n,o));for(let i of s)o.add(i)}}export{St as a,X as b,Et as c,ee as d,At as e,O as f,xt as g,$t as h,Jt as i,Gt as j,Wt as k,qe as l,ue as m,pe as n,Bt as o};
85
- //# sourceMappingURL=chunk-GS55K4WJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as g}from"./chunk-SVUVC5VS.js";import{c as h}from"./chunk-7EQ4J66C.js";import{j as u,l as p}from"./chunk-GS55K4WJ.js";import{a as d,b as y}from"./chunk-QYWGC7JV.js";import{G as S,q as f}from"./chunk-KYGNCIJ6.js";function j(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,t=d(e,o);return t?c==="backward"?w(e,t,s):R(e,t):null}function w(e,o,r){let c=[],s=new Set([o.symbol]),t=[o];for(let a=1;a<=r&&t.length!==0;a++){let n=[];for(let l of t){let i=u(e,l);for(let m of i){if(s.has(m.symbol))continue;s.add(m.symbol),c.push({symbol:m.symbol,shortName:f(m.symbol),file:m.file,relationship:a===1?"referenced within definition (callee)":`depth ${a} callee`});let b=y(e,m.symbol);b&&!e.isIgnored(b.relativePath)&&n.push(b)}}t=n}return{symbol:o.symbol,shortName:f(o.symbol),direction:"backward",connectedSymbols:c}}function R(e,o){let r=h(e,o),c=r.length>0?r:p(e,o),s=new Set,t=[],a=new g(e);for(let n of c){if(t.length>=30)break;if(e.isIgnored(n.file))continue;let l=n.enclosingSymbol??S(a.definitionsForFile(n.file),n.line)?.symbol??null;if(!l||l===o.symbol)continue;let i=y(e,l);!i||e.isIgnored(i.relativePath)||s.has(i.symbol)||(s.add(i.symbol),t.push({symbol:i.symbol,shortName:f(i.symbol),file:i.relativePath,relationship:`references target at ${n.file}:${n.line+1}`}))}return t.sort((n,l)=>n.file.localeCompare(l.file)),{symbol:o.symbol,shortName:f(o.symbol),direction:"forward",connectedSymbols:t}}export{j as a};
2
- //# sourceMappingURL=chunk-HADDFTMU.js.map
@@ -1,2 +0,0 @@
1
- import{a as v}from"./chunk-SVUVC5VS.js";import{b as I}from"./chunk-GS55K4WJ.js";import{g as y,q as h,r as L}from"./chunk-KYGNCIJ6.js";function j(o,l={}){let{scope:c,minLoc:d=3}=l,a=new v(o),t=a.productionCallableDefinitions({scope:c,minLoc:d,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0}),m=a.crossFileCallerMap(t),n=new Set(m.keys()),r=new Map;for(let e of t){let s=L(e.symbol);if(!s)continue;let i=r.get(s)??[];i.push(e.symbolId),r.set(s,i)}let S=o.all(`SELECT relative_path FROM documents WHERE 1 = 1 ${o.pathExclusionsFor("documents")}`);for(let e of S){if(o.isIgnored(e.relative_path)||y(e.relative_path)!=="rust")continue;let s=I(o,e.relative_path);for(let i of s){let f=r.get(i);if(f)for(let x of f)n.add(x)}}let p=C(a,t,{additive:!1}),u=t.filter(e=>!n.has(e.symbolId)).filter(e=>!p.has(e.symbolId)),g=a.sourceFallbackCallerFiles(u);for(let e of g.keys())n.add(e);let b=u.filter(e=>!n.has(e.symbolId)),M=C(a,b,{additive:!0});for(let e of M)p.add(e);return b.filter(e=>!p.has(e.symbolId)).sort((e,s)=>s.endLine-s.startLine-(e.endLine-e.startLine)||e.relativePath.localeCompare(s.relativePath)||e.startLine-s.startLine).map(e=>({symbol:e.symbol,shortName:h(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1}))}function C(o,l,c){if(l.length===0)return new Set;let d=new Map(l.map(t=>[t.symbolId,t.symbol])),a=o.calleeMap(l,{additive:c.additive});return new Set([...a.entries()].filter(([t,m])=>{let n=d.get(t);return m.some(r=>r.symbol!==n)}).map(([t])=>t))}export{j as a};
2
- //# sourceMappingURL=chunk-IARIBTCL.js.map
@@ -1,19 +0,0 @@
1
- import{a as u,b as g,c as S}from"./chunk-LJ2YWNQF.js";import{a as p}from"./chunk-SVUVC5VS.js";import{a as y}from"./chunk-TYRPQE6R.js";import{f as d}from"./chunk-6FLGPRBR.js";import{o as m}from"./chunk-G47V5V3U.js";import l from"path";function q(t,n){let{scope:r,minDeviation:i=5}=n??{},s=new p(t).fileDependencyGraph(r),c=M(t,r);return R([...D(t,s,c),...v(s),...b(s,i)])}function D(t,n,r){let i=[];for(let[e,s]of n){if(a(e))continue;let c=r.get(e)??new Set;for(let o of s)if(!a(o)&&!c.has(o)){if(F(t,e,o)||w(t,e,o)||L(t,e,o)||$(o)||x(t,e,o)||P(o))continue;i.push({file:e,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}return i}function v(t){let n=[],r=N(t);for(let[i,e]of t){if(a(i))continue;let s=u(i);for(let c of e){if(a(c))continue;let o=u(c);if(s===o)continue;(g(s,o)??r.get(`${s}->${o}`))==="violation"&&n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${o}/`})}}return n}function b(t,n){let r=[];for(let[i,e]of _(t)){let s=e.filter(o=>!a(o));if(s.length<n)continue;let c=k(t,s);for(let o of s)for(let f of t.get(o)??[])a(f)||(c.get(f)??0)===1&&l.dirname(f)!==i&&l.dirname(f)!==l.dirname(i)&&(S(o,f)||r.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${f}`,dep:f}))}return r}function R(t){return{results:t,unusedImports:t.filter(n=>n.kind==="unused-import").length,layerViolations:t.filter(n=>n.kind==="layer-violation").length,patternDeviations:t.filter(n=>n.kind==="pattern-deviation").length}}function _(t){let n=new Map;for(let r of t.keys()){let i=l.dirname(r),e=n.get(i);e||(e=[],n.set(i,e)),e.push(r)}return n}function k(t,n){let r=new Map;for(let i of n)for(let e of t.get(i)??[])a(e)||r.set(e,(r.get(e)??0)+1);return r}function M(t,n){let r=new Map;return E(t,r,n),O(t,r),r}function E(t,n,r){for(let i of I(t,r))h(t,n,i.from_file,i.to_file)}function I(t,n){let r=n?`AND d1.relative_path LIKE '%${n}%'`:"";return t.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d1 ON c.document_id = d1.id
5
- JOIN global_symbols gs ON m.symbol_id = gs.id
6
- JOIN (
7
- SELECT m2.symbol_id, c2.document_id
8
- FROM mentions m2
9
- JOIN chunks c2 ON m2.chunk_id = c2.id
10
- WHERE m2.role = 1
11
- GROUP BY m2.symbol_id
12
- ) sym_def ON sym_def.symbol_id = gs.id
13
- JOIN documents d2 ON sym_def.document_id = d2.id
14
- WHERE d1.id != d2.id
15
- AND m.role != 1
16
- ${t.pathExclusionsFor("d1","d2")}
17
- ${r}`)}function O(t,n){let r=new p(t),i=t.all(`SELECT relative_path FROM documents
18
- WHERE 1 = 1 ${t.pathExclusionsFor("documents")}`);r.scanSourceReferences({paths:i.map(e=>e.relative_path),includeRustAttributeNames:!0,identifierResolution:"permissive"},e=>{e.target.relativePath!==e.sourceFile&&(t.isIgnored(e.target.relativePath)||h(t,n,e.sourceFile,e.target.relativePath))})}function h(t,n,r,i){if(t.isIgnored(r)||t.isIgnored(i))return;let e=n.get(r);e||(e=new Set,n.set(r,e)),e.add(i)}function N(t){let n=new Map;for(let[i,e]of t){if(a(i))continue;let s=u(i);for(let c of e){if(a(c))continue;let o=u(c);if(s===o||g(s,o))continue;let f=`${s}->${o}`;n.set(f,(n.get(f)??0)+1)}}let r=new Map;for(let[i,e]of n)r.set(i,e<=2?"violation":"ok");return r}function $(t){return t.includes("types")||t.endsWith(".d.ts")}function F(t,n,r){let i=m(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.some(e=>e.isUsed)}function w(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.some(e=>e.used)}function L(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.every(e=>e.isTypeOnly===!0)}function P(t){return t.endsWith(".vue")}function x(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length===0?!1:i.every(e=>e.kind==="side-effect"||e.kind==="namespace"&&e.usedMembers.length===0&&!e.used)}function a(t){let n=y(t);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||T(l.basename(t)))}function T(t){return!!(t==="index.ts"||t==="index.js"||t==="cli.ts"||t==="main.ts"||t==="main.rs"||t.includes("worker.")||t.includes("postinstall.")||t==="health.ts"||t==="health.js")}export{q as a};
19
- //# sourceMappingURL=chunk-K6ULLR7M.js.map
@@ -1,2 +0,0 @@
1
- import{a as c}from"./chunk-SVUVC5VS.js";import{j as a,k as i}from"./chunk-GS55K4WJ.js";import{q as m}from"./chunk-KYGNCIJ6.js";function d(o,e={}){let{limit:r=20,scope:s,minFanIn:t=2,minFanOut:p=2}=e;return new c(o).productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0}).map(n=>u(o,n)).filter(n=>n.fanIn>=t&&n.fanOut>=p).sort((n,l)=>l.score-n.score||l.fanIn-n.fanIn).slice(0,r)}function u(o,e){let r=new Set(i(o,e,{limit:500}).map(t=>t.file)).size,s=new Set(a(o,e,{limit:500}).filter(t=>t.file!==e.relativePath).map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:m(e.symbol),fanIn:r,fanOut:s,score:r*s,definedIn:e.relativePath}}export{d as a};
2
- //# sourceMappingURL=chunk-KCC3GMCX.js.map
@@ -1,5 +0,0 @@
1
- import{a as P}from"./chunk-SVUVC5VS.js";import{e as D}from"./chunk-6FLGPRBR.js";import{a as S,d as g,g as C,j as x,l as I,p as L,q as v,r as m}from"./chunk-KYGNCIJ6.js";function fe(n,e){let{scope:t,minLoc:r=3,maxLoc:s=80,limit:i=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},a=new P(n),f=a.scopedDefinitions(t),u=W(a,t),d=X(_(n,a,f,{minLoc:r,maxLoc:s}).sort((c,p)=>b(p)-b(c)||c.relativePath.localeCompare(p.relativePath)),o),y=B(a,d),A=O(n,a,f,d),$=N(d);return E(n,d,y,$).filter(c=>!A.has(c.definition.symbolId)).filter(c=>!c.transitivelyReachable).filter(c=>c.realConsumers.length<=1).filter(c=>!(c.realConsumers.length===0&&c.barrelConsumers>0)).filter(c=>Z(c.definition,c.realConsumers.length,u)).map(c=>j(n,c)).filter(c=>l||c.confidence!=="low").sort((c,p)=>{let h={high:0,medium:1,low:2};return h[c.confidence]-h[p.confidence]||p.loc-c.loc||c.file.localeCompare(p.file)||c.startLine-p.startLine}).slice(0,i)}function _(n,e,t,r){return t.filter(s=>s.isTypeLike&&b(s)>=r.minLoc).filter(s=>b(s)<=r.maxLoc).filter(s=>!n.isIgnored(s.relativePath)).filter(s=>!G(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function B(n,e){return R(n.crossFileCallerMap(e),n.sourceFallbackCallerFiles(e))}function N(n){let e=new Map;for(let t of n){let r=e.get(t.relativePath);r||(r=new Map,e.set(t.relativePath,r));let s=m(t.symbol);s&&r.set(s,t)}return e}function E(n,e,t,r){return e.map(s=>{let l=[...t.get(s.symbolId)??new Set].filter(u=>u!==s.relativePath&&!n.isIgnored(u)),{realConsumers:o,barrelConsumers:a}=q(n,s.relativePath,s.symbol,l),f=J(n,s,t,r);return{definition:s,realConsumers:o,barrelConsumers:a,transitivelyReachable:f}})}function j(n,e){let t=k(n,e.definition.relativePath,e.definition.startLine),r=M(e.definition.relativePath)?!0:ee(n,e.definition),{confidence:s,reason:i}=ne(e.realConsumers.length,t,r);return{symbol:e.definition.symbol,shortName:v(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:t,definerUsesType:r,confidence:s,reason:i}}function O(n,e,t,r){let s=z(n,U(t),r),i=s.map(a=>a.singleton);if(s.length===0)return new Set;let l=R(e.crossFileCallerMap(i),e.sourceFallbackCallerFiles(i)),o=new Set;for(let{singleton:a,classId:f}of s)K(n,a,l)&&o.add(f);return o}function U(n){let e=new Map;for(let t of n){let r=m(t.symbol);r&&e.set(w(t.relativePath,r),t)}return e}function z(n,e,t){let r=[];for(let s of t){let i=H(n,e,s);i&&r.push({singleton:i,classId:s.symbolId})}return r}function H(n,e,t){if(k(n,t.relativePath,t.startLine)!=="class")return null;let r=m(t.symbol);if(!r)return null;let s=V(n,t.relativePath,r);return s?e.get(w(t.relativePath,s))??null:null}function K(n,e,t){let r=m(e.symbol),s=t.get(e.symbolId);return!r||!s?!1:[...s].some(i=>i!==e.relativePath&&!n.isIgnored(i)&&!T(n,i,r))}function w(n,e){return`${n}\0${e}`}function V(n,e,t){let r=g(n,e);if(!r)return null;let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return r.match(i)?.[1]??null}function W(n,e){return new Set(n.scopedDefinitions(e).filter(t=>t.isFunctionLike).map(t=>t.relativePath))}function G(n){let e=L(n);if("kind"in e)return!1;let t=e.descriptors;if(t.length<2)return!1;let r=t[t.length-1],s=t[t.length-2];return r?.suffix==="type"&&s?.suffix==="type"}function M(n){let t=(n.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(t==="types"||t==="models"||t==="schema"||t==="common"||t==="protocol"||t==="proto"||t==="dto"||t==="mod"||/(^|\/)types(\/|\.)/.test(n)||/(^|\/)models?(\/|\.)/.test(n)||/(^|\/)proto(?:col)?(\/|\.)/.test(n)||/(^|\/)schema(\/|\.)/.test(n))}function Z(n,e,t){return!(M(n.relativePath)&&e>0||e===0&&t.has(n.relativePath))}function q(n,e,t,r){let s=[],i=0,l=m(t);for(let o of r)Y(n,o,e,l)||T(n,o,l)?i++:s.push(o);return{realConsumers:s,barrelConsumers:i}}function J(n,e,t,r){let s=I(n,e.relativePath),i=m(e.symbol);if(!i)return!1;let l=s.get(i);if(!l||l.size===0)return!1;let o=r.get(e.relativePath);if(!o)return!1;for(let a of l){let f=o.get(a);if(!f)continue;let u=t.get(f.symbolId);if(u){for(let d of u)if(d!==e.relativePath&&!n.isIgnored(d))return!0}}return!1}var F=S("stale-abs-file-usage");function T(n,e,t){if(!t)return!1;let r=C(e);if(!r)return!1;let s=F.get(n,e,()=>Q(n,e,r));return s.importedLeaves.has(t)&&!s.usedLeaves.has(t)}function Q(n,e,t){let r=new Set,s=new Set,i=x(n,e);if(!i)return{importedLeaves:r,usedLeaves:s};let l=t==="rust"?new Set(["use_declaration"]):t==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(a,f)=>{let u=f||l.has(a.type);(a.type==="identifier"||a.type==="type_identifier"||a.type==="property_identifier"||a.type==="field_identifier")&&(u?r.add(a.text):s.add(a.text));for(let d of a.children)o(d,u)};return o(i.rootNode,!1),{importedLeaves:r,usedLeaves:s}}function X(n,e){return typeof e!="number"||e<=0||n.length<=e?n:n.slice(0,e)}function ue(n){F.invalidateAll(n)}function Y(n,e,t,r){if(!r)return!1;let s=g(n,e);if(!s)return!1;let i=D(n,e);if(i.length===0)return!1;let l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`\\b${l}\\b`),a=s.split(`
2
- `),f=0;for(let u=0;u<a.length;u++){if(!o.test(a[u]??""))continue;if(f++,!i.find(y=>y.startLine<=u&&u<=y.endLine))return!1}return f>0}function k(n,e,t){let r=g(n,e);if(!r)return"other";let s=r.split(`
3
- `),i=Math.max(0,t-2),l=Math.min(s.length-1,t+2);for(let o=i;o<=l;o++){let f=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(f))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(f))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(f))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(f))return"enum"}return"other"}function ee(n,e){let t=g(n,e.relativePath);if(!t)return!1;let r=m(e.symbol);if(!r)return!1;let s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\b${s}\\b`),l=t.split(`
4
- `);for(let o=0;o<l.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&i.test(l[o]??""))return!0;return!1}function ne(n,e,t){return n===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:n===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:n===1&&!t?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}function b(n){return n.endLine-n.startLine+1}function R(...n){let e=new Map;for(let t of n)for(let[r,s]of t){let i=e.get(r);i||(i=new Set,e.set(r,i));for(let l of s)i.add(l)}return e}export{fe as a,ue as b};
5
- //# sourceMappingURL=chunk-KRVRD6KZ.js.map
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-SVUVC5VS.js";import{a as l}from"./chunk-QYWGC7JV.js";import{r,t as a}from"./chunk-KYGNCIJ6.js";import{basename as d}from"path";function g(t,c){let o=l(t,c);if(!o)return[];let s=r(o.symbol),i=new m(t).definitionsForFile(o.relativePath).filter(e=>a(e.symbol)),n=i.filter(e=>e.parentTypeName===s||e.symbol.includes(s));return(n.length>0?n:p(d(o.relativePath))===s?i.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:r(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{g as a};
2
- //# sourceMappingURL=chunk-LHLXHH43.js.map
@@ -1,7 +0,0 @@
1
- import{c as m}from"./chunk-7EQ4J66C.js";import{l as g}from"./chunk-GS55K4WJ.js";import{a as R}from"./chunk-QYWGC7JV.js";import{d as u,u as h}from"./chunk-KYGNCIJ6.js";function $(t,a){let e=R(t,a);if(!e)return[];let i=!h(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],r=m(t,e),l=(r.length>0?r:g(t,e)).filter(n=>!t.isIgnored(n.file)).map(n=>({relativePath:n.file,line:n.line})),c=S(t,e),s=new Set,f=[];for(let n of[...i,...l,...c]){let p=`${n.relativePath}:${n.line}`;s.has(p)||(s.add(p),f.push(n))}return f}function S(t,a){if(!a.relativePath.endsWith(".rb"))return[];let e=d(a.symbol);if(e.length===0)return[];let o=t.all(`SELECT relative_path
2
- FROM documents
3
- WHERE relative_path LIKE '%.rb'
4
- ${t.pathExclusionsFor("documents")}
5
- ORDER BY relative_path`),i=[];for(let r of o){if(t.isIgnored(r.relative_path))continue;let l=u(t,r.relative_path);if(!l)continue;let c=l.split(`
6
- `);for(let s=0;s<c.length;s++){let f=c[s]??"";e.some(n=>new RegExp(`@${n}\\b|\\b${n}:`).test(f))&&i.push({relativePath:r.relative_path,line:s})}}return i}function d(t){let e=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),o=e.split("_").filter(Boolean),i=new Set;return e&&i.add(e),o.length>=1&&i.add(o[o.length-1]),o.length>=2&&i.add(o.slice(-2).join("_")),[...i]}export{$ as a};
7
- //# sourceMappingURL=chunk-M7GBLQG4.js.map
@@ -1,2 +0,0 @@
1
- import{s as S}from"./chunk-G47V5V3U.js";import{A as h,B as b,D as x,d as g,q as d}from"./chunk-KYGNCIJ6.js";function B(t,e={}){let{scope:s,minLoc:o=1,limit:i}=e,c=new Map;for(let r of x(t,{scope:s})){if(!r.isFunctionLike||t.isIgnored(r.relativePath))continue;let n=r.endLine-r.startLine+1;if(n<o)continue;let m=L(t,r);if(!m)continue;let u={symbol:r.symbol,shortName:d(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:n},l=c.get(m);l?l.push(u):c.set(m,[u])}let a=[];for(let[r,n]of c)n.length<2||a.push({signature:r,functions:n});return a.sort((r,n)=>{let m=n.functions.length-r.functions.length;if(m!==0)return m;let u=r.functions.reduce((f,p)=>f+p.loc,0);return n.functions.reduce((f,p)=>f+p.loc,0)-u}),i?a.slice(0,i):a}function L(t,e){let s=S(t,e);if(s)return s;let o=$(e.documentation),i=o?v(o):null;return i||w(D(t,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function $(t){return h(b(t))}function D(t,e,s,o,i){let c=g(t,e);if(!c)return null;let a=c.split(/\r?\n/),r=I(a,s,o,i);for(let n of r){let m=Math.min(a.length-1,Math.max(n,n+4)),u="";for(let l=n;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,M(u)))return u}if(u&&u.includes("("))return u}return null}function M(t){let e=t.replace(/\s+/g," ").trim();return!e.includes("(")||P(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function v(t){if(!t||!t.trim())return null;let e=t.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 w(t,e){if(!t||!t.trim())return null;let s=t.replace(/\s+/g," ").trim(),o=s.indexOf("(");if(o===-1)return null;let i=s.slice(0,o),a=new RegExp(`\\b${y(e)}\\b`,"i").exec(i);a&&typeof a.index=="number"&&(i=i.slice(0,a.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 r=z(s.slice(o)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!r.startsWith("("))return null;let n=`${i?`${i} `:""}${r}`.replace(/\s+/g,"").toLowerCase();return n.length>=3?n:null}function z(t){let e=0,s=0,o=0,i=0,c=null,a=!1;for(let r=0;r<t.length;r+=1){let n=t[r];if(c){if(a){a=!1;continue}if(n==="\\"){a=!0;continue}n===c&&(c=null);continue}if(n==='"'||n==="'"||n==="`"){c=n;continue}if(n==="(")e+=1;else if(n===")")e=Math.max(0,e-1);else if(n==="[")o+=1;else if(n==="]")o=Math.max(0,o-1);else if(n==="<")i+=1;else if(n===">")i=Math.max(0,i-1);else if(n==="{"){if(e===0&&o===0&&i===0)return t.slice(0,r);s+=1}else if(n==="}")s=Math.max(0,s-1);else if(n==="="&&t[r+1]===">"&&e===0&&s===0&&o===0&&i===0)return t.slice(0,r)}return t}function I(t,e,s,o){let i=y(o),c=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${i}\\b`,"i"),r=[],n=new Set,m=Math.max(0,Math.min(e,t.length-1)),u=Math.max(m,Math.min(t.length-1,Math.max(s,e+4)));for(let l=m;l<=u;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}for(let l=0;l<t.length;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}return r}function P(t){let e=0;for(let s of t)s==="("&&(e+=1),s===")"&&(e-=1);return e}function y(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{B as a};
2
- //# sourceMappingURL=chunk-MEVK6R7N.js.map
@@ -1,2 +0,0 @@
1
- import{c as S}from"./chunk-7EQ4J66C.js";import{j as c,k as y,l as g}from"./chunk-GS55K4WJ.js";import{a}from"./chunk-QYWGC7JV.js";import{q as r}from"./chunk-KYGNCIJ6.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=S(l,o),s=(t.length>0?t:g(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
- //# sourceMappingURL=chunk-RUAJV3TN.js.map
@@ -1,7 +0,0 @@
1
- import{a as m}from"./chunk-SVUVC5VS.js";import{a as l}from"./chunk-QYWGC7JV.js";import{q as a}from"./chunk-KYGNCIJ6.js";import{readFileSync as f}from"fs";import{join as u}from"path";function I(e,n){let t=l(e,n);if(!t)return null;let i=new m(e),c=S(h(e,t.relativePath,t.startLine,t.endLine),p(e,t.relativePath)),o=t.endLine-t.startLine+1,r=i.calleeMap([t],{additive:!0}).get(t.symbolId)??[],b=new Set(r.map(g=>g.symbol));return{symbol:t.symbol,shortName:a(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:o,branches:c,cyclomaticEstimate:c+1,calleeCount:b.size,fanIn:y(e,t.symbolId),fanOut:d(r,t.relativePath)}}function p(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function h(e,n,t,i){try{return f(u(e.config.projectRoot,n),"utf-8").split(`
2
- `).slice(t,i+1).join(`
3
- `)}catch{return""}}function y(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
- FROM mentions m
5
- JOIN chunks c ON m.chunk_id = c.id
6
- WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function d(e,n){return new Set(e.filter(t=>t.file!==n).map(t=>t.symbol)).size}function S(e,n){let t=P(e),i=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of c){let s=t.match(o);s&&(i+=s.length)}if(n==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}return i}function P(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"").replace(/#.*/g,"").replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/`(?:[^`\\]|\\.)*`/g,"``")}export{I as a};
7
- //# sourceMappingURL=chunk-S57GUI2T.js.map
@@ -1,2 +0,0 @@
1
- import{a as b,e as A}from"./chunk-TYRPQE6R.js";import{a as m,b as O,d as E}from"./chunk-7EQ4J66C.js";import{c as q}from"./chunk-WPY46NIL.js";import{b as F,c as L,f as D,i as M,m as v,o as N}from"./chunk-GS55K4WJ.js";import{C as P,E as T,f as p,g,h,n as R,t as C,u as I,w as x,x as k}from"./chunk-KYGNCIJ6.js";function V(i,e,o){let c=e.identifierResolution==="strict"?m:O;for(let t of e.paths){let l=g(t);if(!l&&!(e.includeVueSfc&&h(t))||i.isIgnored(t)||e.skipPath?.(t))continue;let u=D(i,t);for(let[n,s]of u)for(let f of c(i,t,n))o({sourceFile:t,name:n,target:f,occurrences:s.length,kind:"identifier"});if(e.includeCrossLanguageDispatchNames)for(let n of L(i,t))for(let s of m(i,t,n))o({sourceFile:t,name:n,target:s,occurrences:1,kind:"cross-language-dispatch"});if(e.includeRustAttributeNames&&l==="rust")for(let n of F(i,t))for(let s of c(i,t,n))o({sourceFile:t,name:n,target:s,occurrences:1,kind:"rust-attribute"})}}var G=class{constructor(e){this.db=e}db;scopedDefinitions(e){return T(this.db,e)}definitionsForFile(e){return P(this.db,e)}productionCallableDefinitions(e={}){let{scope:o,minLoc:c=1,maxLoc:t=Number.POSITIVE_INFINITY,excludeSymbol:l,excludeEntrySurfaces:u=!1,excludeTypesFiles:n=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:f=!1,excludeRustTraitImplMembers:K=!1,includeSuppressed:j=!1,sortByLocDesc:B=!1}=e,d=[];for(let r of this.scopedDefinitions(o)){let a=r.relativePath;if(this.db.isIgnored(a)||u&&A(this.db,a)||!H(r,{requireFunctionLikeSymbol:s,requireCallableSymbol:f})||l!==void 0&&r.symbol===l)continue;let S=y(r);S<c||S>t||n&&Y(a)||K&&x(r.symbol)||b(a)!=="test"&&(k(r.symbol)||!j&&p(this.db,a,r.startLine)||d.push(r))}return B?d.sort((r,a)=>y(a)-y(r)):d}calleeMap(e,o={}){return v(this.db,e,o)}crossFileCallerMap(e){return N(this.db,e)}sourceFallbackCallerFiles(e){return E(this.db,e)}fileDependencyGraph(e){return M(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return p(this.db,e.relativePath,e.startLine)}sourceFiles(){return q(this.db)}scanSourceReferences(e,o){V(this.db,e,o)}callableSignature(e){return R(this.db,e.relativePath,e.startLine,e.endLine)}};function y(i){return i.endLine-i.startLine+1}function H(i,e){return e.requireCallableSymbol?C(i.symbol):e.requireFunctionLikeSymbol?I(i.symbol):i.isFunctionLike}function Y(i){return(i.split("/").pop()??"").includes("types")}export{G as a};
2
- //# sourceMappingURL=chunk-SVUVC5VS.js.map