scip-query 0.10.1 → 0.10.2

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 (273) hide show
  1. package/README.md +2 -2
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-24PFLKFK.js → chunk-3KLLFNT4.js} +2 -2
  4. package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
  5. package/dist/chunk-3UW7VM4H.js +62 -0
  6. package/dist/chunk-3ZYF3ELZ.js +2 -0
  7. package/dist/{chunk-6YKJSETN.js → chunk-47UA45TU.js} +2 -2
  8. package/dist/{chunk-5VB3WU7K.js → chunk-4ZUJJRWT.js} +2 -2
  9. package/dist/chunk-5B53WB6E.js +4 -0
  10. package/dist/{chunk-LWPEZ4FP.js → chunk-5FOPAXWY.js} +2 -2
  11. package/dist/{chunk-CCB45WDY.js → chunk-5M4TYWVI.js} +2 -2
  12. package/dist/{chunk-PV4CEDIL.js → chunk-5QJXH6ZL.js} +5 -5
  13. package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
  14. package/dist/{chunk-LWWZBABT.js → chunk-77YBOOYT.js} +2 -2
  15. package/dist/chunk-7KCSELEV.js +2 -0
  16. package/dist/{chunk-GZXXBDJA.js → chunk-7OHWPJ5N.js} +2 -2
  17. package/dist/{chunk-BJ7OHKB5.js → chunk-7S5E7KWT.js} +1 -1
  18. package/dist/chunk-A3VNUGKJ.js +2 -0
  19. package/dist/{chunk-CMGOXDVP.js → chunk-A4L36SZS.js} +2 -2
  20. package/dist/{chunk-5D3BT4B4.js → chunk-AUVBR62P.js} +2 -2
  21. package/dist/chunk-AW4N6MGC.js +18 -0
  22. package/dist/{chunk-65UWNXEH.js → chunk-B6MJ5VQV.js} +2 -2
  23. package/dist/chunk-BKDXBJDQ.js +2 -0
  24. package/dist/{chunk-WZVTADY7.js → chunk-C2QSK7E7.js} +1 -1
  25. package/dist/chunk-C3MZZ2ZN.js +2 -0
  26. package/dist/{chunk-GTNPPGZJ.js → chunk-CAWSSEVM.js} +2 -2
  27. package/dist/chunk-CFL2CNIF.js +10 -0
  28. package/dist/{chunk-E55WCTLH.js → chunk-CJJP64OC.js} +2 -2
  29. package/dist/chunk-CNTEQMHA.js +2 -0
  30. package/dist/{chunk-ADKQX2OY.js → chunk-CRU42NJU.js} +2 -2
  31. package/dist/chunk-CSWZFD46.js +2 -0
  32. package/dist/{chunk-QOFKVNFE.js → chunk-CTCAF3YA.js} +2 -2
  33. package/dist/{chunk-YVQUQIBM.js → chunk-D322LMSA.js} +2 -2
  34. package/dist/{chunk-IJYWCB57.js → chunk-DAI74TJU.js} +2 -2
  35. package/dist/chunk-DE7MA6OD.js +3 -0
  36. package/dist/chunk-DJMK4DBL.js +2 -0
  37. package/dist/chunk-DRAZH77R.js +7 -0
  38. package/dist/{chunk-FVX4GEAC.js → chunk-E44ZMVNA.js} +2 -2
  39. package/dist/{chunk-MESUJJVQ.js → chunk-E7KERP7E.js} +2 -2
  40. package/dist/{chunk-YIE5FZAF.js → chunk-EOZIZWW4.js} +2 -2
  41. package/dist/{chunk-XGGTESMN.js → chunk-ERHOS6AW.js} +2 -2
  42. package/dist/{chunk-5HDYAOSF.js → chunk-ESG4HBEF.js} +2 -2
  43. package/dist/{chunk-HCQ7J2N5.js → chunk-EWC3UK4V.js} +3 -3
  44. package/dist/chunk-FGCL6NDB.js +8 -0
  45. package/dist/chunk-FIB4JPEX.js +2 -0
  46. package/dist/chunk-FNRPGGVI.js +2 -0
  47. package/dist/{chunk-QUKZ77A6.js → chunk-FOQHUKNZ.js} +2 -2
  48. package/dist/chunk-FPMVCDIJ.js +2 -0
  49. package/dist/{chunk-QH5GTVVB.js → chunk-FUPDW5AC.js} +2 -2
  50. package/dist/{chunk-B3HMRQDA.js → chunk-G3WGZU5Q.js} +2 -2
  51. package/dist/{chunk-TUAPDKBI.js → chunk-GS33KGAY.js} +2 -2
  52. package/dist/{chunk-623UQCVG.js → chunk-GZCQTZLK.js} +2 -2
  53. package/dist/{chunk-SA6B3EGD.js → chunk-HVTYSC26.js} +2 -2
  54. package/dist/{chunk-R7S3UCDR.js → chunk-ICXVNWMI.js} +2 -2
  55. package/dist/chunk-JM72FNGA.js +2 -0
  56. package/dist/{chunk-DRU74YUM.js → chunk-KPHKX4LP.js} +1 -1
  57. package/dist/{chunk-YYCQQBMG.js → chunk-LPLGJ4HO.js} +2 -2
  58. package/dist/chunk-MHK7Z53U.js +2 -0
  59. package/dist/chunk-MHTDOFV7.js +5 -0
  60. package/dist/chunk-MUULWXSJ.js +2 -0
  61. package/dist/chunk-MZ7APUFN.js +3 -0
  62. package/dist/{chunk-LYS4SMAQ.js → chunk-NNDYO2DX.js} +2 -2
  63. package/dist/{chunk-ATGRITZP.js → chunk-NP5HYVLX.js} +4 -4
  64. package/dist/{chunk-MHAQXOZY.js → chunk-NVFERV4U.js} +2 -2
  65. package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
  66. package/dist/chunk-O3OKSF6O.js +2 -0
  67. package/dist/chunk-O4L4AB3T.js +2 -0
  68. package/dist/{chunk-TMS4JPWY.js → chunk-OBBDKQAG.js} +2 -2
  69. package/dist/chunk-OLD6PBU6.js +7 -0
  70. package/dist/{chunk-5BZOSICN.js → chunk-PFOCOG57.js} +1 -1
  71. package/dist/{chunk-CFLYMEUS.js → chunk-PVZMPG5I.js} +1 -1
  72. package/dist/{chunk-T67R7V5I.js → chunk-QLNGUWR7.js} +2 -2
  73. package/dist/chunk-QSXQT3NE.js +2 -0
  74. package/dist/{chunk-6TWFT4Y5.js → chunk-QVCCLDZI.js} +2 -2
  75. package/dist/{chunk-PNN3D4BE.js → chunk-RHTJBYZ5.js} +2 -2
  76. package/dist/chunk-SPE4YCOT.js +7 -0
  77. package/dist/{chunk-4N7LFYSD.js → chunk-TM6GVHA6.js} +2 -2
  78. package/dist/chunk-TO54DY4O.js +2 -0
  79. package/dist/{chunk-HQHFMPLJ.js → chunk-UMNENNTX.js} +2 -2
  80. package/dist/chunk-UNJG7P2I.js +2 -0
  81. package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
  82. package/dist/chunk-VAA5FFIW.js +2 -0
  83. package/dist/chunk-WDUTG2ZR.js +4 -0
  84. package/dist/chunk-X7ZY6FFF.js +4 -0
  85. package/dist/{chunk-RNLUCQJB.js → chunk-YQH353VA.js} +2 -2
  86. package/dist/{chunk-44JOJLMO.js → chunk-YTR4CO5S.js} +2 -2
  87. package/dist/chunk-YUOAAR24.js +2 -0
  88. package/dist/{chunk-ADTG377O.js → chunk-YYD245WG.js} +2 -2
  89. package/dist/{chunk-I6PTB2CM.js → chunk-Z4VHYJ5U.js} +2 -2
  90. package/dist/chunk-ZFMPHDAT.js +4 -0
  91. package/dist/chunk-ZQLO2SCU.js +6 -0
  92. package/dist/chunk-ZSLT7NWQ.js +61 -0
  93. package/dist/cli.js +242 -225
  94. package/dist/{config-types-Bok4jrO3.d.ts → config-types-Bj4sh28g.d.ts} +8 -0
  95. package/dist/{db-BkFlkzI3.d.ts → db-CTarohbZ.d.ts} +1 -1
  96. package/dist/git-history-Dao3_Pu9.d.ts +12 -0
  97. package/dist/{health-CbGMdRPg.d.ts → health-Bx0x1HAG.d.ts} +23 -2
  98. package/dist/index.d.ts +3 -3
  99. package/dist/index.js +1 -1
  100. package/dist/postinstall.js +1 -1
  101. package/dist/queries/affected.d.ts +2 -2
  102. package/dist/queries/affected.js +1 -1
  103. package/dist/queries/bottlenecks.d.ts +6 -2
  104. package/dist/queries/bottlenecks.js +1 -1
  105. package/dist/queries/by-kind.d.ts +2 -2
  106. package/dist/queries/by-kind.js +1 -1
  107. package/dist/queries/call-graph.d.ts +2 -2
  108. package/dist/queries/call-graph.js +1 -1
  109. package/dist/queries/change-surface.d.ts +2 -2
  110. package/dist/queries/change-surface.js +1 -1
  111. package/dist/queries/cleanup-plan.d.ts +2 -2
  112. package/dist/queries/cleanup-plan.js +1 -1
  113. package/dist/queries/co-change.d.ts +37 -3
  114. package/dist/queries/co-change.js +1 -1
  115. package/dist/queries/code.d.ts +2 -2
  116. package/dist/queries/code.js +1 -1
  117. package/dist/queries/complexity-hotspots.d.ts +2 -2
  118. package/dist/queries/complexity-hotspots.js +1 -1
  119. package/dist/queries/complexity.d.ts +2 -2
  120. package/dist/queries/complexity.js +1 -1
  121. package/dist/queries/convergence.d.ts +2 -2
  122. package/dist/queries/convergence.js +1 -1
  123. package/dist/queries/coupling.d.ts +6 -2
  124. package/dist/queries/coupling.js +1 -1
  125. package/dist/queries/cycles.d.ts +2 -2
  126. package/dist/queries/cycles.js +1 -1
  127. package/dist/queries/dataflow.d.ts +2 -2
  128. package/dist/queries/dataflow.js +1 -1
  129. package/dist/queries/dead.d.ts +10 -3
  130. package/dist/queries/dead.js +1 -1
  131. package/dist/queries/deep-chains.d.ts +6 -2
  132. package/dist/queries/deep-chains.js +1 -1
  133. package/dist/queries/deps.d.ts +2 -2
  134. package/dist/queries/deps.js +1 -1
  135. package/dist/queries/diff-gate.d.ts +48 -3
  136. package/dist/queries/diff-gate.js +1 -1
  137. package/dist/queries/diff-impact.d.ts +2 -2
  138. package/dist/queries/diff-impact.js +1 -1
  139. package/dist/queries/doc-drift.d.ts +20 -3
  140. package/dist/queries/doc-drift.js +1 -1
  141. package/dist/queries/drift.d.ts +10 -3
  142. package/dist/queries/drift.js +1 -1
  143. package/dist/queries/extract-candidates.d.ts +11 -3
  144. package/dist/queries/extract-candidates.js +1 -1
  145. package/dist/queries/fan.d.ts +2 -2
  146. package/dist/queries/fan.js +1 -1
  147. package/dist/queries/files.d.ts +2 -2
  148. package/dist/queries/files.js +1 -1
  149. package/dist/queries/health.d.ts +3 -3
  150. package/dist/queries/health.js +1 -1
  151. package/dist/queries/hierarchy.d.ts +2 -2
  152. package/dist/queries/hierarchy.js +1 -1
  153. package/dist/queries/hotspots.d.ts +2 -2
  154. package/dist/queries/hotspots.js +1 -1
  155. package/dist/queries/imports.d.ts +2 -2
  156. package/dist/queries/imports.js +1 -1
  157. package/dist/queries/incomplete-migration.d.ts +14 -3
  158. package/dist/queries/incomplete-migration.js +1 -1
  159. package/dist/queries/index.d.ts +17 -15
  160. package/dist/queries/index.js +1 -1
  161. package/dist/queries/isolated.d.ts +2 -2
  162. package/dist/queries/isolated.js +1 -1
  163. package/dist/queries/locality-candidates.d.ts +51 -0
  164. package/dist/queries/locality-candidates.js +2 -0
  165. package/dist/queries/members.d.ts +2 -2
  166. package/dist/queries/members.js +1 -1
  167. package/dist/queries/methods.d.ts +2 -2
  168. package/dist/queries/methods.js +1 -1
  169. package/dist/queries/outline.d.ts +2 -2
  170. package/dist/queries/outline.js +1 -1
  171. package/dist/queries/passthrough-candidates.d.ts +8 -3
  172. package/dist/queries/passthrough-candidates.js +1 -1
  173. package/dist/queries/plan-context.d.ts +4 -2
  174. package/dist/queries/plan-context.js +1 -1
  175. package/dist/queries/react-component-duplicates.d.ts +2 -2
  176. package/dist/queries/react-component-duplicates.js +1 -1
  177. package/dist/queries/react-hook-candidates.d.ts +9 -3
  178. package/dist/queries/react-hook-candidates.js +1 -1
  179. package/dist/queries/react-large-component-pressure.d.ts +9 -3
  180. package/dist/queries/react-large-component-pressure.js +1 -1
  181. package/dist/queries/recent-duplicates.d.ts +25 -3
  182. package/dist/queries/recent-duplicates.js +1 -1
  183. package/dist/queries/redundant-reexports.d.ts +7 -3
  184. package/dist/queries/redundant-reexports.js +1 -1
  185. package/dist/queries/refs.d.ts +2 -2
  186. package/dist/queries/refs.js +1 -1
  187. package/dist/queries/self-audit.d.ts +2 -2
  188. package/dist/queries/self-audit.js +1 -1
  189. package/dist/queries/similar-chains.d.ts +2 -2
  190. package/dist/queries/similar-chains.js +1 -1
  191. package/dist/queries/similar-files.d.ts +2 -2
  192. package/dist/queries/similar-files.js +1 -1
  193. package/dist/queries/similar-signatures.d.ts +2 -2
  194. package/dist/queries/similar-signatures.js +1 -1
  195. package/dist/queries/similar.d.ts +16 -3
  196. package/dist/queries/similar.js +1 -1
  197. package/dist/queries/slice.d.ts +2 -2
  198. package/dist/queries/slice.js +1 -1
  199. package/dist/queries/stale-abstractions.d.ts +10 -3
  200. package/dist/queries/stale-abstractions.js +1 -1
  201. package/dist/queries/stats.d.ts +2 -2
  202. package/dist/queries/stats.js +1 -1
  203. package/dist/queries/surface.d.ts +2 -2
  204. package/dist/queries/surface.js +1 -1
  205. package/dist/queries/symbols.d.ts +2 -2
  206. package/dist/queries/symbols.js +1 -1
  207. package/dist/queries/system.d.ts +2 -2
  208. package/dist/queries/system.js +1 -1
  209. package/dist/queries/trace.d.ts +2 -2
  210. package/dist/queries/trace.js +1 -1
  211. package/dist/queries/unused-imports.d.ts +4 -0
  212. package/dist/queries/unused-imports.js +2 -0
  213. package/dist/queries/unused-params.d.ts +2 -2
  214. package/dist/queries/unused-params.js +1 -1
  215. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  216. package/dist/queries/vue-component-duplicates.js +1 -1
  217. package/dist/queries/vue-composable-candidates.d.ts +9 -3
  218. package/dist/queries/vue-composable-candidates.js +1 -1
  219. package/dist/queries/vue-large-view-pressure.d.ts +9 -3
  220. package/dist/queries/vue-large-view-pressure.js +1 -1
  221. package/dist/queries/wrapper-candidates.d.ts +6 -3
  222. package/dist/queries/wrapper-candidates.js +1 -1
  223. package/dist/reindex-worker.js +1 -1
  224. package/dist/reindex.d.ts +1 -1
  225. package/dist/reindex.js +1 -1
  226. package/dist/runtime.d.ts +1 -1
  227. package/dist/runtime.js +2 -2
  228. package/docs/COMMAND_REFERENCE.md +3 -2
  229. package/docs/analyzer-inventory.md +162 -0
  230. package/docs/analyzer-validation-ledger.md +262 -0
  231. package/docs/analyzer-validation-protocol.md +192 -0
  232. package/docs/locality-analyzer-design.md +193 -0
  233. package/package.json +14 -3
  234. package/skills/scip-directory-architecture/SKILL.md +178 -0
  235. package/skills/scip-maintainability/SKILL.md +1 -1
  236. package/skills/scip-query/SKILL.md +2 -1
  237. package/skills/scip-query-setup/SKILL.md +118 -0
  238. package/skills/scip-react-maintainability/SKILL.md +1 -1
  239. package/skills/scip-vue-maintainability/SKILL.md +1 -1
  240. package/dist/chunk-23FVN4Y5.js +0 -2
  241. package/dist/chunk-27KPKLRJ.js +0 -7
  242. package/dist/chunk-2NLK4INB.js +0 -2
  243. package/dist/chunk-2XKAMW6B.js +0 -61
  244. package/dist/chunk-332L7SRO.js +0 -2
  245. package/dist/chunk-4EAANIWC.js +0 -2
  246. package/dist/chunk-5ALI77D7.js +0 -3
  247. package/dist/chunk-5IDEQEM4.js +0 -4
  248. package/dist/chunk-62NMBOA5.js +0 -2
  249. package/dist/chunk-64LH2QUP.js +0 -62
  250. package/dist/chunk-6U4EODW3.js +0 -2
  251. package/dist/chunk-A2GVUCZR.js +0 -8
  252. package/dist/chunk-DBIG4QAJ.js +0 -2
  253. package/dist/chunk-DMLPJ75B.js +0 -2
  254. package/dist/chunk-DTERBKUE.js +0 -7
  255. package/dist/chunk-F4PKYBQB.js +0 -2
  256. package/dist/chunk-JTRY2YRJ.js +0 -2
  257. package/dist/chunk-L77GXANO.js +0 -6
  258. package/dist/chunk-LT6GJ27X.js +0 -10
  259. package/dist/chunk-LUBKUISI.js +0 -2
  260. package/dist/chunk-LVYXX7ZW.js +0 -2
  261. package/dist/chunk-LXM7AHQG.js +0 -4
  262. package/dist/chunk-LY6NRJPJ.js +0 -2
  263. package/dist/chunk-N2T2GPYQ.js +0 -2
  264. package/dist/chunk-OB6PEVI3.js +0 -2
  265. package/dist/chunk-R42LZMLX.js +0 -2
  266. package/dist/chunk-RGDUIMNE.js +0 -3
  267. package/dist/chunk-RYBMW2EN.js +0 -2
  268. package/dist/chunk-TTGWDUJ4.js +0 -5
  269. package/dist/chunk-UVK3SL4Z.js +0 -2
  270. package/dist/chunk-W3PQRAI4.js +0 -2
  271. package/dist/chunk-WWFBDM5Y.js +0 -2
  272. package/dist/chunk-Y33GRQK6.js +0 -18
  273. package/dist/chunk-YISMWW66.js +0 -7
@@ -1,2 +1,2 @@
1
- import{b as h}from"./chunk-44JOJLMO.js";import{e as y,g as S,h as g,i as M,m as C}from"./chunk-SA6B3EGD.js";import{e as R}from"./chunk-QH5GTVVB.js";import{s as b}from"./chunk-64LH2QUP.js";import{d as m,f as p}from"./chunk-T67R7V5I.js";import{a as f}from"./chunk-HCQ7J2N5.js";import{a as u}from"./chunk-NN3O7TPH.js";function D(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=u(e,{includeIgnored:!1}),a=M(e),r=n??b(e),l=new Set(r.map(s=>s.symbolId));return k(e,o,i,a,l),I(e,o,r,l),x(e,o,i,a,l),t.semantic!==!1&&_(o,R(e,A(r))),o}function k(e,n,t,o,i){for(let a of t){if(!f(a))continue;let r=m(e,a);if(r)for(let l of r){let s=S(a,o.get(l.calleeLeaf)??[]);if(!s||s.length===0)continue;let c=g(e,a,s,l.memberAccess);c&&i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function I(e,n,t,o){let i=v(t);for(let a of L(e,o))e.isIgnored(a.relative_path)||w(a,i.get(a.symbol_id))||d(n,a.symbol_id,a.relative_path)}function L(e,n){return y(e,n?[...n]:void 0)}function v(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function w(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function x(e,n,t,o,i){for(let a of t){if(f(a)!=="rust")continue;let r=p(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:l}of r){let s=o.get(l);if(s)for(let c of s)i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function d(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function A(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function _(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function O(e,n,t={}){return h(e,n,t)}function F(e,n,t={}){return D(e,n,t)}function j(e,n){return C(e,n)}function Q(e,n,t={}){let o=F(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:V(o,j(e,n))}function V(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let r of i)a.add(r);t.set(o,a)}return t}export{O as a,F as b,j as c,Q as d};
2
- //# sourceMappingURL=chunk-623UQCVG.js.map
1
+ import{b as h}from"./chunk-YTR4CO5S.js";import{e as y,g as S,h as g,i as M,m as C}from"./chunk-HVTYSC26.js";import{e as R}from"./chunk-FUPDW5AC.js";import{g as b}from"./chunk-3UW7VM4H.js";import{d as m,f as p}from"./chunk-QLNGUWR7.js";import{a as f}from"./chunk-EWC3UK4V.js";import{a as u}from"./chunk-64MNV6AB.js";function D(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=u(e,{includeIgnored:!1}),a=M(e),r=n??b(e),l=new Set(r.map(s=>s.symbolId));return k(e,o,i,a,l),I(e,o,r,l),x(e,o,i,a,l),t.semantic!==!1&&_(o,R(e,A(r))),o}function k(e,n,t,o,i){for(let a of t){if(!f(a))continue;let r=m(e,a);if(r)for(let l of r){let s=S(a,o.get(l.calleeLeaf)??[]);if(!s||s.length===0)continue;let c=g(e,a,s,l.memberAccess);c&&i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function I(e,n,t,o){let i=v(t);for(let a of L(e,o))e.isIgnored(a.relative_path)||w(a,i.get(a.symbol_id))||d(n,a.symbol_id,a.relative_path)}function L(e,n){return y(e,n?[...n]:void 0)}function v(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function w(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function x(e,n,t,o,i){for(let a of t){if(f(a)!=="rust")continue;let r=p(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:l}of r){let s=o.get(l);if(s)for(let c of s)i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function d(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function A(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function _(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function O(e,n,t={}){return h(e,n,t)}function F(e,n,t={}){return D(e,n,t)}function j(e,n){return C(e,n)}function Q(e,n,t={}){let o=F(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:V(o,j(e,n))}function V(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let r of i)a.add(r);t.set(o,a)}return t}export{O as a,F as b,j as c,Q as d};
2
+ //# sourceMappingURL=chunk-GZCQTZLK.js.map
@@ -1,4 +1,4 @@
1
- import{d as C}from"./chunk-QH5GTVVB.js";import{c as _}from"./chunk-5ALI77D7.js";import{b as S}from"./chunk-QUKZ77A6.js";import{t as M}from"./chunk-ADKQX2OY.js";import{d as f,r as y,w as h}from"./chunk-64LH2QUP.js";import{a as b}from"./chunk-T67R7V5I.js";import{a as v}from"./chunk-HCQ7J2N5.js";import{a as m}from"./chunk-YVQUQIBM.js";import{c as I}from"./chunk-TMS4JPWY.js";import{c as g,d as D}from"./chunk-BJ7OHKB5.js";function R(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(L(e,r).get(n)??[]).filter(s=>!B(s,t)):[]}function B(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var G=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function w(e,r){let n=b(e,r);return n?n.fileIdentifiers:G.get(e,r,()=>new Set(L(e,r).keys()))}var H=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function L(e,r){let n=b(e,r);return n?n.identifierLineMap:H.get(e,r,()=>z(e,r))}var J=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ie(e,r){let n=b(e,r);return n?n.identifiersByLine:J.get(e,r,()=>{let t=L(e,r),i=0;for(let s of t.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of t)for(let a of c)o[a].add(s);return o})}function z(e,r){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=m(e,r);if(!i)return n;let o=M(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&t(l[1],c)}return n}function k(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return k(e)===k(r)}function O(e,r){let n=new Map;for(let t of S(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&F(n,i,t.sourcePath),t.kind==="namespace")for(let o of t.usedMembers)F(n,o,t.sourcePath)}return n}function F(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function le(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
1
+ import{d as C}from"./chunk-FUPDW5AC.js";import{c as _}from"./chunk-MZ7APUFN.js";import{b as S}from"./chunk-FOQHUKNZ.js";import{t as M}from"./chunk-CRU42NJU.js";import{f as y,k as h}from"./chunk-3UW7VM4H.js";import{d as f}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-QLNGUWR7.js";import{a as v}from"./chunk-EWC3UK4V.js";import{a as m}from"./chunk-D322LMSA.js";import{c as I}from"./chunk-OBBDKQAG.js";import{c as g,d as D}from"./chunk-7S5E7KWT.js";function R(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(L(e,r).get(n)??[]).filter(s=>!B(s,t)):[]}function B(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var G=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function w(e,r){let n=b(e,r);return n?n.fileIdentifiers:G.get(e,r,()=>new Set(L(e,r).keys()))}var H=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function L(e,r){let n=b(e,r);return n?n.identifierLineMap:H.get(e,r,()=>z(e,r))}var J=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ie(e,r){let n=b(e,r);return n?n.identifiersByLine:J.get(e,r,()=>{let t=L(e,r),i=0;for(let s of t.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of t)for(let a of c)o[a].add(s);return o})}function z(e,r){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=m(e,r);if(!i)return n;let o=M(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&t(l[1],c)}return n}function k(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return k(e)===k(r)}function O(e,r){let n=new Map;for(let t of S(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&F(n,i,t.sourcePath),t.kind==="namespace")for(let o of t.usedMembers)F(n,o,t.sourcePath)}return n}function F(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function le(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
2
  m.symbol_id,
3
3
  d.relative_path,
4
4
  COUNT(*) AS ref_count
@@ -37,4 +37,4 @@ import{d as C}from"./chunk-QH5GTVVB.js";import{c as _}from"./chunk-5ALI77D7.js";
37
37
  ) mention_doc ON mention_doc.symbol_id = gs.id
38
38
  WHERE 1 = 1
39
39
  ${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=f(t.symbol);if(!i)continue;let o=n.get(i);o||(o=[],n.set(i,o)),o.some(s=>s.symbolId===t.id)||o.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}function N(e,r,n){let t=x(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[p(t[0])];let i=t.filter(a=>a.file===r);if(i.length>0)return i.map(p);let o=O(e,r),s=o.get(n);if(s)for(let a of s){let l=t.filter(u=>d(a,u.file));if(l.length>0)return l.map(p)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(u=>d(a,u.file));if(l.length>0&&l.length===t.length)return l.map(p)}return[]}function Ce(e,r,n){let t=N(e,r,n);if(t.length>0)return t;let i=x(e).get(n);return!i||i.length===0?[]:i.map(p)}function $(e,r,n={}){let t=_(e,r);if(!t)return[];let i=f(t.symbol);if(!i)return[];if(n.semantic!==!1){let s=C(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return P(e,c)}}let o=new Map;for(let s of I(e)){let c=m(e,s);if(!c||c.indexOf(i)===-1||s!==t.relativePath&&!N(e,s,i).some(u=>u.symbolId===t.symbolId))continue;let a=R(e,s,i,s===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&o.set(s,a)}return P(e,o)}function we(e,r){let n=new Map;for(let o of r){if(!o.leaf)continue;let s=n.get(o.leaf)??[];s.push(o),n.set(o.leaf,s)}if(n.size===0)return new Map;let t=new Set(r.map(o=>o.symbolId)),i=new Map;for(let o of I(e)){let s=w(e,o);if(s.size!==0){for(let c of s)if(n.has(c))for(let a of N(e,o,c)){if(!t.has(a.symbolId)||o===a.relativePath)continue;let l=i.get(a.symbolId);l||(l=new Set,i.set(a.symbolId,l)),l.add(o)}}}return i}function p(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function P(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Y(e,r){let n=q(e,r);return n?K(e,Q(e,n.match,n.identifier)):[]}function je(e,r,n={}){return Z(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Z(e,r,n={}){let t=$(e,r,{semantic:n.semantic}),i=t.length>0?j(t,"source-attribution"):j(Y(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function j(e,r){return e.map(n=>({...n,provenance:r}))}function Q(e,r,n){let t=new Map;for(let[i,o]of U(e,r.symbolId))t.set(i,V(e,i,o,r,n));return t}function U(e,r){let n=new Map;for(let t of A(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function V(e,r,n,t,i){let o=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},s=i?R(e,r,i,o):[];return n.flatMap(c=>X(s,c))}function X(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function q(e,r){let n=_(e,r);return n?{match:n,identifier:f(n.symbol)||null}:null}function K(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}export{L as a,ie as b,le as c,fe as d,A as e,d as f,Se as g,ye as h,x as i,O as j,N as k,Ce as l,we as m,Y as n,je as o};
40
- //# sourceMappingURL=chunk-SA6B3EGD.js.map
40
+ //# sourceMappingURL=chunk-HVTYSC26.js.map
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-QOFKVNFE.js";import{u as o}from"./chunk-64LH2QUP.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
1
+ import{b as m}from"./chunk-CTCAF3YA.js";import{i as o}from"./chunk-3UW7VM4H.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
2
2
  WHERE relative_path IN (${d})
3
3
  ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=o(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
4
4
  FROM mentions m
@@ -32,4 +32,4 @@ import{b as m}from"./chunk-QOFKVNFE.js";import{u as o}from"./chunk-64LH2QUP.js";
32
32
  WHERE d2.relative_path IN (${d})
33
33
  AND d1.relative_path NOT IN (${d})
34
34
  ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{h as a};
35
- //# sourceMappingURL=chunk-R7S3UCDR.js.map
35
+ //# sourceMappingURL=chunk-ICXVNWMI.js.map
@@ -0,0 +1,2 @@
1
+ var d={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function l(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let s=t[0],i=t[1],r=e.slice(s.length+1+i.length+1),n;if(r.startsWith("`")){let f=r.indexOf("`",1);f===-1?(n=r.slice(1),r=""):(n=r.slice(1,f),r=r.slice(f+2))}else{let f=r.indexOf(" ");f===-1?(n=r,r=""):(n=r.slice(0,f),r=r.slice(f+1))}let o,c=r.indexOf(" ");c===-1?(o=r,r=""):(o=r.slice(0,c),r=r.slice(c+1));let a=m(r);return{scheme:s,manager:i,packageName:n,version:o,descriptors:a,raw:e}}function b(e){let t=l(e);if("kind"in t)return null;for(let s=t.descriptors.length-2;s>=0;s--){let i=t.descriptors[s];if(i?.suffix==="type")return i.name}return null}function m(e){let t=[],s=0;for(;s<e.length;){if(e[s]==="["){let n=e.indexOf("]",s+1);if(n===-1){t.push({name:e.slice(s+1),suffix:"type-param"});break}t.push({name:e.slice(s+1,n),suffix:"type-param"}),s=n+1;continue}if(e[s]==="("&&(t.length===0||s===0||u(e[s-1]))){let n=e.indexOf(")",s+1);if(n!==-1&&e[n+1]!=="."){t.push({name:e.slice(s+1,n),suffix:"parameter"}),s=n+1;continue}}let i;if(e[s]==="`"){let n=e.indexOf("`",s+1);if(n===-1){i=e.slice(s+1),t.push({name:i,suffix:"term"});break}i=e.slice(s+1,n),s=n+1}else{let n=s;for(;s<e.length&&!u(e[s]);)s++;i=e.slice(n,s)}if(s>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[s];if(r==="("){let n=e.indexOf(")",s+1);n!==-1&&e[n+1]==="."?(t.push({name:i,suffix:"method"}),s=n+2):n!==-1?(t.push({name:i,suffix:"method"}),s=n+1):(t.push({name:i,suffix:"term"}),s++)}else{let n=d[r];n&&t.push({name:i,suffix:n}),s+=1}}return t}function u(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function y(e){let t=l(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let s=t;if(s.descriptors.length===0)return s.raw;let i=[];for(let r of s.descriptors){let n=g(r);n&&i.push(n)}return i.join(":")}function g(e){let t=e.suffix==="namespace"?x(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function x(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function k(e){let t=l(e);if("kind"in t&&t.kind==="local")return t.id;let s=t;return s.descriptors.length===0?"":s.descriptors[s.descriptors.length-1].name}function p(e){let t=l(e);if("kind"in t&&t.kind==="local")return null;let s=t;return s.descriptors[s.descriptors.length-1]?.suffix??null}function D(e){return e.endsWith("().")||p(e)==="method"}function $(e){let t=p(e);return t==="method"||t==="term"}function T(e){return p(e)==="namespace"}var h=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function M(e){return h.test(e)}var S=new Set(["test","tests","_tests"]);function O(e){let t=l(e);if("kind"in t)return!1;for(let s=0;s<t.descriptors.length-1;s+=1){let i=t.descriptors[s];if(i?.suffix==="namespace"&&i.name&&S.has(i.name))return!0}return!1}function j(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}function I(e,t){let s=l(e),i=l(t);if("kind"in s||"kind"in i)return!1;let r=s.descriptors,n=i.descriptors;if(n.length<=r.length)return!1;for(let o=0;o<r.length;o++){let c=r[o],a=n[o];if(c.name!==a.name||c.suffix!==a.suffix)return!1}return!0}export{l as a,b,y as c,k as d,p as e,D as f,$ as g,T as h,M as i,O as j,j as k,I as l};
2
+ //# sourceMappingURL=chunk-JM72FNGA.js.map
@@ -68,4 +68,4 @@ Thumbs.db
68
68
  JOIN documents d ON d.id = der.document_id
69
69
  ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
70
70
  `).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function Ee(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function j(e,t){let r=Pe(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=Ne(n,r,t,o);return i.set(o,s),s}}}function _(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*M(e){let t=/\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"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function G(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function we(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function $(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Ce(e,t).replaceAll("\\","/")}function Oe(e){switch(Ve(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 W(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:Ae(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:we}}function Ae(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Pe(e){try{let t=JSON.parse(v(A(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Ne(e,t,r,n){let i=f(r,n),o=je(t.name,t.version,i);return e.get(o)?.id??null}function je(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function Kt(e){let t=Me(e.projectRoot,e.tsconfig),r=new _e(e.dbPath,{readonly:!0});try{let n=Ge({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:j(r,e.projectRoot)});return $e({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function Ge(e){let t=W();return{projectRoot:e.projectRoot,context:P(e.projectRoot,e.configPath),symbolLookup:N(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function $e(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=We(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function We(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[...M(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Ke(a),processedStarts:new Set};return He({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function He(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=G(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!$(e.projectRoot,u.fileName));if(!s){r++;continue}let a=_(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}H(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),Ue(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function Ue(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of Be(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(H(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function H(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function Ke(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function Be(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=Je(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function Je(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{St as a,Ct as b,Kt as c};
71
- //# sourceMappingURL=chunk-DRU74YUM.js.map
71
+ //# sourceMappingURL=chunk-KPHKX4LP.js.map
@@ -1,6 +1,6 @@
1
- import{a as m}from"./chunk-QOFKVNFE.js";import{a as h}from"./chunk-5ALI77D7.js";import{c as p}from"./chunk-64LH2QUP.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
1
+ import{a as m}from"./chunk-CTCAF3YA.js";import{a as h}from"./chunk-MZ7APUFN.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
2
2
  `),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
3
3
  `);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
4
4
  `),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
- //# sourceMappingURL=chunk-YYCQQBMG.js.map
6
+ //# sourceMappingURL=chunk-LPLGJ4HO.js.map
@@ -0,0 +1,2 @@
1
+ import{a as I}from"./chunk-ICXVNWMI.js";import{a as H}from"./chunk-X7ZY6FFF.js";import{a as p}from"./chunk-FIB4JPEX.js";import{a as T}from"./chunk-YQH353VA.js";import{a as G}from"./chunk-3KLLFNT4.js";import{a as k}from"./chunk-EOZIZWW4.js";import{a as v,b as F}from"./chunk-4ZUJJRWT.js";import{b as A}from"./chunk-CNTEQMHA.js";import{b as P}from"./chunk-DRAZH77R.js";import{a as j}from"./chunk-ESG4HBEF.js";import{a as S}from"./chunk-CFL2CNIF.js";import{a as D}from"./chunk-Z4VHYJ5U.js";import{a as w}from"./chunk-TM6GVHA6.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?D(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?S(t,e,{maxDepth:o,scope:n.scope}):[],i=w(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=P(t);if(!o)return n;let r=A(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
+ //# sourceMappingURL=chunk-MHK7Z53U.js.map
@@ -0,0 +1,5 @@
1
+ import{a as F,b as w,e as N,f as O}from"./chunk-3UVJJ6Z7.js";import{b as M}from"./chunk-B75HZHUP.js";import{a as R}from"./chunk-3ZYF3ELZ.js";import{a as I}from"./chunk-YTR4CO5S.js";import{a as T}from"./chunk-MZ7APUFN.js";import{c as d,d as E,g as A}from"./chunk-JM72FNGA.js";import{b as B}from"./chunk-D322LMSA.js";import{d as D}from"./chunk-7S5E7KWT.js";function Fe(e,i,n={}){let{minSimilarity:t=.4,limit:r=20}=n,l=ne(e,i,{semantic:n.semantic!==!1});if(!l)return[];if(!A(l.symbol))return[];let a=J(e,l,t,{scanLimit:n.scanLimit,semantic:n.semantic!==!1});return a.length>0?a.slice(0,r):ae(e,i,{minSimilarity:t,limit:r})}function J(e,i,n,t){let r=G(e,{minCallees:3,excludeSymbol:i.symbol,scanLimit:t.scanLimit,semantic:t.semantic}),l=N([i,...r].map(c=>c.callees)),a=[];for(let c of r){if(c.callees.size<3)continue;let s=j(i,c,l,{minSimilarity:n,requireSignificantShared:1,requireSharedCount:0});s&&a.push(s)}return a.sort((c,s)=>s.similarity-c.similarity),a}function j(e,i,n,t){let{similarity:r,significantShared:l}=O(e.callees,i.callees,n);if(r<t.minSimilarity)return null;let a=F(e.callees,i.callees).size;if(l.length<t.requireSignificantShared&&a<t.requireSharedCount)return null;let c=l.length>0?l:[...F(e.callees,i.callees)],s=K(c,"callees");return{symbolA:e.symbol,shortNameA:d(e.symbol),fileA:e.file,symbolB:i.symbol,shortNameB:d(i.symbol),fileB:i.file,similarity:r,similarityBasis:"callees",sharedCallees:c.map(d),uniqueToA:[...w(e.callees,i.callees)].map(d),uniqueToB:[...w(i.callees,e.callees)].map(d),...s}}function De(e,i={}){let{minSimilarity:n=.5,limit:t=20,scope:r,minCallees:l=4,crossFileOnly:a=!1,scanLimit:c}=i,s=G(e,{minCallees:l,scope:r,scanLimit:c,semantic:i.semantic!==!1}),o=N(s.map(m=>m.callees)),f=new Map;for(let m of s)for(let u of m.callees)f.set(u,(f.get(u)??0)+1);let b=Math.max(8,Math.ceil(Math.sqrt(s.length))),y=new Map;for(let m=0;m<s.length;m+=1)for(let u of s[m].callees){if((f.get(u)??0)>b)continue;let g=y.get(u);g||(g=[],y.set(u,g)),g.push(m)}let h=[],S=0,C=new Set;for(let m=0;m<s.length;m+=1){let u=s[m],g=new Set;for(let v of u.callees){let k=y.get(v);if(k)for(let p of k)p>m&&g.add(p)}for(let v of g){let k=`${m}|${v}`;if(C.has(k))continue;C.add(k);let p=s[v];if(a&&u.file===p.file)continue;if(u.paramCount>=0&&p.paramCount>=0){let X=Math.abs(u.paramCount-p.paramCount),Y=Math.max(2,Math.ceil(Math.max(u.paramCount,p.paramCount)*.5));if(X>Y)continue}let q=j(u,p,o,{minSimilarity:n,requireSignificantShared:2,requireSharedCount:4});q&&(ee(h,q,t,S),S+=1)}}return h.sort((m,u)=>u.result.similarity-m.result.similarity||m.order-u.order),h.map(m=>m.result)}function ee(e,i,n,t){if(n<=0)return;if(e.length<n){e.push({result:i,order:t});return}let r=0;for(let a=1;a<e.length;a+=1){let c=e[a],s=e[r];(c.result.similarity<s.result.similarity||c.result.similarity===s.result.similarity&&c.order>s.order)&&(r=a)}let l=e[r];i.similarity<=l.result.similarity||(e[r]={result:i,order:t})}var ie=["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 ne(e,i,n){let t=T(e,i),r=new R(e);if(!t)return null;let l=I(e,t,{semantic:n.semantic});return{symbol:t.symbol,file:t.relativePath,callees:U(l.map(a=>a.symbol)),paramCount:r.callableSignature(t)?.paramCount??-1}}var te=D("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function G(e,i){let{minCallees:n,scope:t,excludeSymbol:r,scanLimit:l}=i,a=i.semantic!==!1,c=te.get(e,()=>new Map),s=`${n}|${t??""}|${l??""}|${a}`,o=c.get(s);return o||(o=re(e,{minCallees:n,scope:t,scanLimit:l,semantic:a}),c.set(s,o)),r===void 0?o:o.filter(f=>f.symbol!==r)}function re(e,i){let{minCallees:n,scope:t,scanLimit:r,semantic:l}=i,a=new R(e),c=M(a.productionCallableDefinitions({scope:t,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r),s=a.calleeMap(c,{semantic:l});return c.map(o=>({symbol:o.symbol,file:o.relativePath,callees:U((s.get(o.symbolId)??[]).map(f=>f.symbol)),paramCount:a.callableSignature(o)?.paramCount??-1})).filter(o=>o.callees.size>=n)}function U(e){return new Set([...e].filter(i=>!se(i)))}function se(e){return ie.some(i=>e.includes(i))}function ae(e,i,n){let t=me(e,i);if(!t||t.tokens.size<3)return[];let r=n.minSimilarity>=.5?n.minSimilarity:.3,l=[],a=new Set,c=pe(ge(e));for(let s of t.tokens)for(let o of c.get(s)??[])a.add(o);for(let s of a){if(s.symbol===t.symbol||s.tokens.size<3)continue;let o=F(t.tokens,s.tokens);if(o.size<2)continue;let f=new Set([...t.tokens,...s.tokens]),b=f.size>0?o.size/f.size:0;b<r||l.push({symbolA:t.symbol,shortNameA:d(t.symbol),fileA:t.file,symbolB:s.symbol,shortNameB:d(s.symbol),fileB:s.file,similarity:b,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...w(t.tokens,s.tokens)].sort(),uniqueToB:[...w(s.tokens,t.tokens)].sort(),...K([...o],"source-tokens")})}return l.sort((s,o)=>o.similarity-s.similarity||s.shortNameB.localeCompare(o.shortNameB)),l.slice(0,n.limit)}function K(e,i){let n=e.flatMap(z),t=e.flatMap(m=>_(m,i)),r=L(n,V),l=L(n,Z),a=L(t,$),c=[...new Set(t.filter(P))],s=e.filter(m=>{let u=_(m,i);return u.some(g=>$.has(g))&&u.some(P)}).length,o=[];r.length>0&&o.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),l.length>0&&o.push(`framework/generic scaffolding: ${l.slice(0,5).join(", ")}`),a.length>0&&o.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&c.length>0&&o.push(`domain-specific terms: ${c.slice(0,5).join(", ")}`);let f=i==="source-tokens"&&n.length>0&&n.every(m=>H.has(m));f&&o.push("shared source tokens are generic scaffolding");let b=a.length>0&&c.length>0,y=r.length+l.length>0,h=i==="callees"&&b&&e.length>=4&&c.length>=4&&s>=2,S=h?"domain-behavior":b?y?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":l.length>0||f?"framework-scaffolding":"structural-overlap";S==="structural-overlap"&&e.length>0&&o.push(`shared ${i} overlap has no recognized domain or scaffolding category`);let C=S==="domain-behavior"&&(e.length>=3||h)?"direct":"signal";return{evidenceClass:S,actionTier:C,evidenceClassReasons:o,recommendation:oe(S,C)}}function oe(e,i){return i==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function L(e,i){return[...new Set(e.filter(n=>i.has(n)))]}function z(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(i=>i.length>1)}function _(e,i){if(i==="source-tokens")return z(e);let n=E(e);return z(n.length>0?n:le(e))}function le(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(t=>t.trim()).filter(t=>/[A-Za-z]/.test(t)).at(-1)?.replace(/\.$/,"")??e}function P(e){return e.length>3&&!$.has(e)&&!V.has(e)&&!Z.has(e)&&!H.has(e)&&!ce.has(e)}var $=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),V=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),Z=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),H=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),ce=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function me(e,i){let n=T(e,i);if(!n||!A(n.symbol))return null;let t=ue(e,n);return t?{symbol:n.symbol,file:n.relativePath,tokens:t}:null}function ue(e,i){let n=E(i.symbol),t=W(e,i.relativePath,i.startLine,i.endLine,n),r=Q(t,n);return r.size>0?r:null}var fe=D("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function ge(e){return fe.get(e,()=>de(e))}function pe(e){let i=new Map;for(let n of e)for(let t of n.tokens){let r=i.get(t);r||(r=[],i.set(t,r)),r.push(n)}return i}function de(e){return new R(e).productionCallableDefinitions().map(n=>({symbol:n.symbol,file:n.relativePath,tokens:Q(W(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)})).filter(n=>n.tokens.size>0)}function W(e,i,n,t,r){let l=B(e,i);if(l.length===0)return"";if(t>=n&&t-n<=12)return l.slice(n,t+1).join(`
2
+ `);let a=[new RegExp(`\\bdef\\s+${x(r)}\\b`),new RegExp(`\\bfun\\s+${x(r)}\\b`),new RegExp(`\\bfn\\s+${x(r)}\\b`),new RegExp(`\\bfunction\\s+${x(r)}\\b`),new RegExp(`\\b${x(r)}\\s*\\(`)],c=l.findIndex(s=>a.some(o=>o.test(s)));if(c>=0){let s=c;for(let o=c+1;o<l.length&&o<=c+8;o++){let f=l[o]??"";if(o>c&&Se(f)||(s=o,f.trim()===""&&o>c+1))break}return l.slice(c,s+1).join(`
3
+ `)}return l.slice(n,Math.min(l.length,n+8)).join(`
4
+ `)}function Q(e,i){if(!e)return new Set;let n=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"]),t=be(i),l=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(a=>a.trim()).filter(a=>a.length>1).filter(a=>!n.has(a)).filter(a=>!t.has(a));return new Set(l)}function be(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 Se(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Fe as a,De as b,ee as c,G as d,U as e,K as f};
5
+ //# sourceMappingURL=chunk-MHTDOFV7.js.map
@@ -0,0 +1,2 @@
1
+ import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-3ZYF3ELZ.js";import{a as f}from"./chunk-GZCQTZLK.js";import{a as c}from"./chunk-YTR4CO5S.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
+ //# sourceMappingURL=chunk-MUULWXSJ.js.map
@@ -0,0 +1,3 @@
1
+ import{a as y,b as d,e as w,l as f}from"./chunk-3UW7VM4H.js";import{b as D,c as $,d as Q,f as v,g as A,h as N}from"./chunk-JM72FNGA.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
2
+ AND `),r=y(e,{where:o,params:i,limit:200}),a=d(e,{where:o,params:i,limit:200});return w(r,a)}function J(e,n,t,i){let o=n.trim(),r=t,a=r.replace(/\(\)$/,""),c=n.toLowerCase(),l=t.toLowerCase(),S=l.replace(/\(\)$/,""),k=e.symbol,C=$(e.symbol),b=Q(e.symbol),E=e.display_name??"",g=e.symbol.toLowerCase(),u=C.toLowerCase(),m=b.toLowerCase(),R=E.toLowerCase(),p=e.relative_path.toLowerCase(),K=/[/:.]/.test(t),M=I(t),_=M?.leaf.toLowerCase(),s=0;return(k===o||k===r)&&(s+=1150),(C===o||C===r)&&(s+=1100),E===a&&(s+=1180),b===a&&(s+=1160),(`${b}()`===o||`${b}()`===r)&&(s+=955),(g===c||g===l)&&(s+=1e3),(u===c||u===l)&&(s+=950),(p===c||p===l)&&(s+=925),(p.endsWith(`/${l}`)||p.endsWith(`/${c}`))&&(s+=875),R===S&&(s+=850),m===S&&(s+=825),(`${m}()`===c||`${m}()`===l)&&(s+=820),(u.endsWith(`:${l}`)||u.endsWith(`:${S}`)||u.endsWith(`:${S}()`))&&(s+=800),g.includes(l)&&(s+=120),u.includes(l)&&(s+=140),p.includes(l)&&(s+=140),R.includes(l)&&(s+=110),i.every(B=>{let L=B.toLowerCase();return g.includes(L)||u.includes(L)||p.includes(L)||R.includes(L)})&&(s+=100+i.length*15),M&&p.includes(M.path.toLowerCase())&&(s+=360,_&&(m===_||`${m}()`===_||`${m}()`==`${_}()`)&&(s+=700),v(e.symbol)&&(s+=180)),A(e.symbol)&&m===S&&(s+=60),!K&&N(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function I(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let i=n.slice(t+1).replace(/\(\)$/,"");return!i||i.includes(".")?null:{path:n.slice(0,t),leaf:i}}function x(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function U(e){let n=x(e),t=n.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return t.length>0?[...new Set(t)]:[n]}function V(e,n,t){let i=n.trim(),o=e.filter(r=>{let a=$(r.symbol),c=(r.display_name??"").trim();return r.symbol===i||a===i||a===t||c===i||c===t||`${c}()`===i||h(r,t)>1||r.relative_path===i});return o.length===0?null:(o.sort((r,a)=>h(a,t)-h(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),o[0]??null)}function h(e,n){let t=I(n);if(!t)return 0;let i=e.relative_path.toLowerCase(),o=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return i.includes(r)?o!==a?1:v(e.symbol)?D(e.symbol)===null?5:4:D(e.symbol)===null?3:2:0}export{re as a,Z as b,ae as c};
3
+ //# sourceMappingURL=chunk-MZ7APUFN.js.map
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-5BZOSICN.js";import{a as g}from"./chunk-W3PQRAI4.js";import{a as d}from"./chunk-SA6B3EGD.js";import{c as p}from"./chunk-64LH2QUP.js";import{a as c}from"./chunk-T67R7V5I.js";import{a as o}from"./chunk-HCQ7J2N5.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
2
- //# sourceMappingURL=chunk-LYS4SMAQ.js.map
1
+ import{a as b}from"./chunk-PFOCOG57.js";import{a as g}from"./chunk-3ZYF3ELZ.js";import{a as d}from"./chunk-HVTYSC26.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-QLNGUWR7.js";import{a as o}from"./chunk-EWC3UK4V.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
2
+ //# sourceMappingURL=chunk-NNDYO2DX.js.map
@@ -1,10 +1,10 @@
1
- import{a as S}from"./chunk-W3PQRAI4.js";import{e as b}from"./chunk-QH5GTVVB.js";import{c as p,f as h,h as y}from"./chunk-64LH2QUP.js";import{execFileSync as d}from"child_process";import{existsSync as x,readFileSync as N}from"fs";import{basename as C}from"path";var v="Unable to compute git diff.";function le(e,n={}){let t=n.plan??P(e,n);return t.note?A(t.note,t.changedFileLines):t.changedFiles.length===0?O(t.changedFileLines):T(t.changedFiles,[E(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function P(e,n={}){let{base:t="HEAD"}=n;try{let i=$(e.config.projectRoot,t),r=J(e,i),s=G(e,k(e.config.projectRoot,t));return{changedFileLines:i,changedFiles:r,changedRanges:s,renamedFiles:B(e.config.projectRoot,t,r),note:i.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:v}}}function E(e,n,t,i=[]){let r=new S(e),s=new Set(t),a=q(i),c=[],m=new Map,f=n.flatMap(o=>r.definitionsForFile(o)).filter(ee).filter(o=>V(o,a)).sort((o,u)=>o.relativePath.localeCompare(u.relativePath)||o.startLine-u.startLine),l=f.map(o=>o.symbolId),g=K(e,l),w=Q(e,l,t),M=b(e,f.filter(o=>g.get(o.symbolId)===0));for(let o of f)j(e,o,s,c,m,M.get(o.symbolId)??new Set,g.get(o.symbolId)??0,w.get(o.symbolId)??new Set);return{changedSymbols:c,consumerEntries:[...m.entries()].map(([o,u])=>({file:o,symbols:[...u].sort()}))}}function T(e,n){let t=new Map,i=n.flatMap(s=>s.changedSymbols);for(let s of n)for(let a of s.consumerEntries){let c=t.get(a.file);c||(c=new Set,t.set(a.file,c));for(let m of a.symbols)c.add(m)}let r=X(t);return{changedFiles:[...e],changedSymbols:i,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:i.length,totalAffectedFiles:r.length}}}function A(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function $(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,i,r].flatMap(s=>s.split(`
2
- `)).map(s=>s.trim()).filter(s=>s.length>0))]}function k(e,n){let t=d("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...L(t),...L(i)])}function z(e,n,t){try{return d("git",["show",`${n}:./${t}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function B(e,n,t){let i=W(e,n);if(i.length===0||t.length===0)return[];let r=new Map,s=new Set;for(let a of U(e,n))t.includes(a.to)&&(r.set(a.to,a),s.add(a.from));for(let a of t){if(r.has(a)||!x(`${e}/${a}`))continue;let c=i.filter(l=>!s.has(l)).filter(l=>C(l)===C(a));if(c.length===0)continue;let m=N(`${e}/${a}`,"utf-8"),f=c.map(l=>({from:l,to:a,similarity:H(z(e,n,l)??"",m)})).sort((l,g)=>g.similarity-l.similarity)[0];f&&f.similarity>=.45&&(r.set(a,f),s.add(f.from))}return[...r.values()].sort((a,c)=>a.to.localeCompare(c.to))}function W(e,n){let t=d("git",["diff","--name-only","--diff-filter=D",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--diff-filter=D","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...R(t),...R(i)])]}function U(e,n){let t=d("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...t.split(`
1
+ import{a as S}from"./chunk-3ZYF3ELZ.js";import{e as b}from"./chunk-FUPDW5AC.js";import{c as p,f as h,h as y}from"./chunk-JM72FNGA.js";import{execFileSync as d}from"child_process";import{existsSync as x,readFileSync as N}from"fs";import{basename as C}from"path";var v="Unable to compute git diff.";function le(e,n={}){let t=n.plan??P(e,n);return t.note?A(t.note,t.changedFileLines):t.changedFiles.length===0?O(t.changedFileLines):T(t.changedFiles,[E(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function P(e,n={}){let{base:t="HEAD"}=n;try{let i=$(e.config.projectRoot,t),r=J(e,i),s=G(e,k(e.config.projectRoot,t));return{changedFileLines:i,changedFiles:r,changedRanges:s,renamedFiles:B(e.config.projectRoot,t,r),note:i.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:v}}}function E(e,n,t,i=[]){let r=new S(e),s=new Set(t),a=q(i),l=[],m=new Map,f=n.flatMap(o=>r.definitionsForFile(o)).filter(ee).filter(o=>V(o,a)).sort((o,u)=>o.relativePath.localeCompare(u.relativePath)||o.startLine-u.startLine),c=f.map(o=>o.symbolId),g=K(e,c),w=Q(e,c,t),M=b(e,f.filter(o=>g.get(o.symbolId)===0));for(let o of f)j(e,o,s,l,m,M.get(o.symbolId)??new Set,g.get(o.symbolId)??0,w.get(o.symbolId)??new Set);return{changedSymbols:l,consumerEntries:[...m.entries()].map(([o,u])=>({file:o,symbols:[...u].sort()}))}}function T(e,n){let t=new Map,i=n.flatMap(s=>s.changedSymbols);for(let s of n)for(let a of s.consumerEntries){let l=t.get(a.file);l||(l=new Set,t.set(a.file,l));for(let m of a.symbols)l.add(m)}let r=X(t);return{changedFiles:[...e],changedSymbols:i,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:i.length,totalAffectedFiles:r.length}}}function A(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function $(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,i,r].flatMap(s=>s.split(`
2
+ `)).map(s=>s.trim()).filter(s=>s.length>0))]}function k(e,n){let t=d("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...L(t),...L(i)])}function z(e,n,t){try{return d("git",["show",`${n}:./${t}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function B(e,n,t){if(t.length===0)return[];let i=new Map,r=new Set;for(let a of U(e,n))t.includes(a.to)&&(i.set(a.to,a),r.add(a.from));let s=W(e,n);if(s.length===0)return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to));for(let a of t){if(i.has(a)||!x(`${e}/${a}`))continue;let l=s.filter(c=>!r.has(c)).filter(c=>C(c)===C(a));if(l.length===0)continue;let m=N(`${e}/${a}`,"utf-8"),f=l.map(c=>({from:c,to:a,similarity:H(z(e,n,c)??"",m)})).sort((c,g)=>g.similarity-c.similarity)[0];f&&f.similarity>=.45&&(i.set(a,f),r.add(f.from))}return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to))}function W(e,n){let t=d("git",["diff","--name-only","--diff-filter=D",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--diff-filter=D","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...R(t),...R(i)])]}function U(e,n){let t=d("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...t.split(`
3
3
  `),...i.split(`
4
4
  `)].map(r=>r.trim()).filter(r=>r.startsWith("R")).map(r=>r.split(" ")).filter(r=>r.length>=3).map(([r,s,a])=>({from:s,to:a,similarity:Number(r.slice(1))/100}))}function H(e,n){let t=new Set(I(e)),i=new Set(I(n));if(t.size===0&&i.size===0)return 1;if(t.size===0||i.size===0)return 0;let r=0;for(let s of t)i.has(s)&&(r+=1);return 2*r/(t.size+i.size)}function I(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function R(e){return e.split(`
5
5
  `).map(n=>n.trim()).filter(n=>n.length>0)}function J(e,n){let t=F(e),i=[];for(let r of n){let s=t(r);s&&!e.isIgnored(s)&&i.push(s)}return i}function G(e,n){let t=F(e),i=[];for(let r of n){let s=t(r.file);s&&!e.isIgnored(s)&&i.push({...r,file:s})}return _(i)}function F(e){let n=e.all(`SELECT relative_path FROM documents
6
6
  ORDER BY id`).map(i=>i.relative_path),t=new Map(n.map(i=>[i,i]));return i=>{let r=i.replace(/\\/g,"/"),s=t.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function L(e){let n=[],t=null;for(let i of e.split(`
7
- `)){if(i.startsWith("+++ ")){t=Y(i.slice(4).trim());continue}if(!t||!i.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(i);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function Y(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let n=new Set,t=[];for(let i of e){let r=`${i.file}:${i.startLine}:${i.endLine}`;n.has(r)||(n.add(r),t.push(i))}return t}function q(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=[],n.set(t.file,i)),i.push(t)}return n}function V(e,n){let t=n.get(e.relativePath);return!t||t.length===0?!0:t.some(i=>Z(e.startLine,e.endLine,i.startLine,i.endLine))}function Z(e,n,t,i){return e<=i&&t<=n}function j(e,n,t,i,r,s,a,c){let m=Math.max(a,s.size);if(!ne(n,m))return;let f=p(n.symbol);i.push({symbol:n.symbol,shortName:f,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:m});for(let l of c)D(e,t,r,l,f);for(let l of s)D(e,t,r,l,f)}function K(e,n){if(n.length===0)return new Map;let t=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
7
+ `)){if(i.startsWith("+++ ")){t=Y(i.slice(4).trim());continue}if(!t||!i.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(i);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function Y(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let n=new Set,t=[];for(let i of e){let r=`${i.file}:${i.startLine}:${i.endLine}`;n.has(r)||(n.add(r),t.push(i))}return t}function q(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=[],n.set(t.file,i)),i.push(t)}return n}function V(e,n){let t=n.get(e.relativePath);return!t||t.length===0?!0:t.some(i=>Z(e.startLine,e.endLine,i.startLine,i.endLine))}function Z(e,n,t,i){return e<=i&&t<=n}function j(e,n,t,i,r,s,a,l){let m=Math.max(a,s.size);if(!ne(n,m))return;let f=p(n.symbol);i.push({symbol:n.symbol,shortName:f,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:m});for(let c of l)D(e,t,r,c,f);for(let c of s)D(e,t,r,c,f)}function K(e,n){if(n.length===0)return new Map;let t=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
8
8
  FROM mentions m
9
9
  JOIN chunks c ON m.chunk_id = c.id
10
10
  WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
@@ -17,4 +17,4 @@ import{a as S}from"./chunk-W3PQRAI4.js";import{e as b}from"./chunk-QH5GTVVB.js";
17
17
  AND m.role != 1
18
18
  AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
19
19
  ${e.pathExclusionsFor("ref_d")}`,...n,...t),r=new Map;for(let s of i){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function D(e,n,t,i,r){if(e.isIgnored(i)||n.has(i))return;let s=t.get(i);s||(s=new Set,t.set(i,s)),s.add(r)}function X(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function ee(e){return!(y(e.symbol)||e.parentTypeName!==null&&!h(e.symbol))}function ne(e,n){return h(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{v as a,le as b,P as c,E as d,T as e,z as f};
20
- //# sourceMappingURL=chunk-ATGRITZP.js.map
20
+ //# sourceMappingURL=chunk-NP5HYVLX.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-W3PQRAI4.js";import{a as i}from"./chunk-5ALI77D7.js";import{c as s,e as o,k as m}from"./chunk-64LH2QUP.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
2
- //# sourceMappingURL=chunk-MHAQXOZY.js.map
1
+ import{a}from"./chunk-3ZYF3ELZ.js";import{a as i}from"./chunk-MZ7APUFN.js";import{c as s,e as o,k as m}from"./chunk-JM72FNGA.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
2
+ //# sourceMappingURL=chunk-NVFERV4U.js.map
@@ -2,4 +2,4 @@ import{execFileSync as p}from"child_process";import{platform as u}from"os";var g
2
2
  `),console.log("Or download manually:")):console.log("Download from:"),console.log(e?` ${e.url}
3
3
  `:` https://github.com/sourcegraph/scip/releases/tag/${a}
4
4
  `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function $(e){if(l()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(t("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(t("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e("Install manually from: https://github.com/sourcegraph/scip/releases"),!1}export{n as a,x as b,C as c,S as d,$ as e};
5
- //# sourceMappingURL=chunk-LWYIGRHR.js.map
5
+ //# sourceMappingURL=chunk-NXIAHE7F.js.map
@@ -0,0 +1,2 @@
1
+ import{c as l}from"./chunk-ERHOS6AW.js";function v(e,t={}){let{minTotalLines:n=800,minTemplateLines:i=300,minScriptLines:a=300,minStyleLines:r=500,limit:o=20,scope:m,scanLimit:p,filePattern:u}=t;return l(e,{scope:m,scanLimit:p}).filter(s=>!u||s.file.includes(u)).map(s=>L(s,{minTotalLines:n,minTemplateLines:i,minScriptLines:a,minStyleLines:r})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(e,t){let n=[];if(e.totalLines>=t.minTotalLines&&n.push(`${e.totalLines} total component line(s)`),e.templateLines>=t.minTemplateLines&&n.push(`${e.templateLines} template line(s)`),e.scriptLines>=t.minScriptLines&&n.push(`${e.scriptLines} script line(s)`),e.styleLines>=t.minStyleLines&&n.push(`${e.styleLines} style line(s)`),n.length===0)return null;let i=b(e),a=g(e,t,i),r=x(e.file),o=V(i,r);return{file:e.file,totalLines:e.totalLines,sfcLines:e.sfcLines,templateLines:e.templateLines,scriptLines:e.scriptLines,styleLines:e.styleLines,externalScriptLines:e.externalScriptLines,externalScriptPaths:e.externalScriptPaths,customBlockLines:e.customBlockLines,dominantPressure:i,pressureKinds:a,contextKind:r,recommendationKind:o,recommendation:d(o,r),reasons:n,loc:e.totalLines}}function b(e){let t=[{axis:"template",lines:e.templateLines},{axis:"script",lines:e.scriptLines-e.externalScriptLines},{axis:"style",lines:e.styleLines},{axis:"external-script",lines:e.externalScriptLines},{axis:"custom-block",lines:e.customBlockLines}];return t.sort((n,i)=>i.lines-n.lines),t[0]?.lines?t[0].axis:"total"}function g(e,t,n){let i=[];return e.totalLines>=t.minTotalLines&&(i.push("total"),n!=="total"&&i.push(n)),e.templateLines>=t.minTemplateLines&&i.push("template"),e.scriptLines>=t.minScriptLines&&i.push("script"),e.styleLines>=t.minStyleLines&&i.push("style"),(e.externalScriptLines>=t.minScriptLines||n==="external-script")&&i.push("external-script"),e.customBlockLines>0&&n==="custom-block"&&i.push("custom-block"),[...new Set(i.length>0?i:[n])]}function x(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(i=>w.has(i))||/(?:view|page|route)\.vue$/i.test(e)||/(?:^|\/)(views|pages|routes)\//i.test(e)?"route-page":"component"}function V(e,t){return e==="style"?"style-decomposition":e==="template"?"template-decomposition":e==="external-script"?"external-script-boundary":e==="custom-block"?"custom-block-review":t==="route-page"?"route-page-decomposition":e==="script"?"script-behavior-extraction":"total-size-review"}function d(e,t){switch(e){case"template-decomposition":return t==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{v as a};
2
+ //# sourceMappingURL=chunk-O3OKSF6O.js.map
@@ -0,0 +1,2 @@
1
+ import{a as V}from"./chunk-PVZMPG5I.js";import{a as v,b,c as R}from"./chunk-3UVJJ6Z7.js";import{c as B}from"./chunk-ERHOS6AW.js";function L(e,s={}){let{minSimilarity:i=.45,minSharedBehaviors:t=6,limit:n=20,scope:a,scanLimit:l,filePattern:c}=s,h=B(e,{scope:a,minBehaviorTokens:Math.max(3,t),scanLimit:l}).map(o=>({file:o.file,tokens:o.behaviorTokens,profile:o}));return V({profiles:h,limit:n,filePattern:c,compare:(o,r)=>w(o,r,i,t),sort:(o,r)=>r.similarity-o.similarity||o.fileA.localeCompare(r.fileA)||o.fileB.localeCompare(r.fileB)})}function w(e,s,i,t){let n=v(e.tokens,s.tokens);if(n.size<t||!q(n))return null;let a=P(e.tokens,s.tokens);if(a<i)return null;let l=d(n,"composable:"),c=d(n,"store:"),h=d(n,"reactivity:"),o=d(n,"lifecycle:"),r=d(n,"request:"),f=d(n,"function:"),g=d(n,"function-verb:"),p=d(n,"template-binding:"),C=d(n,"template-event:"),m=k({sharedComposables:l,sharedStores:c,sharedReactivity:h,sharedLifecycle:o,sharedRequests:r,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p,sharedTemplateEvents:C});return{fileA:e.file,fileB:s.file,similarity:a,sharedTokens:y(n),sharedComposables:l,sharedStores:c,sharedReactivity:h,sharedLifecycle:o,sharedRequests:r,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p,sharedTemplateEvents:C,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:y(b(e.tokens,s.tokens)).slice(0,25),uniqueToB:y(b(s.tokens,e.tokens)).slice(0,25),reason:$({sharedComposables:l,sharedStores:c,sharedRequests:r,sharedLifecycle:o,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:p}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function k(e){let s=[],i=[],t=[];e.sharedReactivity.length&&i.push(`shared reactivity primitive: ${e.sharedReactivity.join(", ")}`),e.sharedLifecycle.length&&i.push(`shared lifecycle primitive: ${e.sharedLifecycle.join(", ")}`),u(e.sharedComposables,"shared composable",s,t),u(e.sharedStores,"shared store",s,t),u(e.sharedRequests,"shared request",s,i),u(e.sharedFunctions,"shared function",s,i),u(e.sharedFunctionVerbs,"shared action verb",s,i),u(e.sharedBindings,"shared binding",s,i),u(e.sharedTemplateEvents,"shared template event",s,i);let n=s.length>0,a=i.length>0,l=t.length>0,c=n?a||l?"mixed":"domain-behavior":l?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:c==="domain-behavior"||c==="mixed"?"signal":"support",evidenceClass:c,reasons:[...s,...t,...i].slice(0,6),recommendation:A(c)}}function u(e,s,i,t){let n=[],a=[];for(let l of e)S(l)?n.push(l):a.push(l);n.length&&i.push(`${s} has domain term(s): ${n.slice(0,6).join(", ")}`),a.length&&t.push(`${s} is generic workflow: ${a.slice(0,6).join(", ")}`)}function S(e){return T(e).filter(i=>!F.has(i)).length>0}function T(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function A(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e,s){if(e.size===0||s.size===0)return 0;let t=v(e,s).size/Math.min(e.size,s.size);return Math.max(R(e,s),t)}function q(e){let s=0,i=0,t=0,n=0,a=0,l=0,c=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?i+=1:r.startsWith("request:")?t+=1:r.startsWith("lifecycle:")?n+=1:r.startsWith("function:")?a+=1:r.startsWith("reactivity:")?l+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(c+=1);let h=s+i,o=h+t+n+a+c;return t>=1&&o>=4||n>=1&&a>=2&&o>=4||h>=2&&(t>=1||a>=2)&&o>=5||a>=2&&l>=1&&o>=4}function $(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}function d(e,s){return[...e].filter(i=>i.startsWith(s)).map(i=>i.slice(s.length)).sort()}function y(e){return[...e].sort()}var F=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
2
+ //# sourceMappingURL=chunk-O4L4AB3T.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-NN3O7TPH.js";import{c as l}from"./chunk-BJ7OHKB5.js";import{readdirSync as g}from"fs";import{execFileSync as p}from"child_process";import{extname as d,join as m}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],O=[".vue"],S=new Set(x.map(e=>e.toLowerCase())),y=[...S].sort().join(","),h=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function F(e,n={}){let s=n.includeIndexed??!0,r=n.includeAuxiliary??!0,t=n.extensions?.map(c=>c.toLowerCase()),o=t?new Set(t):S,u=t?[...o].sort().join(","):y,i=`${s?"1":"0"}|${r?"1":"0"}|${u}`;return E.get(e,i,()=>{let c=new Set;if(s)for(let a of f(e,{includeIgnored:!1}))o.has(d(a).toLowerCase())&&c.add(a);if(r)for(let a of _(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}var E=l("source-files",{clearGroups:[]});function _(e,n){return I(e,n)??v(e,n)}function I(e,n){try{let s=p("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),r=new Set;for(let t of s.split(`
1
+ import{a as f}from"./chunk-64MNV6AB.js";import{c as l}from"./chunk-7S5E7KWT.js";import{readdirSync as g}from"fs";import{execFileSync as p}from"child_process";import{extname as d,join as m}from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],O=[".vue"],S=new Set(x.map(e=>e.toLowerCase())),y=[...S].sort().join(","),h=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function F(e,n={}){let s=n.includeIndexed??!0,r=n.includeAuxiliary??!0,t=n.extensions?.map(c=>c.toLowerCase()),o=t?new Set(t):S,u=t?[...o].sort().join(","):y,i=`${s?"1":"0"}|${r?"1":"0"}|${u}`;return E.get(e,i,()=>{let c=new Set;if(s)for(let a of f(e,{includeIgnored:!1}))o.has(d(a).toLowerCase())&&c.add(a);if(r)for(let a of _(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}var E=l("source-files",{clearGroups:[]});function _(e,n){return I(e,n)??v(e,n)}function I(e,n){try{let s=p("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),r=new Set;for(let t of s.split(`
2
2
  `)){let o=t.trim();o&&n.has(d(o).toLowerCase())&&r.add(o)}return r}catch{return null}}function v(e,n){let s=new Set,r=t=>{let o=t?m(e,t):e,u;try{u=g(o,{withFileTypes:!0})}catch{return}for(let i of u)if(!h.has(i.name)){if(i.isDirectory()){r(t?`${t}/${i.name}`:i.name);continue}n.has(d(i.name).toLowerCase())&&s.add(t?`${t}/${i.name}`:i.name)}};return r(""),s}export{O as a,h as b,F as c};
3
- //# sourceMappingURL=chunk-TMS4JPWY.js.map
3
+ //# sourceMappingURL=chunk-OBBDKQAG.js.map
@@ -0,0 +1,7 @@
1
+ import{b as k}from"./chunk-C3MZZ2ZN.js";import{a as D}from"./chunk-3ZYF3ELZ.js";import{f as y,g as v}from"./chunk-ZQLO2SCU.js";import{n as S}from"./chunk-HVTYSC26.js";import{f as L}from"./chunk-3UW7VM4H.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
+ JOIN documents d ON d.id = der.document_id
5
+ WHERE gs.symbol = ?
6
+ LIMIT 1`,n);return s?L(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=L(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
+ //# sourceMappingURL=chunk-OLD6PBU6.js.map
@@ -1,2 +1,2 @@
1
1
  import{b as d}from"./chunk-B75HZHUP.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
2
- //# sourceMappingURL=chunk-5BZOSICN.js.map
2
+ //# sourceMappingURL=chunk-PFOCOG57.js.map
@@ -1,2 +1,2 @@
1
1
  function f(e){let t=[];if(e.filePattern){let r=e.profiles.find(i=>i.file.includes(e.filePattern));if(!r)return[];for(let i of e.profiles){if(i.file===r.file)continue;let l=e.compare(r,i);l&&t.push(l)}}else{let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let i=0;i<e.profiles.length;i+=1){for(let l=i+1;l<e.profiles.length;l+=1){let n=e.compare(e.profiles[i],e.profiles[l]);n&&t.push(n)}if(t.length>r)break}}return t.sort(e.sort??((r,i)=>i.similarity-r.similarity)),t.slice(0,e.limit)}export{f as a};
2
- //# sourceMappingURL=chunk-CFLYMEUS.js.map
2
+ //# sourceMappingURL=chunk-PVZMPG5I.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-XGGTESMN.js";import{a as m,b as d,c as L,d as g}from"./chunk-HCQ7J2N5.js";import{a as h,i as A,j as S}from"./chunk-YVQUQIBM.js";import{b as x,c as _,d as N}from"./chunk-CMGOXDVP.js";import{f as b}from"./chunk-BJ7OHKB5.js";var k=new Set(["identifier","type_identifier","field_identifier"]),B=new Set(["identifier"]),V=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),j=new Set(["rust","python"]),v=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return j.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?B:V}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(v)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(a=>a.type==="arguments");if(!u)return;let i=u.namedChild(0);if(!i||i.type!=="string")return;let o=i.namedChildren.find(a=>a.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let i;for(;(i=u.exec(e))!==null;){let o=i[1],a=o.split("::").pop()??o;a==="is_none"&&/\bOption\b/.test(o)||a==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||a&&t.add(a)}}}function E(e,t){let r=new Map,n=(i,o)=>{if(i===o)return;let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(i,o)=>{let a=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)a(l)};for(let s of i.children)a(s)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=i.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let a=i.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");a&&u(a,o),i.type==="type_item"&&u(i,o)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let o=i.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let a=i.namedChildren.find(s=>s.type==="block");if(a)for(let s of a.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=i.namedChildren.find(a=>a.type==="type_identifier")?.text;o&&u(i,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=h(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?L(t)?.language??null:m(e)}function Q(e,t,r,n){let c=x(e,t,n),u=_(e,"source-facts",t,c);if(u){let a=q(u);if(a&&a.language===r)return a}let i=g(e,t);if(!i)return null;let o=$(i,r);return N(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,i=new Map,o=(s,l)=>{let p=i.get(s);if(!p){i.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},a=s=>{let l=C(s,t);l&&r.push(l);let p=A(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)a(M)};return a(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:i,identifiersByLine:y(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
- //# sourceMappingURL=chunk-T67R7V5I.js.map
1
+ import{a as C}from"./chunk-ERHOS6AW.js";import{a as m,b as d,c as L,d as g}from"./chunk-EWC3UK4V.js";import{a as h,i as A,j as S}from"./chunk-D322LMSA.js";import{b as x,c as _,d as N}from"./chunk-A4L36SZS.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=h(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?L(t)?.language??null:m(e)}function Q(e,t,r,n){let c=x(e,t,n),u=_(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return N(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=A(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
+ //# sourceMappingURL=chunk-QLNGUWR7.js.map
@@ -0,0 +1,2 @@
1
+ import{e as l}from"./chunk-EWC3UK4V.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
2
+ //# sourceMappingURL=chunk-QSXQT3NE.js.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-5D3BT4B4.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
2
- //# sourceMappingURL=chunk-6TWFT4Y5.js.map
1
+ import{a as c}from"./chunk-AUVBR62P.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
2
+ //# sourceMappingURL=chunk-QVCCLDZI.js.map
@@ -1,2 +1,2 @@
1
- import{a as y}from"./chunk-QUKZ77A6.js";import{d as b}from"./chunk-64LH2QUP.js";import{a as d,d as g}from"./chunk-HCQ7J2N5.js";import{b as u}from"./chunk-YVQUQIBM.js";import{c as m}from"./chunk-BJ7OHKB5.js";var x=m("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function E(n,e,r){return n.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function I(n,e,r){let i=[],t=0,s=0,p=b(e.symbol);for(let a of r)v(n,a,e.relativePath,p)?t++:S(n,a,p)?s++:i.push(a);return{realConsumers:i,barrelConsumers:t,importOnlyConsumers:s}}function S(n,e,r){if(!r)return!1;let i=d(e);if(!i)return!1;let t=x.get(n,e,()=>C(n,e,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function C(n,e,r){let i=new Set,t=new Set,s=g(n,e);if(!s)return{importedLeaves:i,usedLeaves:t};let p=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,c)=>{let l=c||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(l?i.add(o.text):t.add(o.text));for(let f of o.children)a(f,l)};return a(s.rootNode,!1),{importedLeaves:i,usedLeaves:t}}function v(n,e,r,i){if(!i)return!1;let t=u(n,e);if(t.length===0)return!1;let s=y(n,e);if(s.length===0)return!1;let p=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=0;for(let c=0;c<t.length;c++){if(!a.test(t[c]??""))continue;if(o++,!s.find(f=>f.startLine<=c&&c<=f.endLine))return!1}return o>0}export{E as a,I as b,S as c};
2
- //# sourceMappingURL=chunk-PNN3D4BE.js.map
1
+ import{a as y}from"./chunk-FOQHUKNZ.js";import{d as b}from"./chunk-JM72FNGA.js";import{a as d,d as g}from"./chunk-EWC3UK4V.js";import{b as u}from"./chunk-D322LMSA.js";import{c as m}from"./chunk-7S5E7KWT.js";var x=m("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function E(n,e,r){return n.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function I(n,e,r){let i=[],t=0,s=0,p=b(e.symbol);for(let a of r)v(n,a,e.relativePath,p)?t++:S(n,a,p)?s++:i.push(a);return{realConsumers:i,barrelConsumers:t,importOnlyConsumers:s}}function S(n,e,r){if(!r)return!1;let i=d(e);if(!i)return!1;let t=x.get(n,e,()=>C(n,e,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function C(n,e,r){let i=new Set,t=new Set,s=g(n,e);if(!s)return{importedLeaves:i,usedLeaves:t};let p=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,c)=>{let l=c||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(l?i.add(o.text):t.add(o.text));for(let f of o.children)a(f,l)};return a(s.rootNode,!1),{importedLeaves:i,usedLeaves:t}}function v(n,e,r,i){if(!i)return!1;let t=u(n,e);if(t.length===0)return!1;let s=y(n,e);if(s.length===0)return!1;let p=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=0;for(let c=0;c<t.length;c++){if(!a.test(t[c]??""))continue;if(o++,!s.find(f=>f.startLine<=c&&c<=f.endLine))return!1}return o>0}export{E as a,I as b,S as c};
2
+ //# sourceMappingURL=chunk-RHTJBYZ5.js.map
@@ -0,0 +1,7 @@
1
+ import{a as L,b as M}from"./chunk-RHTJBYZ5.js";import{a as F}from"./chunk-VAA5FFIW.js";import{a as D}from"./chunk-PFOCOG57.js";import{a as x}from"./chunk-B75HZHUP.js";import{a as h}from"./chunk-3ZYF3ELZ.js";import{a as C}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-HVTYSC26.js";import{k as b}from"./chunk-3UW7VM4H.js";import{c as f,d as p,j as g}from"./chunk-JM72FNGA.js";import{basename as u,extname as d}from"path";function K(r,n){let{scope:e,maxLoc:t=15,limit:a=30,scanLimit:o}=n??{},i=new h(r),l=E(i.fileDependencyGraph(e));return D({candidates:()=>v(i,e,t),orderCandidates:x,scanLimit:o,prepare:s=>({callerFileMap:L(i,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>S(r,i,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function S(r,n,e,t){let a=y(r,n,e,t.callerFileMap);if(a.length!==1)return null;let o=a[0],i=P(r,e.symbolId,o);if(!i)return null;let l=w(n,r,o,e.symbol,i);if(l&&g(l.symbol))return null;let{fanIn:s,source:c}=_(t.callerFileMap,t.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let m=j(r,e,o,l);return{symbol:e.symbol,shortName:f(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?f(l.symbol):u(o),callerFanIn:s,actionTier:m.length>0?"signal":"direct",boundaryEvidence:m}}function v(r,n,e){return r.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function y(r,n,e,t){let a=u(e.relativePath,d(e.relativePath)),o=[...t.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>u(i,d(i))!==a).filter(i=>{let l=n.fileKind(i);return l!=="barrel"&&l!=="entry"&&l!=="test"});return M(r,e,o).realConsumers}function P(r,n,e){return r.get(`SELECT c.start_line, c.end_line
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d ON c.document_id = d.id
5
+ WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
+ LIMIT 1`,n,e)}function w(r,n,e,t,a){let o=r.definitionsForFile(e),i=k(n,e,t,a.start_line,a.end_line);return b(o,i)}function _(r,n,e,t){if(t?.isFunctionLike){let a=[...r.get(t.symbolId)??[]].filter(o=>o!==t.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:N(n,e),source:"file"}}function k(r,n,e,t,a){let o=p(e);if(!o)return t;let i=I(r,n).get(o);if(!i||i.length===0)return t;for(let l of i)if(l>=t&&l<=a)return l;return t}function E(r){let n=new Map;for(let[e,t]of r){n.has(e)||n.set(e,n.get(e)??0);for(let a of t)n.set(a,(n.get(a)??0)+1)}return n}function N(r,n){let e=r.get(n)??0;if(e>0)return e;let t=u(n,d(n)),a=0;for(let[o,i]of r)o!==n&&u(o,d(o))===t&&i>a&&(a=i);return a}function j(r,n,e,t){return F(r,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:f(n.symbol)},{label:"caller name",value:t?.symbol?f(t.symbol):u(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{K as a};
7
+ //# sourceMappingURL=chunk-SPE4YCOT.js.map
@@ -1,4 +1,4 @@
1
- import{a as f}from"./chunk-QOFKVNFE.js";import{a as d}from"./chunk-W3PQRAI4.js";import{e as c}from"./chunk-QH5GTVVB.js";import{c as u}from"./chunk-64LH2QUP.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
1
+ import{a as f}from"./chunk-CTCAF3YA.js";import{a as d}from"./chunk-3ZYF3ELZ.js";import{e as c}from"./chunk-FUPDW5AC.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${e.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-QOFKVNFE.js";import{a as d}from"./chunk-W3PQRAI4.js";
8
8
  WHERE m.symbol_id = ?
9
9
  AND m.role != 1
10
10
  AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
11
- //# sourceMappingURL=chunk-4N7LFYSD.js.map
11
+ //# sourceMappingURL=chunk-TM6GVHA6.js.map
@@ -0,0 +1,2 @@
1
+ import{a as y}from"./chunk-PVZMPG5I.js";import{a as k,b as p,c as H}from"./chunk-3UVJJ6Z7.js";import{e as v}from"./chunk-EWC3UK4V.js";function x(e,s={}){let{minSimilarity:r=.45,minSharedBehaviors:a=6,limit:t=20,scope:c,scanLimit:i,filePattern:l}=s,d=v(e,{scope:c,minBehaviorTokens:Math.max(3,a),scanLimit:i}).map(o=>({file:o.file,component:o.name,tokens:o.behaviorTokens,profile:o}));return y({profiles:d,limit:t,filePattern:l,compare:(o,n)=>b(o,n,r,a),sort:(o,n)=>n.similarity-o.similarity||o.fileA.localeCompare(n.fileA)||o.componentA.localeCompare(n.componentA)||o.fileB.localeCompare(n.fileB)||o.componentB.localeCompare(n.componentB)})}function b(e,s,r,a){let t=k(e.tokens,s.tokens);if(t.size<a||!T(t))return null;let c=S(e.tokens,s.tokens);if(c<r)return null;let i=h(t,"hook:"),l=h(t,"react-hook:"),d=h(t,"effect:"),o=h(t,"state:"),n=h(t,"request:"),u=h(t,"handler:"),g=h(t,"handler-verb:"),m=A({sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,sharedTokens:R(t),sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:R(p(e.tokens,s.tokens)).slice(0,25),uniqueToB:R(p(s.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:i,sharedReactHooks:l,sharedEffects:d,sharedState:o,sharedRequests:n,sharedHandlers:u,sharedHandlerVerbs:g}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){let s=[],r=[],a=[];e.sharedReactHooks.length&&r.push(`shared React primitives: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&r.push(`shared lifecycle primitive: ${e.sharedEffects.join(", ")}`),f(e.sharedHooks,"shared hook",s,a),f(e.sharedRequests,"shared request",s,r),f(e.sharedState,"shared state",s,r),f(e.sharedHandlers,"shared handler",s,r),f(e.sharedHandlerVerbs,"shared action verb",s,r);let t=s.length>0,c=r.length>0,i=a.length>0,l=t?c||i?"mixed":"domain-behavior":i?"shared-abstraction":"generic-workflow-scaffolding",d=l==="domain-behavior"||l==="mixed"?"signal":"support",o=[...s,...a,...r].slice(0,6);return{actionTier:d,evidenceClass:l,reasons:o,recommendation:w(l)}}function f(e,s,r,a){let t=[],c=[];for(let i of e)B(i)?t.push(i):c.push(i);t.length&&r.push(`${s} has domain term(s): ${t.slice(0,6).join(", ")}`),c.length&&a.push(`${s} is generic workflow: ${c.slice(0,6).join(", ")}`)}function B(e){return C(e).filter(r=>!P.has(r)).length>0}function C(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/^use(?=[A-Z])/,"").replace(/^handle(?=[A-Z])/,"").replace(/^is(?=[A-Z])/,"").replace(/^has(?=[A-Z])/,"").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function w(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function S(e,s){if(e.size===0||s.size===0)return 0;let a=k(e,s).size/Math.min(e.size,s.size);return Math.max(H(e,s),a)}function T(e){let s=0,r=0,a=0,t=0,c=0,i=0,l=0;for(let n of e)n.startsWith("hook:")?s+=1:n.startsWith("react-hook:")?r+=1:n.startsWith("effect:")?a+=1:n.startsWith("request:")?t+=1:n.startsWith("handler:")||n.startsWith("handler-verb:")?c+=1:n.startsWith("state:")?i+=1:n.startsWith("state-hook:")&&(l+=1);let d=i+l,o=s+r+a+t+c+d;return t>=1&&o>=4||s>=1&&(t>=1||i>=1||c>=2)&&o>=5||i>=1&&c>=2&&(a>=1||r>=2)&&o>=5}function E(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}function h(e,s){return[...e].filter(r=>r.startsWith(s)).map(r=>r.slice(s.length)).sort()}function R(e){return[...e].sort()}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]);export{x as a};
2
+ //# sourceMappingURL=chunk-TO54DY4O.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-CFLYMEUS.js";import{a as p,b as l,c as f}from"./chunk-UIWAZ2NT.js";import{e as m}from"./chunk-HCQ7J2N5.js";function v(n,t={}){let{minSimilarity:o=.62,minTokens:e=8,limit:a=20,scope:g,scanLimit:d,filePattern:h}=t,k=m(n,{scope:g,minJsxTokens:e,scanLimit:d}).filter(i=>i.kind==="component").map(i=>({file:i.file,component:i.name,tokens:i.jsxTokens,profile:i}));return u({profiles:k,limit:a,filePattern:h,compare:(i,r)=>P(i,r,o),sort:(i,r)=>r.similarity-i.similarity||i.fileA.localeCompare(r.fileA)||i.componentA.localeCompare(r.componentA)||i.fileB.localeCompare(r.fileB)||i.componentB.localeCompare(r.componentB)})}function P(n,t,o){let e=p(n.tokens,t.tokens);if(e.size<6||!B(e))return null;let a=f(n.tokens,t.tokens);return a<o?null:{fileA:n.file,componentA:n.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:c(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:c(l(n.tokens,t.tokens)).slice(0,25),uniqueToB:c(l(t.tokens,n.tokens)).slice(0,25),locA:n.profile.loc,locB:t.profile.loc}}function B(n){let t=0,o=0;for(let e of n)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(o+=1);return t>=1||o>=4}function s(n,t){return[...n].filter(o=>o.startsWith(t)).map(o=>o.slice(t.length)).sort()}function c(n){return[...n].sort()}export{v as a};
2
- //# sourceMappingURL=chunk-HQHFMPLJ.js.map
1
+ import{a as u}from"./chunk-PVZMPG5I.js";import{a as p,b as l,c as f}from"./chunk-3UVJJ6Z7.js";import{e as m}from"./chunk-EWC3UK4V.js";function v(n,t={}){let{minSimilarity:o=.62,minTokens:e=8,limit:a=20,scope:g,scanLimit:d,filePattern:h}=t,k=m(n,{scope:g,minJsxTokens:e,scanLimit:d}).filter(i=>i.kind==="component").map(i=>({file:i.file,component:i.name,tokens:i.jsxTokens,profile:i}));return u({profiles:k,limit:a,filePattern:h,compare:(i,r)=>P(i,r,o),sort:(i,r)=>r.similarity-i.similarity||i.fileA.localeCompare(r.fileA)||i.componentA.localeCompare(r.componentA)||i.fileB.localeCompare(r.fileB)||i.componentB.localeCompare(r.componentB)})}function P(n,t,o){let e=p(n.tokens,t.tokens);if(e.size<6||!B(e))return null;let a=f(n.tokens,t.tokens);return a<o?null:{fileA:n.file,componentA:n.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:c(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:c(l(n.tokens,t.tokens)).slice(0,25),uniqueToB:c(l(t.tokens,n.tokens)).slice(0,25),locA:n.profile.loc,locB:t.profile.loc}}function B(n){let t=0,o=0;for(let e of n)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(o+=1);return t>=1||o>=4}function s(n,t){return[...n].filter(o=>o.startsWith(t)).map(o=>o.slice(t.length)).sort()}function c(n){return[...n].sort()}export{v as a};
2
+ //# sourceMappingURL=chunk-UMNENNTX.js.map
@@ -0,0 +1,2 @@
1
+ import{a as oe}from"./chunk-O3OKSF6O.js";import{a as ne}from"./chunk-3KLLFNT4.js";import{a as te}from"./chunk-QSXQT3NE.js";import{a as ie}from"./chunk-O4L4AB3T.js";import{a as re}from"./chunk-GS33KGAY.js";import{a as Z}from"./chunk-UMNENNTX.js";import{a as ee}from"./chunk-TO54DY4O.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as K}from"./chunk-SPE4YCOT.js";import{a as Q}from"./chunk-ZFMPHDAT.js";import{a as J}from"./chunk-C2QSK7E7.js";import{b as X}from"./chunk-MHTDOFV7.js";import{a as G}from"./chunk-G3WGZU5Q.js";import{a as Y}from"./chunk-DE7MA6OD.js";import{a as j}from"./chunk-7KCSELEV.js";import{a as q}from"./chunk-AW4N6MGC.js";import{a as T,b as I}from"./chunk-C3MZZ2ZN.js";import{b as O}from"./chunk-CNTEQMHA.js";import{b as z,c as N}from"./chunk-DRAZH77R.js";import{a as U}from"./chunk-DAI74TJU.js";import{a as W}from"./chunk-CJJP64OC.js";import{f as A,g as k}from"./chunk-ZQLO2SCU.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ke(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ue(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:We(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:qe(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:je(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Ye(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Xe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Qe(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Je(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ke(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Ze(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ge(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:et(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:tt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:rt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:nt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:at(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:it(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ot(e,t)})};function qt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Oe(e,r.scope,t,i);return M(o)})}function jt(e,r,t={}){return he(e,t.full!==!1,(i,o)=>me[r](e,t.scope,o,i))}function he(e,r,t){let i=J(e),o=st(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Gt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Oe(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function Ue(e,r,t){return s(e,t,"dead",()=>{let i=I(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(lt(e,i.symbols))})}function We(e,r,t){return s(e,t,"isolated",()=>{let i=G(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(dt(e,i))})}function qe(e,r,t){return s(e,t,"cycles",()=>W(e,{scope:r}).filter(o=>o.kind==="real").length)}function je(e,r,t){return s(e,t,"similar",()=>X(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ge(e,r,t){return s(e,t,"extract-candidates",()=>j(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Xe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,mt)})}function Qe(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return pt(i)})}function Je(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ke(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Ze(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function et(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=K(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,gt)})}function tt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=Y(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=Q(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function it(e,r){return s(e,r,"git-evidence",()=>{let t=z(e);if(!t)return null;let i=O(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:N(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function ot(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function nt(e,r,t){return s(e,t,"drift",()=>{let i=q(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function at(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=U(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function st(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ct(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){ut(t);try{return i()}finally{ct(e,r)}}function ut(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function lt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function pt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function ht(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function gt(e){return e.actionTier==="signal"?.25:1}function ft(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ne as a,qt as b,jt as c,Gt as d};
2
+ //# sourceMappingURL=chunk-UNJG7P2I.js.map