scip-query 0.10.0 → 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 (293) hide show
  1. package/README.md +115 -58
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-3KLLFNT4.js +2 -0
  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-MN75T4UB.js → chunk-47UA45TU.js} +2 -2
  8. package/dist/{chunk-NC4IUW25.js → chunk-4ZUJJRWT.js} +2 -2
  9. package/dist/chunk-5B53WB6E.js +4 -0
  10. package/dist/{chunk-2WEH5QHC.js → chunk-5FOPAXWY.js} +2 -2
  11. package/dist/{chunk-VZRILF2Z.js → chunk-5M4TYWVI.js} +2 -2
  12. package/dist/{chunk-QJWN6LA5.js → chunk-5QJXH6ZL.js} +5 -5
  13. package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
  14. package/dist/chunk-77YBOOYT.js +2 -0
  15. package/dist/chunk-7KCSELEV.js +2 -0
  16. package/dist/{chunk-ZZ2W5P3D.js → chunk-7OHWPJ5N.js} +2 -2
  17. package/dist/chunk-7S5E7KWT.js +2 -0
  18. package/dist/chunk-A3VNUGKJ.js +2 -0
  19. package/dist/{chunk-ISCKLDSS.js → chunk-A4L36SZS.js} +3 -3
  20. package/dist/{chunk-IVAIPXNO.js → chunk-AUVBR62P.js} +2 -2
  21. package/dist/chunk-AW4N6MGC.js +18 -0
  22. package/dist/{chunk-PG3ZI5IH.js → chunk-B6MJ5VQV.js} +2 -2
  23. package/dist/chunk-B75HZHUP.js +2 -0
  24. package/dist/chunk-BGBBVSH4.js +2 -0
  25. package/dist/chunk-BKDXBJDQ.js +2 -0
  26. package/dist/{chunk-AQYBOORI.js → chunk-C2QSK7E7.js} +1 -1
  27. package/dist/chunk-C3MZZ2ZN.js +2 -0
  28. package/dist/{chunk-AP5GTKSG.js → chunk-CAWSSEVM.js} +2 -2
  29. package/dist/chunk-CFL2CNIF.js +10 -0
  30. package/dist/{chunk-4HTJZC6G.js → chunk-CJJP64OC.js} +2 -2
  31. package/dist/chunk-CNTEQMHA.js +2 -0
  32. package/dist/{chunk-WEJYUS5O.js → chunk-CRU42NJU.js} +2 -2
  33. package/dist/chunk-CSWZFD46.js +2 -0
  34. package/dist/{chunk-ZOT3WUZW.js → chunk-CTCAF3YA.js} +2 -2
  35. package/dist/chunk-D322LMSA.js +5 -0
  36. package/dist/{chunk-772YYL6I.js → chunk-DAI74TJU.js} +2 -2
  37. package/dist/chunk-DE7MA6OD.js +3 -0
  38. package/dist/chunk-DJMK4DBL.js +2 -0
  39. package/dist/chunk-DRAZH77R.js +7 -0
  40. package/dist/{chunk-L2KFPRMA.js → chunk-E44ZMVNA.js} +2 -2
  41. package/dist/{chunk-BNW3Q24R.js → chunk-E7KERP7E.js} +2 -2
  42. package/dist/{chunk-QKO474FG.js → chunk-EOZIZWW4.js} +2 -2
  43. package/dist/chunk-ERHOS6AW.js +2 -0
  44. package/dist/{chunk-ADRYSISR.js → chunk-ESG4HBEF.js} +2 -2
  45. package/dist/chunk-EWC3UK4V.js +3 -0
  46. package/dist/chunk-FGCL6NDB.js +8 -0
  47. package/dist/chunk-FIB4JPEX.js +2 -0
  48. package/dist/chunk-FNRPGGVI.js +2 -0
  49. package/dist/chunk-FOQHUKNZ.js +4 -0
  50. package/dist/chunk-FPMVCDIJ.js +2 -0
  51. package/dist/chunk-FUPDW5AC.js +3 -0
  52. package/dist/chunk-G3WGZU5Q.js +2 -0
  53. package/dist/chunk-GS33KGAY.js +2 -0
  54. package/dist/chunk-GZCQTZLK.js +2 -0
  55. package/dist/{chunk-VGBSY6N7.js → chunk-HVTYSC26.js} +2 -2
  56. package/dist/{chunk-2BMFRBV6.js → chunk-ICXVNWMI.js} +2 -2
  57. package/dist/chunk-JM72FNGA.js +2 -0
  58. package/dist/chunk-KPHKX4LP.js +71 -0
  59. package/dist/{chunk-6DEX3XP6.js → chunk-LPLGJ4HO.js} +2 -2
  60. package/dist/chunk-MHK7Z53U.js +2 -0
  61. package/dist/chunk-MHTDOFV7.js +5 -0
  62. package/dist/chunk-MUULWXSJ.js +2 -0
  63. package/dist/chunk-MZ7APUFN.js +3 -0
  64. package/dist/chunk-NNDYO2DX.js +2 -0
  65. package/dist/chunk-NP5HYVLX.js +20 -0
  66. package/dist/{chunk-Y5H7TBVE.js → chunk-NVFERV4U.js} +2 -2
  67. package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
  68. package/dist/chunk-O3OKSF6O.js +2 -0
  69. package/dist/chunk-O4L4AB3T.js +2 -0
  70. package/dist/chunk-OBBDKQAG.js +3 -0
  71. package/dist/chunk-OLD6PBU6.js +7 -0
  72. package/dist/{chunk-V76FCF5F.js → chunk-PFOCOG57.js} +2 -2
  73. package/dist/chunk-PVZMPG5I.js +2 -0
  74. package/dist/chunk-QLNGUWR7.js +2 -0
  75. package/dist/chunk-QSXQT3NE.js +2 -0
  76. package/dist/{chunk-OLCKSG3Y.js → chunk-QVCCLDZI.js} +2 -2
  77. package/dist/chunk-RHTJBYZ5.js +2 -0
  78. package/dist/chunk-SPE4YCOT.js +7 -0
  79. package/dist/{chunk-FVIKFWUL.js → chunk-TM6GVHA6.js} +2 -2
  80. package/dist/chunk-TO54DY4O.js +2 -0
  81. package/dist/chunk-UMNENNTX.js +2 -0
  82. package/dist/chunk-UNJG7P2I.js +2 -0
  83. package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
  84. package/dist/chunk-VAA5FFIW.js +2 -0
  85. package/dist/chunk-WDUTG2ZR.js +4 -0
  86. package/dist/chunk-X7ZY6FFF.js +4 -0
  87. package/dist/{chunk-BGRPMGTD.js → chunk-YQH353VA.js} +2 -2
  88. package/dist/chunk-YTR4CO5S.js +38 -0
  89. package/dist/chunk-YUOAAR24.js +2 -0
  90. package/dist/{chunk-YWZBKYLS.js → chunk-YYD245WG.js} +2 -2
  91. package/dist/{chunk-SCEMECW7.js → chunk-Z4VHYJ5U.js} +2 -2
  92. package/dist/chunk-ZFMPHDAT.js +4 -0
  93. package/dist/chunk-ZQLO2SCU.js +6 -0
  94. package/dist/chunk-ZSLT7NWQ.js +61 -0
  95. package/dist/cli.js +276 -271
  96. package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bj4sh28g.d.ts} +37 -1
  97. package/dist/{db-DdTPetj5.d.ts → db-CTarohbZ.d.ts} +1 -1
  98. package/dist/git-history-Dao3_Pu9.d.ts +12 -0
  99. package/dist/{health-C6r2VgpA.d.ts → health-Bx0x1HAG.d.ts} +64 -4
  100. package/dist/index.d.ts +7 -6
  101. package/dist/index.js +1 -1
  102. package/dist/postinstall.js +2 -2
  103. package/dist/queries/affected.d.ts +2 -2
  104. package/dist/queries/affected.js +1 -1
  105. package/dist/queries/bottlenecks.d.ts +6 -2
  106. package/dist/queries/bottlenecks.js +1 -1
  107. package/dist/queries/by-kind.d.ts +2 -2
  108. package/dist/queries/by-kind.js +1 -1
  109. package/dist/queries/call-graph.d.ts +2 -2
  110. package/dist/queries/call-graph.js +1 -1
  111. package/dist/queries/change-surface.d.ts +2 -2
  112. package/dist/queries/change-surface.js +1 -1
  113. package/dist/queries/cleanup-plan.d.ts +2 -2
  114. package/dist/queries/cleanup-plan.js +1 -1
  115. package/dist/queries/co-change.d.ts +40 -5
  116. package/dist/queries/co-change.js +1 -1
  117. package/dist/queries/code.d.ts +2 -2
  118. package/dist/queries/code.js +1 -1
  119. package/dist/queries/complexity-hotspots.d.ts +2 -2
  120. package/dist/queries/complexity-hotspots.js +1 -1
  121. package/dist/queries/complexity.d.ts +2 -2
  122. package/dist/queries/complexity.js +1 -1
  123. package/dist/queries/convergence.d.ts +2 -2
  124. package/dist/queries/convergence.js +1 -1
  125. package/dist/queries/coupling.d.ts +6 -2
  126. package/dist/queries/coupling.js +1 -1
  127. package/dist/queries/cycles.d.ts +2 -2
  128. package/dist/queries/cycles.js +1 -1
  129. package/dist/queries/dataflow.d.ts +2 -2
  130. package/dist/queries/dataflow.js +1 -1
  131. package/dist/queries/dead.d.ts +10 -3
  132. package/dist/queries/dead.js +1 -1
  133. package/dist/queries/deep-chains.d.ts +6 -2
  134. package/dist/queries/deep-chains.js +1 -1
  135. package/dist/queries/deps.d.ts +2 -2
  136. package/dist/queries/deps.js +1 -1
  137. package/dist/queries/diff-gate.d.ts +66 -3
  138. package/dist/queries/diff-gate.js +1 -1
  139. package/dist/queries/diff-impact.d.ts +20 -4
  140. package/dist/queries/diff-impact.js +1 -1
  141. package/dist/queries/doc-drift.d.ts +20 -3
  142. package/dist/queries/doc-drift.js +1 -1
  143. package/dist/queries/drift.d.ts +10 -3
  144. package/dist/queries/drift.js +1 -1
  145. package/dist/queries/extract-candidates.d.ts +11 -3
  146. package/dist/queries/extract-candidates.js +1 -1
  147. package/dist/queries/fan.d.ts +2 -2
  148. package/dist/queries/fan.js +1 -1
  149. package/dist/queries/files.d.ts +2 -2
  150. package/dist/queries/files.js +1 -1
  151. package/dist/queries/health.d.ts +3 -3
  152. package/dist/queries/health.js +1 -1
  153. package/dist/queries/hierarchy.d.ts +2 -2
  154. package/dist/queries/hierarchy.js +1 -1
  155. package/dist/queries/hotspots.d.ts +2 -2
  156. package/dist/queries/hotspots.js +1 -1
  157. package/dist/queries/imports.d.ts +2 -2
  158. package/dist/queries/imports.js +1 -1
  159. package/dist/queries/incomplete-migration.d.ts +16 -3
  160. package/dist/queries/incomplete-migration.js +1 -1
  161. package/dist/queries/index.d.ts +20 -12
  162. package/dist/queries/index.js +1 -1
  163. package/dist/queries/isolated.d.ts +2 -2
  164. package/dist/queries/isolated.js +1 -1
  165. package/dist/queries/locality-candidates.d.ts +51 -0
  166. package/dist/queries/locality-candidates.js +2 -0
  167. package/dist/queries/members.d.ts +2 -2
  168. package/dist/queries/members.js +1 -1
  169. package/dist/queries/methods.d.ts +2 -2
  170. package/dist/queries/methods.js +1 -1
  171. package/dist/queries/outline.d.ts +2 -2
  172. package/dist/queries/outline.js +1 -1
  173. package/dist/queries/passthrough-candidates.d.ts +8 -3
  174. package/dist/queries/passthrough-candidates.js +1 -1
  175. package/dist/queries/plan-context.d.ts +4 -2
  176. package/dist/queries/plan-context.js +1 -1
  177. package/dist/queries/react-component-duplicates.d.ts +31 -0
  178. package/dist/queries/react-component-duplicates.js +2 -0
  179. package/dist/queries/react-hook-candidates.d.ts +40 -0
  180. package/dist/queries/react-hook-candidates.js +2 -0
  181. package/dist/queries/react-large-component-pressure.d.ts +34 -0
  182. package/dist/queries/react-large-component-pressure.js +2 -0
  183. package/dist/queries/recent-duplicates.d.ts +32 -3
  184. package/dist/queries/recent-duplicates.js +1 -1
  185. package/dist/queries/redundant-reexports.d.ts +7 -3
  186. package/dist/queries/redundant-reexports.js +1 -1
  187. package/dist/queries/refs.d.ts +2 -2
  188. package/dist/queries/refs.js +1 -1
  189. package/dist/queries/self-audit.d.ts +2 -2
  190. package/dist/queries/self-audit.js +1 -1
  191. package/dist/queries/similar-chains.d.ts +2 -2
  192. package/dist/queries/similar-chains.js +1 -1
  193. package/dist/queries/similar-files.d.ts +2 -2
  194. package/dist/queries/similar-files.js +1 -1
  195. package/dist/queries/similar-signatures.d.ts +2 -2
  196. package/dist/queries/similar-signatures.js +1 -1
  197. package/dist/queries/similar.d.ts +21 -3
  198. package/dist/queries/similar.js +1 -1
  199. package/dist/queries/slice.d.ts +2 -2
  200. package/dist/queries/slice.js +1 -1
  201. package/dist/queries/stale-abstractions.d.ts +10 -3
  202. package/dist/queries/stale-abstractions.js +1 -1
  203. package/dist/queries/stats.d.ts +2 -2
  204. package/dist/queries/stats.js +1 -1
  205. package/dist/queries/surface.d.ts +2 -2
  206. package/dist/queries/surface.js +1 -1
  207. package/dist/queries/symbols.d.ts +2 -2
  208. package/dist/queries/symbols.js +1 -1
  209. package/dist/queries/system.d.ts +2 -2
  210. package/dist/queries/system.js +1 -1
  211. package/dist/queries/trace.d.ts +2 -2
  212. package/dist/queries/trace.js +1 -1
  213. package/dist/queries/unused-imports.d.ts +4 -0
  214. package/dist/queries/unused-imports.js +2 -0
  215. package/dist/queries/unused-params.d.ts +2 -2
  216. package/dist/queries/unused-params.js +1 -1
  217. package/dist/queries/vue-component-duplicates.d.ts +35 -0
  218. package/dist/queries/vue-component-duplicates.js +2 -0
  219. package/dist/queries/vue-composable-candidates.d.ts +40 -0
  220. package/dist/queries/vue-composable-candidates.js +2 -0
  221. package/dist/queries/vue-large-view-pressure.d.ts +37 -0
  222. package/dist/queries/vue-large-view-pressure.js +2 -0
  223. package/dist/queries/wrapper-candidates.d.ts +6 -3
  224. package/dist/queries/wrapper-candidates.js +1 -1
  225. package/dist/reindex-worker.js +10 -10
  226. package/dist/reindex.d.ts +1 -1
  227. package/dist/reindex.js +22 -22
  228. package/dist/runtime.d.ts +1 -1
  229. package/dist/runtime.js +2 -2
  230. package/docs/AGENT_GUIDE.md +353 -0
  231. package/docs/AI_FAILURE_MODES.md +278 -0
  232. package/docs/API.md +40 -0
  233. package/docs/COMMAND_REFERENCE.md +131 -0
  234. package/docs/DETECTOR_GUIDE.md +119 -0
  235. package/docs/accuracy-hardening-goal.md +54 -0
  236. package/docs/analyzer-inventory.md +162 -0
  237. package/docs/analyzer-validation-ledger.md +262 -0
  238. package/docs/analyzer-validation-protocol.md +192 -0
  239. package/docs/assets/scip-query-logo-dark.svg +21 -0
  240. package/docs/assets/scip-query-logo.svg +24 -0
  241. package/docs/locality-analyzer-design.md +193 -0
  242. package/package.json +44 -5
  243. package/skills/scip-directory-architecture/SKILL.md +178 -0
  244. package/skills/scip-maintainability/SKILL.md +24 -3
  245. package/skills/scip-query/SKILL.md +4 -2
  246. package/skills/scip-query-setup/SKILL.md +118 -0
  247. package/skills/scip-react-maintainability/SKILL.md +114 -0
  248. package/skills/scip-vue-maintainability/SKILL.md +130 -0
  249. package/dist/chunk-4DAPXOWD.js +0 -2
  250. package/dist/chunk-4JQFTUKD.js +0 -2
  251. package/dist/chunk-4MHT7LKP.js +0 -3
  252. package/dist/chunk-5OHZEO3U.js +0 -3
  253. package/dist/chunk-5QJIEYFB.js +0 -34
  254. package/dist/chunk-6IGXZZQ4.js +0 -4
  255. package/dist/chunk-6K2JQ2VI.js +0 -61
  256. package/dist/chunk-6QVCPUK6.js +0 -2
  257. package/dist/chunk-6VL4AIEO.js +0 -8
  258. package/dist/chunk-A2VTV2QB.js +0 -7
  259. package/dist/chunk-AI2ECT7L.js +0 -2
  260. package/dist/chunk-BUAC4Q4G.js +0 -2
  261. package/dist/chunk-BZ6LCGE6.js +0 -2
  262. package/dist/chunk-CMXFASVD.js +0 -2
  263. package/dist/chunk-CO3AL7NZ.js +0 -2
  264. package/dist/chunk-FVVT7GV6.js +0 -4
  265. package/dist/chunk-HXXRN77A.js +0 -2
  266. package/dist/chunk-IC3RC3KJ.js +0 -4
  267. package/dist/chunk-ITHQJZTG.js +0 -2
  268. package/dist/chunk-IW7ASGVF.js +0 -2
  269. package/dist/chunk-JODYQDE4.js +0 -2
  270. package/dist/chunk-MCW36F2D.js +0 -2
  271. package/dist/chunk-MX6F756F.js +0 -2
  272. package/dist/chunk-NGI4V4AB.js +0 -18
  273. package/dist/chunk-O6KCZPJQ.js +0 -62
  274. package/dist/chunk-OAI5GEIN.js +0 -6
  275. package/dist/chunk-OH5HIAID.js +0 -4
  276. package/dist/chunk-OXKEUWMJ.js +0 -2
  277. package/dist/chunk-PBGTMPJ7.js +0 -2
  278. package/dist/chunk-PRVDXGSK.js +0 -2
  279. package/dist/chunk-QYKKTYBN.js +0 -6
  280. package/dist/chunk-R3G6ERW7.js +0 -7
  281. package/dist/chunk-R6XDPWJA.js +0 -10
  282. package/dist/chunk-SJR4SB7B.js +0 -2
  283. package/dist/chunk-SYKCO25G.js +0 -16
  284. package/dist/chunk-T22X7WT6.js +0 -2
  285. package/dist/chunk-TH4JVC34.js +0 -71
  286. package/dist/chunk-VDY4HYNK.js +0 -2
  287. package/dist/chunk-VDZIEDJB.js +0 -2
  288. package/dist/chunk-VDZL45XI.js +0 -2
  289. package/dist/chunk-WJIS6BNI.js +0 -3
  290. package/dist/chunk-WN5Z3UVT.js +0 -7
  291. package/dist/chunk-XCW7DYHM.js +0 -2
  292. package/dist/chunk-ZF6P2NAT.js +0 -63
  293. package/dist/chunk-ZGIK464P.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"../chunk-OAI5GEIN.js";import"../chunk-UIWAZ2NT.js";import"../chunk-MX6F756F.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{c as getAllCalleeFingerprints,d as meaningfulCallees,a as similar,b as similarAll};
1
+ import{a,b,c,d,e,f}from"../chunk-MHTDOFV7.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{f as classifySimilarityEvidence,d as getAllCalleeFingerprints,c as insertTopSimilarResult,e as meaningfulCallees,a as similar,b as similarAll};
2
2
  //# sourceMappingURL=similar.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface SliceResult {
6
6
  symbol: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-PRVDXGSK.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as slice};
1
+ import{a}from"../chunk-FIB4JPEX.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as slice};
2
2
  //# sourceMappingURL=slice.js.map
@@ -1,7 +1,9 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
+ type StaleAbstractionActionTier = 'direct' | 'signal';
6
+ type StalenessKind = 'unused-abstraction' | 'misplaced-single-consumer-type' | 'single-consumer-abstraction' | 'one-to-one-class-encapsulation';
5
7
  interface StaleAbstraction {
6
8
  symbol: string;
7
9
  shortName: string;
@@ -34,6 +36,11 @@ interface StaleAbstraction {
34
36
  confidence: 'high' | 'medium' | 'low';
35
37
  /** Short human-readable explanation of why this was flagged. */
36
38
  reason: string;
39
+ /** Direct cleanup for unused abstractions; contextual signal for one-consumer ownership questions. */
40
+ actionTier: StaleAbstractionActionTier;
41
+ /** Reviewer-facing stale shape. */
42
+ stalenessKind: StalenessKind;
43
+ recommendation: string;
37
44
  }
38
45
  /**
39
46
  * Find stale abstractions: type-level symbols (classes, interfaces, type
@@ -62,4 +69,4 @@ declare function staleAbstractions(db: ScipDatabase, opts?: {
62
69
  semantic?: boolean;
63
70
  }): StaleAbstraction[];
64
71
 
65
- export { type StaleAbstraction, staleAbstractions };
72
+ export { type StaleAbstraction, type StaleAbstractionActionTier, type StalenessKind, staleAbstractions };
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-6IGXZZQ4.js";import"../chunk-WJIS6BNI.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as staleAbstractions};
1
+ import{a}from"../chunk-ZFMPHDAT.js";import"../chunk-RHTJBYZ5.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as staleAbstractions};
2
2
  //# sourceMappingURL=stale-abstractions.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface StatsResult {
6
6
  documents: number;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-AQYBOORI.js";export{a as stats};
1
+ import{a}from"../chunk-C2QSK7E7.js";export{a as stats};
2
2
  //# sourceMappingURL=stats.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface SurfaceResult {
6
6
  consumer: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-BGRPMGTD.js";import"../chunk-ZOT3WUZW.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as surface};
1
+ import{a}from"../chunk-YQH353VA.js";import"../chunk-CTCAF3YA.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as surface};
2
2
  //# sourceMappingURL=surface.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface SymbolResult {
6
6
  startLine: number;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-ITHQJZTG.js";import"../chunk-ZOT3WUZW.js";import"../chunk-4MHT7LKP.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as symbols};
1
+ import{a}from"../chunk-A3VNUGKJ.js";import"../chunk-CTCAF3YA.js";import"../chunk-MZ7APUFN.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as symbols};
2
2
  //# sourceMappingURL=symbols.js.map
@@ -1,7 +1,7 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import { SymbolResult } from './symbols.js';
3
3
  import 'better-sqlite3';
4
- import '../config-types-CGIeLEpY.js';
4
+ import '../config-types-Bj4sh28g.js';
5
5
 
6
6
  interface SystemResult {
7
7
  files: string[];
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-2BMFRBV6.js";import"../chunk-ZOT3WUZW.js";import"../chunk-4MHT7LKP.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as system};
1
+ import{a}from"../chunk-ICXVNWMI.js";import"../chunk-CTCAF3YA.js";import"../chunk-MZ7APUFN.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
2
2
  //# sourceMappingURL=system.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface TraceResult {
6
6
  definitions: Array<{
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-IC3RC3KJ.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as trace};
1
+ import{a}from"../chunk-X7ZY6FFF.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
2
2
  //# sourceMappingURL=trace.js.map
@@ -0,0 +1,4 @@
1
+ import '../db-CTarohbZ.js';
2
+ export { ImportResult, UnusedImportResult, importedBy, imports, unusedImports } from './imports.js';
3
+ import 'better-sqlite3';
4
+ import '../config-types-Bj4sh28g.js';
@@ -0,0 +1,2 @@
1
+ import{a,b,c}from"../chunk-7OHWPJ5N.js";import"../chunk-CTCAF3YA.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
2
+ //# sourceMappingURL=unused-imports.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
5
  interface UnusedParamsFinding {
6
6
  symbol: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-SJR4SB7B.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as unusedParams};
1
+ import{a}from"../chunk-NNDYO2DX.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
2
2
  //# sourceMappingURL=unused-params.js.map
@@ -0,0 +1,35 @@
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
+ import 'better-sqlite3';
3
+ import '../config-types-Bj4sh28g.js';
4
+
5
+ interface VueComponentDuplicateResult {
6
+ fileA: string;
7
+ fileB: string;
8
+ similarity: number;
9
+ sharedTokens: string[];
10
+ sharedComponents: string[];
11
+ sharedProps: string[];
12
+ sharedEvents: string[];
13
+ sharedDirectives: string[];
14
+ sharedSlots: string[];
15
+ sharedIdentifiers: string[];
16
+ uniqueToA: string[];
17
+ uniqueToB: string[];
18
+ locA: number;
19
+ locB: number;
20
+ }
21
+ /**
22
+ * Find Vue SFCs with similar template structure. This catches copy-paste UI
23
+ * variants that function/callee similarity cannot see because the duplicated
24
+ * work lives in component tags, bindings, slots, and directives.
25
+ */
26
+ declare function vueComponentDuplicates(db: ScipDatabase, opts?: {
27
+ minSimilarity?: number;
28
+ minTokens?: number;
29
+ limit?: number;
30
+ scope?: string;
31
+ scanLimit?: number;
32
+ filePattern?: string;
33
+ }): VueComponentDuplicateResult[];
34
+
35
+ export { type VueComponentDuplicateResult, vueComponentDuplicates };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-GS33KGAY.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
2
+ //# sourceMappingURL=vue-component-duplicates.js.map
@@ -0,0 +1,40 @@
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
+ import 'better-sqlite3';
3
+ import '../config-types-Bj4sh28g.js';
4
+
5
+ type VueComposableEvidenceClass = 'domain-behavior' | 'generic-workflow-scaffolding' | 'mixed' | 'shared-abstraction';
6
+ type VueComposableActionTier = 'signal' | 'support';
7
+ interface VueComposableCandidateResult {
8
+ fileA: string;
9
+ fileB: string;
10
+ similarity: number;
11
+ sharedTokens: string[];
12
+ sharedComposables: string[];
13
+ sharedStores: string[];
14
+ sharedReactivity: string[];
15
+ sharedLifecycle: string[];
16
+ sharedRequests: string[];
17
+ sharedFunctions: string[];
18
+ sharedFunctionVerbs: string[];
19
+ sharedBindings: string[];
20
+ sharedTemplateEvents: string[];
21
+ evidenceClass: VueComposableEvidenceClass;
22
+ actionTier: VueComposableActionTier;
23
+ evidenceClassReasons: string[];
24
+ recommendation: string;
25
+ uniqueToA: string[];
26
+ uniqueToB: string[];
27
+ reason: string;
28
+ locA: number;
29
+ locB: number;
30
+ }
31
+ declare function vueComposableCandidates(db: ScipDatabase, opts?: {
32
+ minSimilarity?: number;
33
+ minSharedBehaviors?: number;
34
+ limit?: number;
35
+ scope?: string;
36
+ scanLimit?: number;
37
+ filePattern?: string;
38
+ }): VueComposableCandidateResult[];
39
+
40
+ export { type VueComposableActionTier, type VueComposableCandidateResult, type VueComposableEvidenceClass, vueComposableCandidates };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-O4L4AB3T.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
2
+ //# sourceMappingURL=vue-composable-candidates.js.map
@@ -0,0 +1,37 @@
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
+ import 'better-sqlite3';
3
+ import '../config-types-Bj4sh28g.js';
4
+
5
+ type VueLargeViewPressureAxis = 'template' | 'script' | 'style' | 'external-script' | 'custom-block' | 'total';
6
+ type VueLargeViewContextKind = 'component' | 'route-page';
7
+ type VueLargeViewRecommendationKind = 'custom-block-review' | 'external-script-boundary' | 'route-page-decomposition' | 'script-behavior-extraction' | 'style-decomposition' | 'template-decomposition' | 'total-size-review';
8
+ interface VueLargeViewPressureResult {
9
+ file: string;
10
+ totalLines: number;
11
+ sfcLines: number;
12
+ templateLines: number;
13
+ scriptLines: number;
14
+ styleLines: number;
15
+ externalScriptLines: number;
16
+ externalScriptPaths: string[];
17
+ customBlockLines: number;
18
+ dominantPressure: VueLargeViewPressureAxis;
19
+ pressureKinds: VueLargeViewPressureAxis[];
20
+ contextKind: VueLargeViewContextKind;
21
+ recommendationKind: VueLargeViewRecommendationKind;
22
+ recommendation: string;
23
+ reasons: string[];
24
+ loc: number;
25
+ }
26
+ declare function vueLargeViewPressure(db: ScipDatabase, opts?: {
27
+ minTotalLines?: number;
28
+ minTemplateLines?: number;
29
+ minScriptLines?: number;
30
+ minStyleLines?: number;
31
+ limit?: number;
32
+ scope?: string;
33
+ scanLimit?: number;
34
+ filePattern?: string;
35
+ }): VueLargeViewPressureResult[];
36
+
37
+ export { type VueLargeViewContextKind, type VueLargeViewPressureAxis, type VueLargeViewPressureResult, type VueLargeViewRecommendationKind, vueLargeViewPressure };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-O3OKSF6O.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueLargeViewPressure};
2
+ //# sourceMappingURL=vue-large-view-pressure.js.map
@@ -1,7 +1,8 @@
1
- import { S as ScipDatabase } from '../db-DdTPetj5.js';
1
+ import { S as ScipDatabase } from '../db-CTarohbZ.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-CGIeLEpY.js';
3
+ import '../config-types-Bj4sh28g.js';
4
4
 
5
+ type WrapperActionTier = 'direct' | 'signal';
5
6
  interface WrapperCandidate {
6
7
  symbol: string;
7
8
  shortName: string;
@@ -12,6 +13,8 @@ interface WrapperCandidate {
12
13
  singleCaller: string;
13
14
  singleCallerShort: string;
14
15
  callerFanIn: number;
16
+ actionTier: WrapperActionTier;
17
+ boundaryEvidence: string[];
15
18
  }
16
19
  /**
17
20
  * Find wrapper candidates: symbols called by only one other symbol.
@@ -28,4 +31,4 @@ declare function wrapperCandidates(db: ScipDatabase, opts?: {
28
31
  semantic?: boolean;
29
32
  }): WrapperCandidate[];
30
33
 
31
- export { type WrapperCandidate, wrapperCandidates };
34
+ export { type WrapperActionTier, type WrapperCandidate, wrapperCandidates };
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-WN5Z3UVT.js";import"../chunk-WJIS6BNI.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-IW7ASGVF.js";import"../chunk-QYKKTYBN.js";import"../chunk-VDZIEDJB.js";import"../chunk-5QJIEYFB.js";import"../chunk-VGBSY6N7.js";import"../chunk-ZF6P2NAT.js";import"../chunk-4MHT7LKP.js";import"../chunk-IVAIPXNO.js";import"../chunk-FVVT7GV6.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-O6KCZPJQ.js";import"../chunk-OH5HIAID.js";import"../chunk-ISCKLDSS.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as wrapperCandidates};
1
+ import{a}from"../chunk-SPE4YCOT.js";import"../chunk-RHTJBYZ5.js";import"../chunk-VAA5FFIW.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
2
2
  //# sourceMappingURL=wrapper-candidates.js.map
@@ -1,13 +1,13 @@
1
- import{a as P,b as N}from"./chunk-TH4JVC34.js";import{a as m,e as M}from"./chunk-LWYIGRHR.js";import{execFileSync as ln}from"child_process";import{closeSync as pn,existsSync as E,mkdirSync as ie,mkdtempSync as cn,openSync as gn,readFileSync as dn,renameSync as $,rmSync as B,writeFileSync as ae}from"fs";import{basename as S,dirname as d,extname as mn,join as g}from"path";import{execFileSync as ge}from"child_process";import{existsSync as de,readdirSync as A}from"fs";import{extname as _,join as T}from"path";var me=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),fe=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function U(e){let n=[],t=he(e),r=Se(e);for(let i of fe){if(xe(e,i.files)){n.push(i.language);continue}if(ye(t,i.globs)){n.push(i.language);continue}ve(r,i.extensions)&&n.push(i.language)}return n.includes("typescript")&&F(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&F(n,"c"),n}function he(e){try{return A(e)}catch{return[]}}function xe(e,n){return n?.length?n.some(t=>de(T(e,t))):!1}function ye(e,n){return n?.length?e.some(t=>n.some(r=>be(t,r))):!1}function be(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function Se(e){let n=Pe(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let a;try{a=A(i,{withFileTypes:!0})}catch{continue}for(let s of a){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=T(i,s.name);if(s.isDirectory()){me.has(s.name)||r.push(o);continue}let c=_(s.name).toLowerCase();c&&t.add(c)}}return t}function Pe(e){try{let n=ge("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
2
- `)){if(!r)continue;let i=_(r).toLowerCase();i&&t.add(i)}return t}catch{return null}}function ve(e,n){return n?.length?n.some(t=>e.has(t)):!1}function F(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as W,readdirSync as Ie}from"fs";import{join as v}from"path";var ke={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=v(e,"vendor","bin","scip-php"),r=v(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",W(r)?r:W(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function z(e){return ke[e]}function q(e,n){let t;try{t=Ie(e)}catch{return null}for(let r of t)if(n.some(i=>r.endsWith(i)))return v(e,r);return null}import{readFileSync as Re,writeFileSync as De}from"fs";import{create as I}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as je,DocumentSchema as Oe,IndexSchema as Le,SymbolInformationSchema as we}from"@c4312/scip";function Ee(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=$e(e),t=Be(e.flatMap(i=>i.documents??[])),r=G(e.flatMap(i=>i.externalSymbols??[]));return I(Le,{metadata:n,documents:t,externalSymbols:r})}function J(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(i=>Ce(Re(i))),r=Ee(t);return De(n,Buffer.from(je(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function $e(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(t&&i&&i!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${i}`)}return n}function Be(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,I(Oe,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:G([...r.symbols,...t.symbols]),text:Ne(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function G(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,I(we,{symbol:r.symbol,documentation:Fe([...r.documentation,...t.documentation]),relationships:Me([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Me(e){let n=new Set,t=[];for(let r of e){let i=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(i)||(n.add(i),t.push(r))}return t}function Ne(e,n){return e?n?e.length>=n.length?e:n:e:n}function Fe(e){return[...new Set(e)]}import{readFileSync as Ae,writeFileSync as _e}from"fs";import{create as H}from"@bufbuild/protobuf";import{deserializeSCIP as Te,DocumentSchema as Ue,IndexSchema as We,serializeSCIP as qe,SymbolRole as ze}from"@c4312/scip";function X(e){let n;try{n=Te(Ae(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Je(n);return t.removedDefinitionOccurrences>0&&_e(e,Buffer.from(qe(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Je(e){let n=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&n.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&n.add(a.symbol);let t=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles&ze.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(H(Ue,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:t===0?e:H(We,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Ge}from"child_process";import{existsSync as h,renameSync as R,rmSync as D}from"fs";import{cpus as He}from"os";import{join as Q}from"path";function Xe(e,n,t){if(!e.defaultOutputPath)return;let r=Q(n,e.defaultOutputPath);t!==r&&h(r)&&R(r,t)}function Qe(e,n,t){if(!e.defaultOutputPath)return null;let r=Q(n,e.defaultOutputPath);if(r===t)return null;let i=`${t}.default-output-backup`;return D(i,{force:!0}),h(r)?(R(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ke(e){e&&(D(e.defaultOutputPath,{force:!0}),e.backupPath&&h(e.backupPath)&&R(e.backupPath,e.defaultOutputPath))}function Ve(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,He().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function K(e,n,t,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Ve(a.length,r),c=await Ze(a,o,u=>k(u,n,t));if(o>1){let u=new Map;for(let p of c.filter(l=>l.skipped)){let l=a.find(f=>f.language===p.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await k(l,n,t)))}s.push(...c.map(p=>u.get(p.language)??p))}else s.push(...c);for(let u of i)s.push(await k(u,n,t));return s.sort((u,p)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===p.language))}async function k(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),D(e.scipPath,{force:!0});let r=Qe(e.config,n,e.scipPath);try{await Ye(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Xe(e.config,n,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
3
- `)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Ke(r)}if(!h(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${i}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:i}}}return{language:e.language,scipPath:e.scipPath}}function Ye(e,n,t){return new Promise((r,i)=>{Ge(e,[...n],t,a=>{a?i(a):r()})})}async function Ze(e,n,t){if(e.length===0)return[];let r=new Array(e.length),i=0,a=Math.max(1,Math.min(e.length,n)),s=Array.from({length:a},async()=>{for(;i<e.length;){let o=i++;r[o]=await t(e[o])}});return await Promise.all(s),r}import{execFileSync as j}from"child_process";import{existsSync as C,readFileSync as en}from"fs";import{createRequire as nn}from"module";import{platform as tn}from"os";import{dirname as V,join as x}from"path";var rn=nn(import.meta.url);function O(e){return[e.indexerBinary,...e.binaryAliases??[]]}function L(e){let n=O(e);return n.length===1?n[0]:n.join(" or ")}function y(e){for(let n of O(e))if(m(n))return n;return sn(e)}function Y(e){return y(e)!==null||an(e)}function an(e){return Z(e)!==null}function sn(e){let n=Z(e);if(!n)return null;let r=JSON.parse(en(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return x(V(n),r);for(let i of O(e)){let a=r[i];if(a)return x(V(n),a)}return null}function Z(e){if(!e.bundledNpmPackage)return null;try{return rn.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ee(e,n){for(let t of e.projectLocalBinaries??[]){let r=x(n,t);if(C(r))return r}return null}function ne(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||re(t,n))return n;let r=on(t,n);return r?{...n,DOTNET_ROOT:r}:n}function te(e,n){let t=e.installMethods,r=L(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let i of t)if(m(i.prerequisite)){n(`Installing ${r} via ${i.label}...`);try{j(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let a=y(e);if(a){let s=a===e.indexerBinary?"":` (using ${a})`;return n(`Successfully installed ${r} via ${i.label}${s}`),!0}n(`${i.label} command completed but ${r} was not found on PATH`)}catch(a){let s=a instanceof Error?a.message:String(a);n(`${i.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function on(e,n){for(let t of un(n))if(re(e,{...n,DOTNET_ROOT:t}))return t;return null}function un(e){let n=[],t=e.DOTNET_ROOT;if(t&&C(t)&&n.push(t),tn()==="darwin"&&m("brew"))try{let r=j("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=x(r,"libexec");C(i)&&!n.includes(i)&&n.push(i)}catch{}return n}function re(e,n){try{return j(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}async function se(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=fn(e),s=Date.now();ie(d(a.outputScip),{recursive:!0}),ie(d(a.outputDb),{recursive:!0});let o=e.languages??U(n);if(o.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${o.join(", ")}`);let c=wn(n,o,{pnpmWorkspaces:e.pnpmWorkspaces}),u=On(g(d(a.outputDb),"index.lock")),p=null;try{let l=hn({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(l)return l;Pn(i,r);let f=xn(a);return p=f.runDir,await yn({opts:e,languages:o,projectRoot:n,paths:a,tempPaths:f,fingerprint:c,start:s,maxHeapMb:t,skipAutoInstall:i,onStatus:r})}finally{p&&B(p,{recursive:!0,force:!0}),u()}}function fn(e){let n=e.outputScip??g(e.projectRoot,"index.scip"),t=e.outputDb??g(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:g(d(t),"meta.json")}}function hn(e){if(e.opts.skipIfUnchanged===!1||!E(e.paths.outputScip)||!E(e.paths.outputDb)||!En(e.paths.metaPath,e.fingerprint))return null;P({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function xn(e){let n=cn(g(d(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:g(n,S(e.outputScip)),tempOutputDb:g(n,S(e.outputDb)),tempMetaPath:g(n,S(e.metaPath))}}async function yn(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r}=await bn(e,n);Sn(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(a=>a.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function bn(e,n){let{preparedRuns:t,skippedLanguages:r}=vn({languages:e.languages,tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),i=await K(t,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:a}=kn(i,r);return Rn(a,r,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:a,skippedLanguages:r}}function Sn(e,n,t,r){Dn(t,e.tempPaths.tempOutputScip,e.onStatus),Cn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),P({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),$n(e.tempPaths.tempMetaPath,{version:2,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,requestedLanguages:e.languages,indexedLanguages:t.map(i=>i.language),skipped:[...r]}),Ln({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function Pn(e,n){if(!m("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
4
- Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!M(n))throw new Error(`The scip CLI is required but could not be installed.
5
- Install manually from: https://github.com/sourcegraph/scip/releases`)}}function vn(e){let n=[],t=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?jn(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=In({...e,language:i,scipPath:a});"skipped"in s?t.push(s.skipped):n.push(s.prepared)}return{preparedRuns:n,skippedLanguages:t}}function In(e){let n=z(e.language),t=L(n),r=ee(n,e.projectRoot);if(!r&&!Y(n)){if(e.skipAutoInstall){let o=`${t} not found on PATH (auto-install disabled). ${n.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${t} not found. Attempting auto-install...`),!te(n,e.onStatus)){let o=`${t} could not be auto-installed. ${n.installUrl?`Install manually from ${n.installUrl}`:`Install ${t} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let i=r??y(n);if(!i){let o=`${t} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:a,args:s}=n.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:i});return{prepared:{language:e.language,scipPath:e.scipPath,config:n,resolvedBinary:i,binary:a,args:s,env:ne(n,e.env,i)}}}function kn(e,n){let t=[];for(let r of e)r.skipped?n.push(r.skipped):t.push({language:r.language,scipPath:r.scipPath});return{indexedOutputs:t}}function Rn(e,n,t,r,i){if(e.length===0){let a=n.map(s=>` - ${s.language}: ${s.reason}`).join(`
1
+ import{a as v,b as I}from"./chunk-KPHKX4LP.js";import{a as m,e as A}from"./chunk-NXIAHE7F.js";import{execFileSync as gn}from"child_process";import{closeSync as dn,copyFileSync as mn,existsSync as P,mkdirSync as B,mkdtempSync as fn,openSync as hn,readFileSync as ie,renameSync as M,rmSync as N,writeFileSync as se}from"fs";import{basename as S,dirname as d,extname as xn,join as g}from"path";import{execFileSync as fe}from"child_process";import{existsSync as he,readdirSync as T}from"fs";import{extname as U,join as W}from"path";var xe=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),ye=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function q(e){let n=[],t=be(e),r=Ie(e);for(let a of ye){if(Se(e,a.files)){n.push(a.language);continue}if(Pe(t,a.globs)){n.push(a.language);continue}ke(r,a.extensions)&&n.push(a.language)}return n.includes("typescript")&&_(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&_(n,"c"),n}function be(e){try{return T(e)}catch{return[]}}function Se(e,n){return n?.length?n.some(t=>he(W(e,t))):!1}function Pe(e,n){return n?.length?e.some(t=>n.some(r=>ve(t,r))):!1}function ve(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function Ie(e){let n=Re(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let a=r.pop();if(!a)continue;let i;try{i=T(a,{withFileTypes:!0})}catch{continue}for(let s of i){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=W(a,s.name);if(s.isDirectory()){xe.has(s.name)||r.push(o);continue}let p=U(s.name).toLowerCase();p&&t.add(p)}}return t}function Re(e){try{let n=fe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
2
+ `)){if(!r)continue;let a=U(r).toLowerCase();a&&t.add(a)}return t}catch{return null}}function ke(e,n){return n?.length?n.some(t=>e.has(t)):!1}function _(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as z,readdirSync as De}from"fs";import{join as R}from"path";var Oe={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=R(e,"vendor","bin","scip-php"),r=R(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",z(r)?r:z(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function k(e){return Oe[e]}function J(e,n){let t;try{t=De(e)}catch{return null}for(let r of t)if(n.some(a=>r.endsWith(a)))return R(e,r);return null}import{readFileSync as Le,writeFileSync as je}from"fs";import{create as D}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as we,DocumentSchema as Ee,IndexSchema as $e,SymbolInformationSchema as Fe}from"@c4312/scip";function Be(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=Me(e),t=Ne(e.flatMap(a=>a.documents??[])),r=H(e.flatMap(a=>a.externalSymbols??[]));return D($e,{metadata:n,documents:t,externalSymbols:r})}function G(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(a=>Ce(Le(a))),r=Be(t);return je(n,Buffer.from(we(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Me(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let a=r.metadata?.projectRoot;if(t&&a&&a!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${a}`)}return n}function Ne(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,D(Ee,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:H([...r.symbols,...t.symbols]),text:_e(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function H(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,D(Fe,{symbol:r.symbol,documentation:Te([...r.documentation,...t.documentation]),relationships:Ae([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Ae(e){let n=new Set,t=[];for(let r of e){let a=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(a)||(n.add(a),t.push(r))}return t}function _e(e,n){return e?n?e.length>=n.length?e:n:e:n}function Te(e){return[...new Set(e)]}import{readFileSync as Ue,writeFileSync as We}from"fs";import{create as X}from"@bufbuild/protobuf";import{deserializeSCIP as qe,DocumentSchema as ze,IndexSchema as Je,serializeSCIP as Ge,SymbolRole as He}from"@c4312/scip";function Q(e){let n;try{n=qe(Ue(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Xe(n);return t.removedDefinitionOccurrences>0&&We(e,Buffer.from(Ge(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Xe(e){let n=new Set;for(let i of e.documents)for(let s of i.symbols)s.symbol&&n.add(s.symbol);for(let i of e.externalSymbols)i.symbol&&n.add(i.symbol);let t=0,r=0,a=[];for(let i of e.documents){let s=i.occurrences.filter(o=>(o.symbolRoles&He.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===i.occurrences.length){a.push(i);continue}r+=1,a.push(X(ze,{language:i.language,relativePath:i.relativePath,occurrences:s,symbols:i.symbols,text:i.text,positionEncoding:i.positionEncoding}))}return{index:t===0?e:X(Je,{metadata:e.metadata,documents:a,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Qe}from"child_process";import{existsSync as x,renameSync as L,rmSync as j}from"fs";import{cpus as Ke}from"os";import{join as K}from"path";function Ve(e,n,t){if(!e.defaultOutputPath)return;let r=K(n,e.defaultOutputPath);t!==r&&x(r)&&L(r,t)}function Ye(e,n,t){if(!e.defaultOutputPath)return null;let r=K(n,e.defaultOutputPath);if(r===t)return null;let a=`${t}.default-output-backup`;return j(a,{force:!0}),x(r)?(L(r,a),{defaultOutputPath:r,backupPath:a}):{defaultOutputPath:r,backupPath:null}}function Ze(e){e&&(j(e.defaultOutputPath,{force:!0}),e.backupPath&&x(e.backupPath)&&L(e.backupPath,e.defaultOutputPath))}function en(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,Ke().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function V(e,n,t,r){let a=e.filter(u=>u.config.defaultOutputPath),i=e.filter(u=>!u.config.defaultOutputPath),s=[],o=en(i.length,r),p=await tn(i,o,u=>O(u,n,t));if(o>1){let u=new Map;for(let c of p.filter(l=>l.skipped)){let l=i.find(h=>h.language===c.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await O(l,n,t)))}s.push(...p.map(c=>u.get(c.language)??c))}else s.push(...p);for(let u of a)s.push(await O(u,n,t));return s.sort((u,c)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===c.language))}async function O(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),j(e.scipPath,{force:!0});let r=Ye(e.config,n,e.scipPath);try{await nn(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Ve(e.config,n,e.scipPath)}catch(a){let i=a instanceof Error?a.message:String(a),s=`${e.resolvedBinary} indexer failed: ${i.split(`
3
+ `)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Ze(r)}if(!x(e.scipPath)){let a=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${a}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:a}}}return{language:e.language,scipPath:e.scipPath}}function nn(e,n,t){return new Promise((r,a)=>{Qe(e,[...n],t,i=>{i?a(i):r()})})}async function tn(e,n,t){if(e.length===0)return[];let r=new Array(e.length),a=0,i=Math.max(1,Math.min(e.length,n)),s=Array.from({length:i},async()=>{for(;a<e.length;){let o=a++;r[o]=await t(e[o])}});return await Promise.all(s),r}import{execFileSync as w}from"child_process";import{existsSync as C,readFileSync as rn}from"fs";import{createRequire as an}from"module";import{platform as sn}from"os";import{dirname as Y,join as y}from"path";var on=an(import.meta.url);function E(e){return[e.indexerBinary,...e.binaryAliases??[]]}function $(e){let n=E(e);return n.length===1?n[0]:n.join(" or ")}function b(e){for(let n of E(e))if(m(n))return n;return ln(e)}function Z(e){return b(e)!==null||un(e)}function un(e){return ee(e)!==null}function ln(e){let n=ee(e);if(!n)return null;let r=JSON.parse(rn(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return y(Y(n),r);for(let a of E(e)){let i=r[a];if(i)return y(Y(n),i)}return null}function ee(e){if(!e.bundledNpmPackage)return null;try{return on.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ne(e,n){for(let t of e.projectLocalBinaries??[]){let r=y(n,t);if(C(r))return r}return null}function te(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||ae(t,n))return n;let r=pn(t,n);return r?{...n,DOTNET_ROOT:r}:n}function re(e,n){let t=e.installMethods,r=$(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let a of t)if(m(a.prerequisite)){n(`Installing ${r} via ${a.label}...`);try{w(a.binary,a.args,{stdio:"inherit",timeout:3e5,env:process.env});let i=b(e);if(i){let s=i===e.indexerBinary?"":` (using ${i})`;return n(`Successfully installed ${r} via ${a.label}${s}`),!0}n(`${a.label} command completed but ${r} was not found on PATH`)}catch(i){let s=i instanceof Error?i.message:String(i);n(`${a.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function pn(e,n){for(let t of cn(n))if(ae(e,{...n,DOTNET_ROOT:t}))return t;return null}function cn(e){let n=[],t=e.DOTNET_ROOT;if(t&&C(t)&&n.push(t),sn()==="darwin"&&m("brew"))try{let r=w("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),a=y(r,"libexec");C(a)&&!n.includes(a)&&n.push(a)}catch{}return n}function ae(e,n){try{return w(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}async function oe(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:a=!1}=e,i=yn(e),s=Date.now();B(d(i.outputScip),{recursive:!0}),B(d(i.outputDb),{recursive:!0});let o=e.languages??q(n);if(o.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${o.join(", ")}`);let p=Mn(n,o,{pnpmWorkspaces:e.pnpmWorkspaces}),u=Fn(g(d(i.outputDb),"index.lock")),c=null;try{let l=bn({opts:e,paths:i,languages:o,fingerprint:p,start:s,onStatus:r});if(l)return l;Dn(a,r);let h=Sn(i);return c=h.runDir,await Pn({opts:e,languages:o,projectRoot:n,paths:i,tempPaths:h,fingerprint:p,start:s,maxHeapMb:t,skipAutoInstall:a,onStatus:r})}finally{c&&N(c,{recursive:!0,force:!0}),u()}}function yn(e){let n=e.outputScip??g(e.projectRoot,"index.scip"),t=e.outputDb??g(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:g(d(t),"meta.json")}}function bn(e){if(e.opts.skipIfUnchanged===!1||!P(e.paths.outputScip)||!P(e.paths.outputDb)||!Nn(e.paths.metaPath,e.fingerprint))return null;v({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function Sn(e){let n=fn(g(d(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:g(n,S(e.outputScip)),tempOutputDb:g(n,S(e.outputDb)),tempMetaPath:g(n,S(e.metaPath))}}async function Pn(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r,reusedLanguages:a}=await vn(e,n);a.length>0&&e.onStatus(`Reused ${a.length} cached language shard(s): ${a.join(", ")}`),In(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(s=>s.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function vn(e,n){let t=Rn(e),r=new Set(t.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:a,skippedLanguages:i}=On({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),s=await V(a,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=jn(s,i),p=[...t,...o];return Cn(p,i,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:p,skippedLanguages:i,reusedLanguages:[...r]}}function In(e,n,t,r){kn(e.paths.outputDb,t),wn(t,e.tempPaths.tempOutputScip,e.onStatus),En(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),v({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),An(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces}),requestedLanguages:e.languages,indexedLanguages:t.map(a=>a.language),skipped:[...r]}),Bn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function Rn(e){let n;try{n=JSON.parse(ie(e.paths.metaPath,"utf-8"))}catch{return[]}if(n.version!==3||!n.languageFingerprints)return[];let t=[],r=ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces});for(let a of e.languages){let i=le(e.paths.outputDb,a);P(i)&&f(n.languageFingerprints[a])===f(r[a])&&t.push({language:a,scipPath:i})}return t}function kn(e,n){for(let t of n){let r=le(e,t.language);B(d(r),{recursive:!0}),t.scipPath!==r&&mn(t.scipPath,r)}}function Dn(e,n){if(!m("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
4
+ Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!A(n))throw new Error(`The scip CLI is required but could not be installed.
5
+ Install manually from: https://github.com/sourcegraph/scip/releases`)}}function On(e){let n=[],t=[],r=e.languages.map((a,i)=>({language:a,scipPath:e.languages.length>1?$n(e.tempOutputScip,a,i):e.tempOutputScip}));for(let{language:a,scipPath:i}of r){let s=Ln({...e,language:a,scipPath:i});"skipped"in s?t.push(s.skipped):n.push(s.prepared)}return{preparedRuns:n,skippedLanguages:t}}function Ln(e){let n=k(e.language),t=$(n),r=ne(n,e.projectRoot);if(!r&&!Z(n)){if(e.skipAutoInstall){let o=`${t} not found on PATH (auto-install disabled). ${n.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${t} not found. Attempting auto-install...`),!re(n,e.onStatus)){let o=`${t} could not be auto-installed. ${n.installUrl?`Install manually from ${n.installUrl}`:`Install ${t} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let a=r??b(n);if(!a){let o=`${t} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:i,args:s}=n.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:a});return{prepared:{language:e.language,scipPath:e.scipPath,config:n,resolvedBinary:a,binary:i,args:s,env:te(n,e.env,a)}}}function jn(e,n){let t=[];for(let r of e)r.skipped?n.push(r.skipped):t.push({language:r.language,scipPath:r.scipPath});return{indexedOutputs:t}}function Cn(e,n,t,r,a){if(e.length===0){let i=n.map(s=>` - ${s.language}: ${s.reason}`).join(`
6
6
  `);throw new Error(`No language indexers ran successfully. Install at least one indexer for the languages in this project.
7
- `+a)}if(n.length!==0&&(i(`Indexed ${e.length} of ${t.length} languages; skipped ${n.map(a=>a.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
8
- `+n.map(a=>` - ${a.language}: ${a.reason}`).join(`
9
- `))}function Dn(e,n,t){e.length>1?(t(`Merging ${e.length} language indexes...`),J(e.map(r=>r.scipPath),n)):e[0].scipPath!==n&&$(e[0].scipPath,n)}function Cn(e,n,t,r){if(r("Converting to SQLite..."),!E(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=X(e);i.removedDefinitionOccurrences>0&&r(`Sanitized ${i.removedDefinitionOccurrences} invalid definition occurrences across ${i.touchedDocuments} documents before SQLite conversion.`),ln("scip",["expt-convert","--output",n,e],{env:t,stdio:"pipe",maxBuffer:50*1024*1024})}catch(i){let a=i instanceof Error?i.message:String(i);throw new Error(`Failed to convert SCIP index to SQLite: ${a}`,{cause:i})}}function jn(e,n,t){let r=mn(e)||".scip",i=S(e,r);return g(d(e),`${i}.${t+1}.${n}${r}`)}function On(e){let n;try{n=gn(e,"wx")}catch(t){throw(typeof t=="object"&&t&&"code"in t?t.code:void 0)==="EEXIST"?new Error(`Another scip-query reindex is already running for ${d(e)}.`,{cause:t}):t}return ae(n,JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()})+`
10
- `),()=>{try{pn(n)}finally{B(e,{force:!0})}}}function Ln(e){w(e.tempOutputScip,e.outputScip),w(e.tempOutputDb,e.outputDb),w(e.tempMetaPath,e.metaPath)}function w(e,n){B(`${n}.tmp-replace`,{force:!0}),$(e,`${n}.tmp-replace`),$(`${n}.tmp-replace`,n)}function wn(e,n,t){return{version:1,languages:[...n].sort(),pnpmWorkspaces:t.pnpmWorkspaces===!0,files:N(e)}}function En(e,n){try{let t=JSON.parse(dn(e,"utf-8"));return t.version===2&&t.status==="complete"&&b(t.fingerprint)===b(n)&&b([...t.indexedLanguages??[]].sort())===b(n.languages)}catch{return!1}}function $n(e,n){ae(e,`${JSON.stringify(n,null,2)}
11
- `)}function b(e){return JSON.stringify(e)}var le=process.env.SCIP_REINDEX_PROJECT_ROOT,pe=process.env.SCIP_REINDEX_OUTPUT_SCIP,ce=process.env.SCIP_REINDEX_OUTPUT_DB,oe=process.env.SCIP_REINDEX_LANGUAGES,Bn=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1";(!le||!pe||!ce)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var ue=oe?oe.split(",").filter(Boolean):void 0;se({projectRoot:le,outputScip:pe,outputDb:ce,languages:ue?.length?ue:void 0,pnpmWorkspaces:Bn,onStatus:e=>process.stderr.write(`[reindex] ${e}
7
+ `+i)}if(n.length!==0&&(a(`Indexed ${e.length} of ${t.length} languages; skipped ${n.map(i=>i.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
8
+ `+n.map(i=>` - ${i.language}: ${i.reason}`).join(`
9
+ `))}function wn(e,n,t){e.length>1?(t(`Merging ${e.length} language indexes...`),G(e.map(r=>r.scipPath),n)):e[0].scipPath!==n&&M(e[0].scipPath,n)}function En(e,n,t,r){if(r("Converting to SQLite..."),!P(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let a=Q(e);a.removedDefinitionOccurrences>0&&r(`Sanitized ${a.removedDefinitionOccurrences} invalid definition occurrences across ${a.touchedDocuments} documents before SQLite conversion.`),gn("scip",["expt-convert","--output",n,e],{env:t,stdio:"pipe",maxBuffer:50*1024*1024})}catch(a){let i=a instanceof Error?a.message:String(a);throw new Error(`Failed to convert SCIP index to SQLite: ${i}`,{cause:a})}}function $n(e,n,t){let r=xn(e)||".scip",a=S(e,r);return g(d(e),`${a}.${t+1}.${n}${r}`)}function Fn(e){let n;try{n=hn(e,"wx")}catch(t){throw(typeof t=="object"&&t&&"code"in t?t.code:void 0)==="EEXIST"?new Error(`Another scip-query reindex is already running for ${d(e)}.`,{cause:t}):t}return se(n,JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()})+`
10
+ `),()=>{try{dn(n)}finally{N(e,{force:!0})}}}function Bn(e){F(e.tempOutputScip,e.outputScip),F(e.tempOutputDb,e.outputDb),F(e.tempMetaPath,e.metaPath)}function F(e,n){N(`${n}.tmp-replace`,{force:!0}),M(e,`${n}.tmp-replace`),M(`${n}.tmp-replace`,n)}function Mn(e,n,t){return{version:1,languages:[...n].sort(),pnpmWorkspaces:t.pnpmWorkspaces===!0,files:I(e)}}function ue(e,n,t){return Object.fromEntries(n.map(r=>{let a=k(r).markerFiles;return[r,{version:1,languages:[r],pnpmWorkspaces:r==="typescript"&&t.pnpmWorkspaces===!0,files:I(e,{language:r,markerFiles:a})}]}))}function le(e,n){return g(d(e),"language-indexes",`${n}.scip`)}function Nn(e,n){try{let t=JSON.parse(ie(e,"utf-8"));return(t.version===2||t.version===3)&&t.status==="complete"&&f(t.fingerprint)===f(n)&&f([...t.indexedLanguages??[]].sort())===f(n.languages)}catch{return!1}}function An(e,n){se(e,`${JSON.stringify(n,null,2)}
11
+ `)}function f(e){return JSON.stringify(e)}var ge=process.env.SCIP_REINDEX_PROJECT_ROOT,de=process.env.SCIP_REINDEX_OUTPUT_SCIP,me=process.env.SCIP_REINDEX_OUTPUT_DB,pe=process.env.SCIP_REINDEX_LANGUAGES,_n=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1";(!ge||!de||!me)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var ce=pe?pe.split(",").filter(Boolean):void 0;oe({projectRoot:ge,outputScip:de,outputDb:me,languages:ce?.length?ce:void 0,pnpmWorkspaces:_n,onStatus:e=>process.stderr.write(`[reindex] ${e}
12
12
  `)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});
13
13
  //# sourceMappingURL=reindex-worker.js.map
package/dist/reindex.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SupportedLanguage, I as IndexerConfig } from './config-types-CGIeLEpY.js';
1
+ import { a as SupportedLanguage, I as IndexerConfig } from './config-types-Bj4sh28g.js';
2
2
  import { Index } from '@c4312/scip';
3
3
  export { t as tryInstallScipCli } from './scip-cli-a-xOztiK.js';
4
4