scip-query 0.6.7 → 0.7.0

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 (219) hide show
  1. package/README.md +3 -1
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-23YIGCYF.js +25 -0
  4. package/dist/{chunk-KQWFRAQI.js → chunk-2IYEIFPP.js} +6 -6
  5. package/dist/chunk-2JEFS2YJ.js +2 -0
  6. package/dist/chunk-33SSUPCB.js +7 -0
  7. package/dist/chunk-3GNFUVFA.js +2 -0
  8. package/dist/{chunk-ZNNCDAYX.js → chunk-3OUC276S.js} +2 -2
  9. package/dist/{chunk-PQTGBYXV.js → chunk-4STLJYHI.js} +4 -4
  10. package/dist/chunk-563HLCDW.js +35 -0
  11. package/dist/chunk-5TT47UMX.js +44 -0
  12. package/dist/chunk-6H2XIIPY.js +71 -0
  13. package/dist/{chunk-HTJ5BOYP.js → chunk-72JOIFXL.js} +3 -3
  14. package/dist/chunk-7H4RJ4MC.js +2 -0
  15. package/dist/chunk-7O4MJYIW.js +63 -0
  16. package/dist/chunk-7OX2O53H.js +62 -0
  17. package/dist/chunk-A2AVLALL.js +2 -0
  18. package/dist/chunk-AQYBOORI.js +2 -0
  19. package/dist/chunk-ARBZM2NF.js +34 -0
  20. package/dist/{chunk-2CC7RA6B.js → chunk-BI4F6GXI.js} +2 -2
  21. package/dist/chunk-BOVNTAKQ.js +3 -0
  22. package/dist/chunk-CKIO6SVS.js +2 -0
  23. package/dist/chunk-D6Z67MZL.js +2 -0
  24. package/dist/chunk-DFK54IRN.js +2 -0
  25. package/dist/chunk-FD37DBTD.js +2 -0
  26. package/dist/chunk-FOQQDXE7.js +2 -0
  27. package/dist/chunk-GAQGJ52J.js +11 -0
  28. package/dist/chunk-IODTPF5H.js +20 -0
  29. package/dist/chunk-J6Z5YKGQ.js +4 -0
  30. package/dist/chunk-JB4PUN5S.js +40 -0
  31. package/dist/chunk-JTXKS5GK.js +3 -0
  32. package/dist/chunk-KJ3ZJIE5.js +2 -0
  33. package/dist/chunk-KJ6CW6EK.js +2 -0
  34. package/dist/{chunk-2R7OKZE5.js → chunk-KNA6Z7JB.js} +3 -3
  35. package/dist/{chunk-FYO3FPFH.js → chunk-LDV2B7ET.js} +8 -8
  36. package/dist/chunk-LWYIGRHR.js +5 -0
  37. package/dist/chunk-MDAYGS6T.js +2 -0
  38. package/dist/chunk-MX6F756F.js +2 -0
  39. package/dist/chunk-NHDPYW7O.js +2 -0
  40. package/dist/{chunk-TYRPQE6R.js → chunk-NKJKI6SE.js} +2 -2
  41. package/dist/chunk-NN3O7TPH.js +8 -0
  42. package/dist/chunk-NSTZMBAB.js +18 -0
  43. package/dist/chunk-NYEMZHUC.js +6 -0
  44. package/dist/chunk-OHEIZWIA.js +4 -0
  45. package/dist/chunk-PG3ZI5IH.js +2 -0
  46. package/dist/chunk-QAEDNTY7.js +2 -0
  47. package/dist/chunk-QE6MGGUY.js +2 -0
  48. package/dist/chunk-QPRIYXH4.js +2 -0
  49. package/dist/chunk-QWJBIBE6.js +3 -0
  50. package/dist/chunk-RCJEFQOK.js +4 -0
  51. package/dist/chunk-ROOHENEP.js +61 -0
  52. package/dist/{chunk-2YA36CXK.js → chunk-ROZNBWIF.js} +2 -2
  53. package/dist/chunk-TGK5DFBJ.js +2 -0
  54. package/dist/chunk-TKDJQ2WD.js +59 -0
  55. package/dist/chunk-TRNAQABL.js +7 -0
  56. package/dist/chunk-U75WH4XG.js +2 -0
  57. package/dist/chunk-V53J46BX.js +2 -0
  58. package/dist/chunk-V76FCF5F.js +2 -0
  59. package/dist/chunk-VUBQBW7H.js +16 -0
  60. package/dist/chunk-WJQY2LGT.js +2 -0
  61. package/dist/{chunk-ILQSK2KJ.js → chunk-WODJHE6Z.js} +3 -3
  62. package/dist/{chunk-RRWPHKZA.js → chunk-WPLKHAH7.js} +4 -4
  63. package/dist/chunk-XO6R3X5J.js +2 -0
  64. package/dist/chunk-YSZNAG4G.js +2 -0
  65. package/dist/chunk-ZNUPGRPR.js +3 -0
  66. package/dist/{chunk-OCQN6WF4.js → chunk-ZXFTC5ET.js} +4 -4
  67. package/dist/cli.js +361 -505
  68. package/dist/config-types-CGIeLEpY.d.ts +108 -0
  69. package/dist/db-DdTPetj5.d.ts +69 -0
  70. package/dist/health-x7B4Xu_6.d.ts +119 -0
  71. package/dist/index.d.ts +109 -336
  72. package/dist/index.js +3 -131
  73. package/dist/postinstall.js +1 -1
  74. package/dist/queries/affected.d.ts +9 -2
  75. package/dist/queries/affected.js +1 -1
  76. package/dist/queries/bottlenecks.d.ts +14 -2
  77. package/dist/queries/bottlenecks.js +1 -1
  78. package/dist/queries/by-kind.d.ts +12 -2
  79. package/dist/queries/by-kind.js +1 -1
  80. package/dist/queries/call-graph.d.ts +22 -3
  81. package/dist/queries/call-graph.js +1 -1
  82. package/dist/queries/change-surface.d.ts +19 -3
  83. package/dist/queries/change-surface.js +1 -1
  84. package/dist/queries/code.d.ts +12 -2
  85. package/dist/queries/code.js +1 -1
  86. package/dist/queries/complexity-hotspots.d.ts +16 -2
  87. package/dist/queries/complexity-hotspots.js +1 -1
  88. package/dist/queries/complexity.d.ts +22 -3
  89. package/dist/queries/complexity.js +1 -1
  90. package/dist/queries/convergence.d.ts +25 -3
  91. package/dist/queries/convergence.js +1 -1
  92. package/dist/queries/coupling.d.ts +8 -2
  93. package/dist/queries/coupling.js +1 -1
  94. package/dist/queries/cycles.d.ts +16 -2
  95. package/dist/queries/cycles.js +1 -1
  96. package/dist/queries/dataflow.d.ts +35 -3
  97. package/dist/queries/dataflow.js +1 -1
  98. package/dist/queries/dead.d.ts +34 -2
  99. package/dist/queries/dead.js +1 -1
  100. package/dist/queries/deep-chains.d.ts +8 -2
  101. package/dist/queries/deep-chains.js +1 -1
  102. package/dist/queries/deps.d.ts +6 -2
  103. package/dist/queries/deps.js +1 -1
  104. package/dist/queries/diff-impact.d.ts +22 -2
  105. package/dist/queries/diff-impact.js +1 -1
  106. package/dist/queries/drift.d.ts +19 -2
  107. package/dist/queries/drift.js +1 -1
  108. package/dist/queries/extract-candidates.d.ts +20 -2
  109. package/dist/queries/extract-candidates.js +1 -1
  110. package/dist/queries/fan.d.ts +7 -2
  111. package/dist/queries/fan.js +1 -1
  112. package/dist/queries/files.d.ts +6 -2
  113. package/dist/queries/files.js +1 -1
  114. package/dist/queries/health.d.ts +4 -81
  115. package/dist/queries/health.js +1 -1
  116. package/dist/queries/hierarchy.d.ts +8 -2
  117. package/dist/queries/hierarchy.js +1 -1
  118. package/dist/queries/hotspots.d.ts +10 -2
  119. package/dist/queries/hotspots.js +1 -1
  120. package/dist/queries/imports.d.ts +19 -4
  121. package/dist/queries/imports.js +1 -1
  122. package/dist/queries/index.d.ts +45 -44
  123. package/dist/queries/index.js +1 -1
  124. package/dist/queries/isolated.d.ts +13 -2
  125. package/dist/queries/isolated.js +1 -1
  126. package/dist/queries/members.d.ts +10 -2
  127. package/dist/queries/members.js +1 -1
  128. package/dist/queries/methods.d.ts +8 -2
  129. package/dist/queries/methods.js +1 -1
  130. package/dist/queries/outline.d.ts +10 -2
  131. package/dist/queries/outline.js +1 -1
  132. package/dist/queries/passthrough-candidates.d.ts +15 -2
  133. package/dist/queries/passthrough-candidates.js +1 -1
  134. package/dist/queries/redundant-reexports.d.ts +13 -2
  135. package/dist/queries/redundant-reexports.js +1 -1
  136. package/dist/queries/refs.d.ts +10 -3
  137. package/dist/queries/refs.js +1 -1
  138. package/dist/queries/similar-chains.d.ts +21 -2
  139. package/dist/queries/similar-chains.js +1 -1
  140. package/dist/queries/similar-files.d.ts +12 -2
  141. package/dist/queries/similar-files.js +1 -1
  142. package/dist/queries/similar-signatures.d.ts +18 -2
  143. package/dist/queries/similar-signatures.js +1 -1
  144. package/dist/queries/similar.d.ts +24 -2
  145. package/dist/queries/similar.js +1 -1
  146. package/dist/queries/slice.d.ts +17 -2
  147. package/dist/queries/slice.js +1 -1
  148. package/dist/queries/stale-abstractions.d.ts +37 -3
  149. package/dist/queries/stale-abstractions.js +1 -1
  150. package/dist/queries/stats.d.ts +11 -2
  151. package/dist/queries/stats.js +1 -1
  152. package/dist/queries/surface.d.ts +8 -2
  153. package/dist/queries/surface.js +1 -1
  154. package/dist/queries/symbols.d.ts +10 -2
  155. package/dist/queries/symbols.js +1 -1
  156. package/dist/queries/system.d.ts +10 -2
  157. package/dist/queries/system.js +1 -1
  158. package/dist/queries/trace.d.ts +21 -3
  159. package/dist/queries/trace.js +1 -1
  160. package/dist/queries/wrapper-candidates.d.ts +15 -2
  161. package/dist/queries/wrapper-candidates.js +1 -1
  162. package/dist/reindex-worker.js +10 -10
  163. package/dist/reindex.d.ts +153 -0
  164. package/dist/reindex.js +69 -0
  165. package/dist/runtime.d.ts +108 -0
  166. package/dist/runtime.js +3 -0
  167. package/dist/scip-cli-a-xOztiK.d.ts +20 -0
  168. package/package.json +184 -4
  169. package/dist/chunk-2AUZ3PLO.js +0 -2
  170. package/dist/chunk-3A2M7AF3.js +0 -4
  171. package/dist/chunk-3EJRPTTB.js +0 -2
  172. package/dist/chunk-3SWWYJPB.js +0 -6
  173. package/dist/chunk-4M4FEWBL.js +0 -7
  174. package/dist/chunk-4Y6KUJDO.js +0 -39
  175. package/dist/chunk-55ZJ2FCW.js +0 -6
  176. package/dist/chunk-6FLGPRBR.js +0 -5
  177. package/dist/chunk-6XRB6ATD.js +0 -16
  178. package/dist/chunk-7EQ4J66C.js +0 -2
  179. package/dist/chunk-7TGEXAN5.js +0 -25
  180. package/dist/chunk-ABLXPGAZ.js +0 -2
  181. package/dist/chunk-BG7YU4DJ.js +0 -2
  182. package/dist/chunk-D2R6IIEO.js +0 -2
  183. package/dist/chunk-E47WMJ5F.js +0 -2
  184. package/dist/chunk-EEA3R37V.js +0 -11
  185. package/dist/chunk-FAN2CVZT.js +0 -2
  186. package/dist/chunk-FVH3Y44U.js +0 -1
  187. package/dist/chunk-G47V5V3U.js +0 -90
  188. package/dist/chunk-GS55K4WJ.js +0 -85
  189. package/dist/chunk-H4DXD2FB.js +0 -5
  190. package/dist/chunk-HADDFTMU.js +0 -2
  191. package/dist/chunk-IARIBTCL.js +0 -2
  192. package/dist/chunk-IBWYWAWE.js +0 -70
  193. package/dist/chunk-JVMXNDRU.js +0 -2
  194. package/dist/chunk-K345WFTU.js +0 -2
  195. package/dist/chunk-K6ULLR7M.js +0 -19
  196. package/dist/chunk-KAM4C6ZD.js +0 -4
  197. package/dist/chunk-KCC3GMCX.js +0 -2
  198. package/dist/chunk-KRVRD6KZ.js +0 -5
  199. package/dist/chunk-KYGNCIJ6.js +0 -84
  200. package/dist/chunk-LHLXHH43.js +0 -2
  201. package/dist/chunk-LJ2YWNQF.js +0 -2
  202. package/dist/chunk-M7GBLQG4.js +0 -7
  203. package/dist/chunk-MEVK6R7N.js +0 -2
  204. package/dist/chunk-QRYEOK3M.js +0 -2
  205. package/dist/chunk-QYWGC7JV.js +0 -114
  206. package/dist/chunk-R373SHXM.js +0 -2
  207. package/dist/chunk-RUAJV3TN.js +0 -2
  208. package/dist/chunk-S57GUI2T.js +0 -7
  209. package/dist/chunk-SVUVC5VS.js +0 -2
  210. package/dist/chunk-T426XELO.js +0 -12
  211. package/dist/chunk-TBJDUS4E.js +0 -71
  212. package/dist/chunk-TX7BHRMT.js +0 -2
  213. package/dist/chunk-WPY46NIL.js +0 -5
  214. package/dist/chunk-X3Z4KZNX.js +0 -2
  215. package/dist/db-DdlToIC-.d.ts +0 -835
  216. package/dist/queries/drift-policy.d.ts +0 -6
  217. package/dist/queries/drift-policy.js +0 -2
  218. package/dist/queries/health-cache-control.d.ts +0 -15
  219. package/dist/queries/health-cache-control.js +0 -2
@@ -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{statSync as i}from"fs";function r(t){let e=t.get("SELECT COUNT(*) as c FROM documents").c,s=t.get("SELECT COUNT(*) as c FROM global_symbols").c,n=t.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,c=t.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:e,symbols:s,definitions:n,references:c,...o(t.config.dbPath)}}function o(t){try{let e=i(t);return{indexSizeBytes:e.size,lastBuilt:e.mtime}}catch{return{indexSizeBytes:0,lastBuilt:null}}}export{r as a};
2
- //# sourceMappingURL=chunk-QRYEOK3M.js.map
@@ -1,114 +0,0 @@
1
- import{H as y,I as S,q as E,r as I,t as L,u as $,v}from"./chunk-KYGNCIJ6.js";function ne(e,t){let n=K(e,t.trim());if(n)return n;let s=B(e,t);if(s)return s;let a=F(e,t);return a||W(e,t)}function F(e,t){let n=C(t),s=w(n);if(!s)return null;let a=`%${s.path}%`,i=s.leaf,r=k(e,a,i,n)[0];return r?y(e,r):null}function k(e,t,n,s){let a=M([],[...J(e,t,n),...T(e,t,n)]).filter(i=>!e.isIgnored(i.relative_path)).filter(i=>_(i,s)>1);return a.sort((i,o)=>_(o,s)-_(i,s)||i.end_line-i.start_line-(o.end_line-o.start_line)||i.start_line-o.start_line||i.symbol.localeCompare(o.symbol)),a}function J(e,t,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
2
- FROM global_symbols gs
3
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE d.relative_path LIKE ?
6
- AND (gs.display_name = ? OR gs.symbol LIKE ?)
7
- ${e.pathExclusionsFor("d")}`,t,n,`%/${n}.%`)}function T(e,t,n){return e.all(`SELECT
8
- gs.id,
9
- gs.symbol,
10
- c.document_id,
11
- MIN(c.start_line) AS start_line,
12
- MAX(c.end_line) AS end_line,
13
- d.relative_path,
14
- gs.display_name,
15
- gs.documentation
16
- FROM global_symbols gs
17
- JOIN mentions m ON m.symbol_id = gs.id
18
- JOIN chunks c ON m.chunk_id = c.id
19
- JOIN documents d ON c.document_id = d.id
20
- WHERE m.role = 1
21
- AND d.relative_path LIKE ?
22
- AND (gs.display_name = ? OR gs.symbol LIKE ?)
23
- ${e.pathExclusionsFor("d")}
24
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation`,t,n,`%/${n}.%`)}function W(e,t){let n=C(t),s=j(t),a=z(e,s),i=q(a,t,n);if(i&&!e.isIgnored(i.relative_path))return y(e,i);let o=null;for(let r of a){if(e.isIgnored(r.relative_path))continue;let d=U(r,t,n,s);d<=0||(!o||d>o.score)&&(o={row:r,score:d})}return o?y(e,o.row):null}function B(e,t){let n=t.match(/^(.+):(\d+)-(\d+)$/);if(!n)return null;let[,s,a,i]=n,o=Math.max(0,parseInt(a,10)-1),r=Math.max(o,parseInt(i,10)-1),d=Y(e,s,o,r)??H(e,s,o,r);return d&&!e.isIgnored(d.relative_path)?y(e,d):null}function Y(e,t,n,s){return e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
25
- FROM global_symbols gs
26
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
27
- JOIN documents d ON der.document_id = d.id
28
- WHERE d.relative_path LIKE ?
29
- AND der.start_line <= ? AND der.end_line >= ?
30
- ${e.pathExclusionsFor("d")}
31
- ORDER BY (der.end_line - der.start_line) ASC
32
- LIMIT 1`,`%${t}%`,n,s)}function H(e,t,n,s){return e.get(`SELECT gs.id, gs.symbol, c.document_id, MIN(c.start_line) AS start_line, MAX(c.end_line) AS end_line, d.relative_path
33
- FROM global_symbols gs
34
- JOIN mentions m ON m.symbol_id = gs.id
35
- JOIN chunks c ON m.chunk_id = c.id
36
- JOIN documents d ON c.document_id = d.id
37
- WHERE m.role = 1
38
- AND d.relative_path LIKE ?
39
- AND c.start_line <= ? AND c.end_line >= ?
40
- ${e.pathExclusionsFor("d")}
41
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
42
- ORDER BY (MAX(c.end_line) - MIN(c.start_line)) ASC
43
- LIMIT 1`,`%${t}%`,n,s)}function K(e,t){let s=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
44
- FROM global_symbols gs
45
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
46
- JOIN documents d ON der.document_id = d.id
47
- WHERE gs.symbol = ?
48
- ${e.pathExclusionsFor("d")}
49
- ORDER BY d.relative_path, der.start_line
50
- LIMIT 1`,t)??e.get(`SELECT
51
- gs.id,
52
- gs.symbol,
53
- c.document_id,
54
- MIN(c.start_line) AS start_line,
55
- MAX(c.end_line) AS end_line,
56
- d.relative_path
57
- FROM global_symbols gs
58
- JOIN mentions m ON m.symbol_id = gs.id
59
- JOIN chunks c ON m.chunk_id = c.id
60
- JOIN documents d ON c.document_id = d.id
61
- WHERE gs.symbol = ?
62
- AND m.role = 1
63
- ${e.pathExclusionsFor("d")}
64
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
65
- ORDER BY d.relative_path, start_line
66
- LIMIT 1`,t);return!s||e.isIgnored(s.relative_path)?null:y(e,s)}function te(e,t){if("symbol"in t&&"relativePath"in t)return t;let n=X(e,t.symbolId)[0];return n?y(e,n):null}function X(e,t){let n=e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
67
- FROM global_symbols gs
68
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
69
- JOIN documents d ON der.document_id = d.id
70
- WHERE gs.id = ?
71
- ORDER BY der.start_line, der.end_line`,t),s=e.all(`SELECT
72
- gs.id,
73
- gs.symbol,
74
- c.document_id,
75
- MIN(c.start_line) AS start_line,
76
- MAX(c.end_line) AS end_line,
77
- d.relative_path,
78
- gs.display_name,
79
- gs.documentation
80
- FROM global_symbols gs
81
- JOIN mentions m ON m.symbol_id = gs.id
82
- JOIN chunks c ON m.chunk_id = c.id
83
- JOIN documents d ON c.document_id = d.id
84
- WHERE gs.id = ?
85
- AND m.role = 1
86
- ${e.pathExclusionsFor("d")}
87
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
88
- ORDER BY start_line, end_line`,t);return M(n,s)}function z(e,t){let n=t.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),s=t.flatMap(o=>{let r=`%${o}%`;return[r,r,r]}),a=e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
89
- FROM global_symbols gs
90
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
91
- JOIN documents d ON der.document_id = d.id
92
- WHERE ${n.join(`
93
- AND `)}
94
- ${e.pathExclusionsFor("d")}
95
- LIMIT 200`,...s),i=e.all(`SELECT
96
- gs.id,
97
- gs.symbol,
98
- c.document_id,
99
- MIN(c.start_line) AS start_line,
100
- MAX(c.end_line) AS end_line,
101
- d.relative_path,
102
- gs.display_name,
103
- gs.documentation
104
- FROM global_symbols gs
105
- JOIN mentions m ON m.symbol_id = gs.id
106
- JOIN chunks c ON m.chunk_id = c.id
107
- JOIN documents d ON c.document_id = d.id
108
- WHERE m.role = 1
109
- AND ${n.join(`
110
- AND `)}
111
- ${e.pathExclusionsFor("d")}
112
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
113
- LIMIT 200`,...s);return M(a,i)}function M(e,t){let n=new Map;for(let s of t)e.length>0&&!G(s)||n.set(s.id,s);for(let s of e)n.set(s.id,s);return[...n.values()]}function G(e){if(S(e.symbol)!==null)return!1;let n=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(n)}function U(e,t,n,s){let a=t.trim(),i=n,o=i.replace(/\(\)$/,""),r=t.toLowerCase(),d=n.toLowerCase(),g=d.replace(/\(\)$/,""),D=e.symbol,R=E(e.symbol),p=I(e.symbol),Q=e.display_name??"",f=e.symbol.toLowerCase(),c=R.toLowerCase(),m=p.toLowerCase(),O=Q.toLowerCase(),u=e.relative_path.toLowerCase(),A=/[/:.]/.test(n),N=w(n),b=N?.leaf.toLowerCase(),l=0;return(D===a||D===i)&&(l+=1150),(R===a||R===i)&&(l+=1100),Q===o&&(l+=1180),p===o&&(l+=1160),(`${p}()`===a||`${p}()`===i)&&(l+=955),(f===r||f===d)&&(l+=1e3),(c===r||c===d)&&(l+=950),(u===r||u===d)&&(l+=925),(u.endsWith(`/${d}`)||u.endsWith(`/${r}`))&&(l+=875),O===g&&(l+=850),m===g&&(l+=825),(`${m}()`===r||`${m}()`===d)&&(l+=820),(c.endsWith(`:${d}`)||c.endsWith(`:${g}`)||c.endsWith(`:${g}()`))&&(l+=800),f.includes(d)&&(l+=120),c.includes(d)&&(l+=140),u.includes(d)&&(l+=140),O.includes(d)&&(l+=110),s.every(x=>{let h=x.toLowerCase();return f.includes(h)||c.includes(h)||u.includes(h)||O.includes(h)})&&(l+=100+s.length*15),N&&u.includes(N.path.toLowerCase())&&(l+=360,b&&(m===b||`${m}()`===b||`${m}()`==`${b}()`)&&(l+=700),L(e.symbol)&&(l+=180)),$(e.symbol)&&m===g&&(l+=60),!A&&v(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function w(e){let t=e.trim().replace(/\\/g,"/"),n=t.lastIndexOf("/");if(n<=0||n===t.length-1)return null;let s=t.slice(n+1).replace(/\(\)$/,"");return!s||s.includes(".")?null:{path:t.slice(0,n),leaf:s}}function C(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function j(e){let t=C(e),n=t.split(/[^A-Za-z0-9_]+/).map(s=>s.trim()).filter(s=>s.length>0);return n.length>0?[...new Set(n)]:[t]}function q(e,t,n){let s=t.trim(),a=e.filter(i=>{let o=E(i.symbol),r=(i.display_name??"").trim();return i.symbol===s||o===s||o===n||r===s||r===n||`${r}()`===s||_(i,n)>1||i.relative_path===s});return a.length===0?null:(a.sort((i,o)=>_(o,n)-_(i,n)||i.end_line-i.start_line-(o.end_line-o.start_line)||i.relative_path.localeCompare(o.relative_path)||i.symbol.localeCompare(o.symbol)),a[0]??null)}function _(e,t){let n=w(t);if(!n)return 0;let s=e.relative_path.toLowerCase(),a=I(e.symbol).toLowerCase(),i=n.path.toLowerCase(),o=n.leaf.toLowerCase();return s.includes(i)?a!==o?1:L(e.symbol)?S(e.symbol)===null?5:4:S(e.symbol)===null?3:2:0}export{ne as a,K as b,te as c};
114
- //# sourceMappingURL=chunk-QYWGC7JV.js.map
@@ -1,2 +0,0 @@
1
- import{b as p}from"./chunk-55ZJ2FCW.js";import{F as u,z as f}from"./chunk-KYGNCIJ6.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let m=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,c=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<c&&(c=d,l=t)}l?l.children.push(n):m.push(n)}return m}export{S as a};
2
- //# sourceMappingURL=chunk-R373SHXM.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
@@ -1,12 +0,0 @@
1
- import{a as P}from"./chunk-SVUVC5VS.js";import{d as R,e as v,f as D,g as F,h as L}from"./chunk-TYRPQE6R.js";import{a as m,k as S}from"./chunk-GS55K4WJ.js";import{f}from"./chunk-6FLGPRBR.js";import{D as h,J as c,q as d,t as p,u as g,v as b,w as y,x as _}from"./chunk-KYGNCIJ6.js";function Q(e,n={}){let{scope:r,minLoc:t=1,includeTests:s=!1,skipBarrels:a=!1,includeMembers:i=!1}=n,l=a?new Set(R(e)):new Set,o=w(e,l);k(e,o,l);let u=x(e,{scope:r,minLoc:t,includeTests:s,includeMembers:i});return H(e,u,o,{includeTests:s,inactiveBarrelPaths:l}),M(e,E(u,o))}function w(e,n){let r=e.all(`SELECT
2
- m.symbol_id,
3
- d.relative_path,
4
- COUNT(*) AS ref_count
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents d ON c.document_id = d.id
8
- WHERE m.role != 1
9
- ${e.pathExclusionsFor("d")}
10
- GROUP BY m.symbol_id, d.relative_path`),t=new Map;for(let s of r){if(e.isIgnored(s.relative_path)||n.has(s.relative_path))continue;let a=t.get(s.symbol_id);a||(a=new Map,t.set(s.symbol_id,a)),a.set(s.relative_path,s.ref_count)}return t}function x(e,n){let r=U(e);return h(e,{scope:n.scope}).filter(t=>!e.isIgnored(t.relativePath)).filter(t=>!b(t.symbol)).filter(t=>T(t.symbol)).filter(t=>t.isFunctionLike||!t.enclosingSymbol||!T(t.enclosingSymbol)).filter(t=>n.includeTests||C(t.relativePath)).filter(t=>n.includeTests||!r(t.relativePath,t.startLine,t.symbol,t.parentTypeName)).filter(t=>!y(t.symbol)).filter(t=>!_(t.symbol)).filter(t=>n.includeMembers||j(t)).filter(t=>t.endLine-t.startLine+1>=n.minLoc)}function E(e,n){return e.map(r=>I(r,n)).filter(r=>r.cross_file_refs===0).sort((r,t)=>t.loc-r.loc||r.relative_path.localeCompare(t.relative_path)||r.start_line-t.start_line)}function I(e,n){let r=n.get(e.symbolId)??new Map,t=r.get(e.relativePath)??0,s=0;for(let[a,i]of r)a!==e.relativePath&&(s+=i);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:t,cross_file_refs:s}}function M(e,n){let r=[],t=0,s=0,a=0;for(let i of n){if(e.isIgnored(i.relative_path)||v(e,i.relative_path)||D(e,i.symbol,i.relative_path))continue;let l=i.same_file_refs===0?"dead-code":"file-internal";l==="dead-code"?t++:s++,a+=i.loc,r.push({relativePath:i.relative_path,startLine:i.start_line,endLine:i.end_line,loc:i.loc,symbol:i.symbol,shortName:d(i.symbol),sameFileRefs:i.same_file_refs,kind:l})}return{symbols:r,totalCount:r.length,deadCodeCount:t,fileInternalCount:s,totalLoc:a}}function k(e,n,r){let t=new P(e),s=new Set(t.sourceFiles());for(let a of N(e))s.add(a);t.scanSourceReferences({paths:s,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",skipPath:a=>r.has(a)},a=>{O(e,a)||B(n,a.target.symbolId,a.sourceFile,A(a))})}function N(e){let n=e.all(`SELECT relative_path FROM documents
11
- WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`);return new Set(n.map(r=>r.relative_path))}function O(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&$(e,n)}function A(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function B(e,n,r,t){if(t<=0)return;let s=e.get(n);s||(s=new Map,e.set(n,s)),s.set(r,(s.get(r)??0)+t)}function $(e,n){return n.occurrences>1?!1:f(e,n.sourceFile).some(r=>r.used||r.sourcePath!==n.target.relativePath?!1:r.importedName===n.name||r.localName===n.name)}function H(e,n,r,t){for(let s of n){let a=S(e,s);if(a.length===0)continue;let i=r.get(s.symbolId);i||(i=new Map,r.set(s.symbolId,i));for(let l of a){let o=l.file;o===s.relativePath||e.isIgnored(o)||t.inactiveBarrelPaths.has(o)||!t.includeTests&&!C(o)||i.set(o,Math.max(1,i.get(o)??0))}}}function U(e){let n=new Map,r=t=>{let s=n.get(t);if(s)return s;let a=m(e,t);return s={ranges:a.map(i=>({startLine:i.startLine,endLine:i.endLine})),containers:new Set(a.map(i=>i.containerName).filter(i=>!!i))},n.set(t,s),s};return(t,s,a,i)=>{let l=r(t);for(let o of l.ranges)if(s>=o.startLine&&s<=o.endLine)return!0;if(i&&l.containers.has(i))return!0;for(let o of c(a))if(l.containers.has(o))return!0;return!1}}function C(e){return[...new Set([...F,...L])].every(r=>!W(e,r))}function W(e,n){return new RegExp(`^${n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/%/g,".*").replace(/_/g,".")}$`).test(e)}function T(e){return g(e)||e.endsWith("().")||e.endsWith(".")}function j(e){return p(e.symbol)||c(e.symbol).length===0}export{Q as a};
12
- //# sourceMappingURL=chunk-T426XELO.js.map
@@ -1,71 +0,0 @@
1
- import ue from"better-sqlite3";import{createRequire as ce}from"module";import{existsSync as le,mkdtempSync as Sn,readFileSync as v,rmSync as yn,statSync as vn,writeFileSync as Rn}from"fs";import{cpus as Vn,tmpdir as xn}from"os";import{dirname as F,extname as ge,join as O,relative as fe,resolve as de}from"path";import{pathToFileURL as me}from"url";import{Worker as In}from"worker_threads";import K from"better-sqlite3";import{execFileSync as B}from"child_process";import{existsSync as J,readdirSync as z,readFileSync as X}from"fs";import{extname as m,join as E}from"path";import M from"ignore";import{readFileSync as A,existsSync as h}from"fs";import{dirname as b,isAbsolute as R,join as S,relative as P,resolve as j}from"path";function V(e){let n=M(),r=!1,t=W(e);for(let o of t)try{let i=A(o,"utf-8");n.add(i),r=!0}catch{}return r||n.add($),{isIgnored:o=>k(n,e,o),filter:o=>o.filter(i=>!k(n,e,i))}}function W(e){let n=[],r=S(e,".gitignore");h(r)&&n.push(r);let t=b(e),o=0;for(;t!==b(t)&&o<5;){let i=S(t,".gitignore");if(h(i)&&n.push(i),h(S(t,".git")))break;t=b(t),o++}return n}var $=`
2
- # Dependencies
3
- node_modules/
4
- vendor/
5
- .bundle/
6
-
7
- # Build output
8
- dist/
9
- build/
10
- out/
11
- target/
12
- bin/
13
- obj/
14
-
15
- # Python
16
- __pycache__/
17
- *.pyc
18
- *.pyo
19
- .venv/
20
- venv/
21
- .env/
22
- env/
23
- *.egg-info/
24
-
25
- # Rust
26
- target/
27
-
28
- # Java / Kotlin / Scala
29
- *.class
30
- .gradle/
31
- .mvn/
32
-
33
- # C# / .NET
34
- bin/
35
- obj/
36
- packages/
37
-
38
- # Go
39
- vendor/
40
-
41
- # Dart
42
- .dart_tool/
43
- build/
44
-
45
- # PHP
46
- vendor/
47
-
48
- # IDE / OS
49
- .idea/
50
- .vscode/
51
- *.swp
52
- *.swo
53
- .DS_Store
54
- Thumbs.db
55
-
56
- # Type definitions (often noise in queries)
57
- *.d.ts
58
- `;function k(e,n,r){let t=U(n,r);if(!t)return!1;try{return e.ignores(t)}catch{return!1}}function U(e,n){if(!n||n===".")return null;if(!R(n)&&!n.startsWith(".."))return n.replaceAll("\\","/");let r=R(n)?n:j(e,n),t=P(e,r).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}import{readdirSync as Be}from"fs";import{extname as ze,join as Xe}from"path";function x(e){let n=new WeakMap,r=t=>{let o=n.get(t);return o||(o=new Map,n.set(t,o)),o};return{get(t,o,i){let s=r(t);if(s.has(o))return s.get(o);let a=i();return s.set(o,a),a},invalidate(t,o){n.get(t)?.delete(o)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}var H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],G=new Set(H.map(e=>e.toLowerCase())),qe=[...G].sort().join(","),T=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var Qe=x("source-files");function an(e){let n=new Set((e.extensions??w).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!J(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=V(e.projectRoot),t=Y(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new K(e.dbPath);try{let i=Q(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
59
- VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let g of l){if(i.has(g))continue;let f=X(E(e.projectRoot,g),"utf-8"),_=s.run(Z(g),g,f);d+=Number(_.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Y(e,n){let r=q(e,n);if(r)return r;let t=[],o=i=>{let s=i?E(e,i):e,a;try{a=z(s,{withFileTypes:!0})}catch{return}for(let u of a){if(T.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function q(e,n){try{return B("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
60
- `).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function Q(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Z(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as ee}from"child_process";import{createHash as ne}from"crypto";import{readdirSync as te,readFileSync as re}from"fs";import{join as I}from"path";function oe(e){return(ie(e)??se(e)).filter(n=>n&&!C(n)).sort()}function dn(e){return oe(e).map(n=>{let r=I(e,n);try{let t=re(r);return{path:n,size:t.byteLength,hash:ne("sha256").update(t).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function ie(e){try{return ee("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
61
- `).filter(Boolean)}catch{return null}}function se(e){let n=[],r=[""];for(;r.length>0;){let t=r.pop(),o=t?I(e,t):e,i;try{i=te(o,{withFileTypes:!0})}catch{continue}for(let s of i){let a=t?`${t}/${s.name}`:s.name;if(s.isDirectory()){C(a)||r.push(a);continue}n.push(a)}}return n}function C(e){return e.split("/").some(r=>ae.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ae=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);function Cn(e){let n=de(e.projectRoot,e.tsconfig),r=ke(e.projectRoot,n),t=new ue(e.dbPath,{readonly:!0});try{let o=Me();return pe({projectRoot:e.projectRoot,vueFiles:e.vueFiles??[],tasks:e.tasks,context:r,symbolLookup:Ee(t,e.projectRoot,o),vueSymbolLookup:Fe(t,e.projectRoot),sourceCache:o})}finally{t.close()}}function pe(e){let n=[],r=0,t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=he(e,o);n.push(...i.occurrences),r+=i.skippedReferences}return{occurrences:n,skippedReferences:r}}function he(e,n){let r=e.context.language.scripts.get(n.fileName),t=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!t)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let o=e.sourceCache(n.fileName);if(!o)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let i=e.context.language.maps.get(t,r),s=p(e.projectRoot,n.fileName),a=[...Le(o.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:ye(a),processedStarts:new Set};return be({...e,fileName:n.fileName,sourceInfo:o,sourceFile:s,map:i,tokenContext:u})}function be(e){let n=[],r=0;for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start))continue;let o=De(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(u=>!Ne(e.projectRoot,u.fileName));if(!s){r++;continue}let a=Oe(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}L(n,e.sourceInfo,e.sourceFile,t,a),e.tokenContext.processedStarts.add(t.start),Se(n,e,t,o,a)}return{occurrences:n,skippedReferences:r}}function Se(e,n,r,t,o){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let i of ve(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(i))continue;let s=n.tokenContext.tokenByStart.get(i);s&&(L(e,n.sourceInfo,n.sourceFile,s,o),n.tokenContext.processedStarts.add(i))}}function L(e,n,r,t,o){let i=N(n,t.start);e.push({sourceFile:r,sourceLine:i.line,sourceStartChar:i.character,sourceEndChar:i.character+t.text.length,symbolId:o})}function ye(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function ve(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Re(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Re(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=D(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}function ke(e,n){let{vueCore:r,ts:t,volarTs:o}=Ve(e),{parsed:i,vueOptions:s}=xe(r,t,n),a=F(n),u=r.createVueLanguagePlugin(t,i.options,s,f=>f),c=we(r,t,u),l=Te(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,f=>f,l),g=t.createLanguageService(d);return{ts:t,language:c,languageService:g,fileNames:i.fileNames,configDir:a}}function Ve(e){let n=ce(me(O(e,"package.json")).href);return{vueCore:y(n,"@vue/language-core",e),ts:y(n,"typescript",e),volarTs:y(n,"@volar/typescript",e)}}function xe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,F(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function we(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!le(i))return;let s=v(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??_e(i))});return t.current=o,o}function Te(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function y(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function Ee(e,n,r){let t=Ie(e);return o=>{let i=p(n,o.fileName),s=r(o.fileName);if(!s)return null;let a=N(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Ce(u.starts,a.line,2)}}function Ie(e){let n=e.prepare(`
62
- SELECT
63
- d.relative_path AS relativePath,
64
- der.start_line AS startLine,
65
- der.end_line AS endLine,
66
- der.symbol_id AS symbolId
67
- FROM defn_enclosing_ranges der
68
- JOIN documents d ON d.id = der.document_id
69
- ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
70
- `).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,t.symbolId)}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function Ce(e,n,r){let t=0,o=e.length-1;for(;t<=o;){let s=Math.floor((t+o)/2);e[s].line<n?t=s+1:o=s-1}let i=null;for(let s of[o,t]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>r||(!i||u<i.distance)&&(i={distance:u,symbolId:a.symbolId})}return i?.symbolId??null}function Fe(e,n){let r=Pe(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=p(n,i),a=je(r.name,r.version,s),c=t.get(a)?.id??null;return o.set(i,c),c}}}function Oe(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(D(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*Le(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function De(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function D(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function N(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function Ne(e,n){return p(e,n).startsWith("node_modules/")}function p(e,n){return fe(e,n).replaceAll("\\","/")}function _e(e){switch(ge(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function Me(){let e=new Map;return n=>{if(e.has(n))return e.get(n)??null;try{let r=v(n,"utf-8"),t={text:r,lineStarts:Ae(r)};return e.set(n,t),t}catch{return e.set(n,null),null}}}function Ae(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function Pe(e){try{let n=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function je(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}export{an as a,dn as b,Cn as c};
71
- //# sourceMappingURL=chunk-TBJDUS4E.js.map
@@ -1,2 +0,0 @@
1
- import{a as R,b as L}from"./chunk-KRVRD6KZ.js";import{a as f}from"./chunk-QRYEOK3M.js";import{a as w}from"./chunk-4M4FEWBL.js";import{a as b}from"./chunk-FAN2CVZT.js";import{b as C}from"./chunk-3SWWYJPB.js";import{a as y}from"./chunk-IARIBTCL.js";import{a as x}from"./chunk-K6ULLR7M.js";import{a as S}from"./chunk-D2R6IIEO.js";import{a as m,b as h}from"./chunk-2AUZ3PLO.js";import{a as H}from"./chunk-2CC7RA6B.js";import{a as g}from"./chunk-T426XELO.js";import{a as P}from"./chunk-ABLXPGAZ.js";import{e as l,f as d}from"./chunk-TYRPQE6R.js";var O=50,j=75e3,W=5e3,A=2500,gt=["overview","dead","isolated","cycles","similar","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots"],q={overview:(t,e,a,r)=>({phase:"overview",statsResult:r,warnings:a.warnings}),dead:(t,e,a)=>({phase:"dead",dead:D(t,e,a)}),isolated:(t,e,a)=>({phase:"isolated",isolated:T(t,e,a)}),cycles:(t,e,a)=>({phase:"cycles",realCycleCount:B(t,e,a)}),similar:(t,e,a)=>({phase:"similar",similarCount:M(t,e,a)}),"extract-candidates":(t,e,a)=>({phase:"extract-candidates",extractCount:_(t,e,a)}),"wrapper-candidates":(t,e,a)=>({phase:"wrapper-candidates",wrappers:I(t,e,a)}),"passthrough-candidates":(t,e,a)=>({phase:"passthrough-candidates",passthroughs:$(t,e,a)}),"stale-abstractions":(t,e,a)=>({phase:"stale-abstractions",stale:z(t,e,a)}),drift:(t,e,a)=>({phase:"drift",drift:k(t,e,a)}),"complexity-hotspots":(t,e,a)=>({phase:"complexity-hotspots",complexity:N(t,e,a)})};function Ht(t,e={}){return E(t,e.full===!0,(a,r)=>{let i=F(t,e.scope,a,r);return v(i)})}function yt(t,e,a={}){return E(t,a.full===!0,(r,i)=>q[e](t,a.scope,i,r))}function E(t,e,a){let r=f(t),i=K(r,e);try{return a(r,i)}finally{m(t,{semanticProvider:!0}),h()}}function Ct(t){let e=o(t,"overview"),a={statsResult:e.statsResult,warnings:e.warnings,dead:o(t,"dead").dead,isolated:o(t,"isolated").isolated,realCycleCount:o(t,"cycles").realCycleCount,similarCount:o(t,"similar").similarCount,extractCount:o(t,"extract-candidates").extractCount,wrappers:o(t,"wrapper-candidates").wrappers,passthroughs:o(t,"passthrough-candidates").passthroughs,stale:o(t,"stale-abstractions").stale,drift:o(t,"drift").drift,complexity:o(t,"complexity-hotspots").complexity};return v(a)}function o(t,e){let a=t.find(r=>r.phase===e);if(!a)throw new Error(`Missing health phase result: ${e}`);return a}function v(t){let e=Q(t);return{score:J(t),overview:{documents:t.statsResult.documents,symbols:t.statsResult.symbols,indexSizeBytes:t.statsResult.indexSizeBytes},findings:{deadSymbols:t.dead.count,deadLoc:t.dead.loc,isolatedSymbols:t.isolated.count,isolatedLoc:t.isolated.loc,cycles:t.realCycleCount,similarPairs:t.similarCount,extractionCandidates:t.extractCount,wrappers:t.wrappers.count,passthroughs:t.passthroughs.count,staleTypes:t.stale.count,driftedFiles:t.drift.count,complexityHotspotCount:t.complexity.extremeCount},actions:e,topComplexity:t.complexity.top,warnings:t.warnings.length>0?t.warnings:void 0}}function F(t,e,a,r){let i=G(t,e,r),n=Y(t,e,r),c=X(t,e,r);return{statsResult:a,warnings:r.warnings,...i,...n,...c}}function G(t,e,a){return{dead:D(t,e,a),isolated:T(t,e,a),realCycleCount:B(t,e,a)}}function Y(t,e,a){return{similarCount:M(t,e,a),extractCount:_(t,e,a),wrappers:I(t,e,a),passthroughs:$(t,e,a),stale:z(t,e,a)}}function X(t,e,a){return{drift:k(t,e,a),complexity:N(t,e,a)}}function D(t,e,a){return s(t,a,"dead",()=>{let r=g(t,{scope:e,minLoc:3,skipBarrels:!0});return u(et(t,r.symbols))})}function T(t,e,a){return s(t,a,"isolated",()=>{let r=y(t,{scope:e,minLoc:3});return u(at(t,r))})}function B(t,e,a){return s(t,a,"cycles",()=>H(t,{scope:e}).filter(i=>i.kind==="real").length)}function M(t,e,a){return s(t,a,"similar",()=>C(t,{scope:e,minSimilarity:.6,limit:50,minCallees:4,scanLimit:a.candidateScanLimit}).length)}function _(t,e,a){return s(t,a,"extract-candidates",()=>S(t,{scope:e,minLoc:15,minCallees:5,limit:50,scanLimit:a.candidateScanLimit}).length)}function I(t,e,a){return s(t,a,"wrapper-candidates",()=>u(w(t,{scope:e,maxLoc:15,limit:50,scanLimit:a.candidateScanLimit})))}function $(t,e,a){return s(t,a,"passthrough-candidates",()=>u(b(t,{scope:e,maxLoc:15,limit:50,scanLimit:a.candidateScanLimit})))}function z(t,e,a){return s(t,a,"stale-abstractions",()=>{let r=R(t,{scope:e,minLoc:3,limit:50,scanLimit:a.candidateScanLimit}),i=r.filter(n=>n.consumers===0).length;return{count:r.length,loc:r.reduce((n,c)=>n+c.loc,0),unused:i,singleUse:r.length-i}})}function k(t,e,a){return s(t,a,"drift",()=>{let r=x(t,{scope:e});return{count:r.unusedImports+r.layerViolations,unusedImports:r.unusedImports,layerViolations:r.layerViolations}})}function N(t,e,a){return s(t,a,"complexity-hotspots",()=>{let r=P(t,{scope:e,minLoc:10,limit:10,scanLimit:a.candidateScanLimit});return{top:r.slice(0,5).map(i=>({symbol:i.shortName,score:i.score})),extremeCount:r.filter(i=>i.score>O).length}})}function Q(t){let e=[];if(t.dead.count>0&&e.push({category:"Dead code",description:`${t.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:t.dead.count,locRecoverable:t.dead.loc}),t.isolated.count>0&&e.push({category:"Isolated symbols",description:`${t.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:t.isolated.count,locRecoverable:t.isolated.loc}),t.realCycleCount>0&&e.push({category:"Circular dependencies",description:`${t.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:t.realCycleCount,locRecoverable:0}),t.similarCount>0&&e.push({category:"Similar functions",description:`${t.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:t.similarCount,locRecoverable:0}),t.extractCount>0&&e.push({category:"Extraction candidates",description:`${t.extractCount} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:t.extractCount,locRecoverable:0}),t.wrappers.count>0&&e.push({category:"Wrapper functions",description:`${t.wrappers.count} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:t.wrappers.count,locRecoverable:t.wrappers.loc}),t.passthroughs.count>0&&e.push({category:"Passthrough functions",description:`${t.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:t.passthroughs.count,locRecoverable:t.passthroughs.loc}),t.stale.count>0){let i=[];t.stale.unused>0&&i.push(`${t.stale.unused} unused`),t.stale.singleUse>0&&i.push(`${t.stale.singleUse} single-consumer (not in types file)`),e.push({category:"Stale abstractions",description:`${i.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:t.stale.count,locRecoverable:t.stale.loc})}if(t.drift.count>0){let i=[];t.drift.unusedImports>0&&i.push(`${t.drift.unusedImports} unused imports`),t.drift.layerViolations>0&&i.push(`${t.drift.layerViolations} layer violations`),e.push({category:"Structural drift",description:i.join(", "),effort:t.drift.layerViolations>0?"medium":"low",impact:t.drift.layerViolations>0?"medium":"low",count:t.drift.count,locRecoverable:0})}let a={high:3,medium:2,low:1},r={low:3,medium:2,high:1};return e.sort((i,n)=>{let c=a[i.impact]*r[i.effort];return a[n.impact]*r[n.effort]-c}),e}function J(t){let e=Math.max(t.statsResult.documents,1),a=Math.max(t.statsResult.symbols,1),r=100,i=t.dead.count/a;r-=Math.min(20,Math.round(i*200));let n=t.isolated.count/a;r-=Math.min(10,Math.round(n*200)),r-=Math.min(15,t.realCycleCount*5);let c=t.similarCount/a*1e3;r-=Math.min(10,Math.round(c));let p=t.extractCount/a*1e3;r-=Math.min(5,Math.round(p/2)),r-=Math.min(3,t.wrappers.count),r-=Math.min(3,t.passthroughs.count);let U=t.stale.count/Math.max(a*.1,1);r-=Math.min(8,Math.round(U*10));let V=t.drift.count/e;return r-=Math.min(5,Math.round(V*50)),r-=Math.min(5,t.complexity.extremeCount*2),Math.max(0,Math.min(100,r))}function K(t,e){return t.symbols>=j||t.documents>=W?e?{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:["Large index detected; running unbounded health analyses because --full was supplied."]}:{candidateScanLimit:A,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${A} symbols. Run "scip-query health --full" for unbounded candidate counts.`]}:{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:[]}}function Z(t,e){e.releaseCachesBetweenPhases&&(L(t),m(t),h())}function s(t,e,a,r){tt(a);try{return r()}finally{Z(t,e)}}function tt(t){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${t}`)}function et(t,e){return e.filter(a=>!l(t,a.relativePath)&&!d(t,a.symbol,a.relativePath)&&a.kind==="dead-code")}function at(t,e){return e.filter(a=>!l(t,a.relativePath)&&!d(t,a.symbol,a.relativePath))}function u(t){return{count:t.length,loc:t.reduce((e,a)=>e+a.loc,0)}}export{gt as a,Ht as b,yt as c,Ct as d};
2
- //# sourceMappingURL=chunk-TX7BHRMT.js.map
@@ -1,5 +0,0 @@
1
- import{a as l}from"./chunk-KYGNCIJ6.js";import{readdirSync as x}from"fs";import{extname as p,join as g}from"path";var f=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],S=new Set(f.map(e=>e.toLowerCase())),m=[...S].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function C(e,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,t=o.extensions?.map(c=>c.toLowerCase()),r=t?new Set(t):S,a=t?[...r].sort().join(","):m,n=`${s?"1":"0"}|${i?"1":"0"}|${a}`;return h.get(e,n,()=>{let c=new Set;if(s){let u=e.all(`SELECT relative_path
2
- FROM documents
3
- WHERE 1 = 1
4
- ${e.pathExclusionsFor("documents")}`);for(let d of u)e.isIgnored(d.relative_path)||r.has(p(d.relative_path).toLowerCase())&&c.add(d.relative_path)}if(i)for(let u of y(e.config.projectRoot,r))e.isIgnored(u)||c.add(u);return[...c].sort()})}var h=l("source-files");function y(e,o){let s=new Set,i=t=>{let r=t?g(e,t):e,a;try{a=x(r,{withFileTypes:!0})}catch{return}for(let n of a)if(!E.has(n.name)){if(n.isDirectory()){i(t?`${t}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(t?`${t}/${n.name}`:n.name)}};return i(""),s}export{w as a,E as b,C as c};
5
- //# sourceMappingURL=chunk-WPY46NIL.js.map
@@ -1,2 +0,0 @@
1
- import{j as g}from"./chunk-GS55K4WJ.js";import{a as m}from"./chunk-QYWGC7JV.js";import{q as r}from"./chunk-KYGNCIJ6.js";function w(i,f,p){let s=m(i,f),n=m(i,p);if(!s||!n)return null;let c=new Set(g(i,s).map(e=>e.symbol)),h=new Set(g(i,n).map(e=>e.symbol)),l=[];for(let e of c)h.has(e)&&l.push(e);let o=[];for(let e of c)h.has(e)||o.push(e);let a=[];for(let e of h)c.has(e)||a.push(e);let u=new Set([...c,...h]),d=u.size>0?l.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let y=s.endLine-s.startLine+1,b=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:r(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:b},similarity:d,sharedCallees:l.map(r),uniqueToA:o.map(r),uniqueToB:a.map(r),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-X3Z4KZNX.js.map