scip-query 0.10.10 → 0.10.12

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 (279) hide show
  1. package/README.md +56 -35
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-2DOW7QCA.js +71 -0
  4. package/dist/chunk-2FMFF4RI.js +2 -0
  5. package/dist/{chunk-J7RWXLUL.js → chunk-2GLNBCHB.js} +2 -2
  6. package/dist/chunk-2UVCH7CQ.js +2 -0
  7. package/dist/{chunk-LM5SHAN4.js → chunk-3XSNW5XB.js} +2 -2
  8. package/dist/chunk-4ISHQ7UW.js +35 -0
  9. package/dist/{chunk-XXZXDXTD.js → chunk-5GXTUANY.js} +2 -2
  10. package/dist/{chunk-TL6QPNF5.js → chunk-5JHEN5VN.js} +2 -2
  11. package/dist/chunk-62ULXMQ7.js +18 -0
  12. package/dist/chunk-63CI3IXR.js +102 -0
  13. package/dist/{chunk-Z4I7BVIU.js → chunk-6BN3EHQE.js} +2 -2
  14. package/dist/chunk-7C6JBBE4.js +23 -0
  15. package/dist/chunk-7EK7OSWS.js +2 -0
  16. package/dist/chunk-7IWIMNHI.js +2 -0
  17. package/dist/chunk-7XTO4YXB.js +8 -0
  18. package/dist/{chunk-5NVUWIAN.js → chunk-A4UTLKHU.js} +2 -2
  19. package/dist/{chunk-FDEQIPPK.js → chunk-ANUEY5WV.js} +2 -2
  20. package/dist/chunk-AOWFUGDL.js +2 -0
  21. package/dist/chunk-AREANYIA.js +3 -0
  22. package/dist/{chunk-7UQWUVRG.js → chunk-AZBELWZQ.js} +2 -2
  23. package/dist/{chunk-WG6KRH5F.js → chunk-CXWCLVYL.js} +2 -2
  24. package/dist/chunk-CYHIKTJN.js +3 -0
  25. package/dist/{chunk-BVRS7RKQ.js → chunk-DDQONX6B.js} +2 -2
  26. package/dist/{chunk-736BLPHR.js → chunk-DFSEARAU.js} +2 -2
  27. package/dist/{chunk-UFX7EPBA.js → chunk-DQ6433ZG.js} +2 -2
  28. package/dist/chunk-DVFP6PZI.js +2 -0
  29. package/dist/chunk-E3ADDB43.js +2 -0
  30. package/dist/{chunk-YWOOQ4FF.js → chunk-ELC77ZDE.js} +1 -1
  31. package/dist/chunk-EOLGSSDR.js +2 -0
  32. package/dist/chunk-F6IXELII.js +20 -0
  33. package/dist/{chunk-QYB5P7GL.js → chunk-FMGVZBS2.js} +2 -2
  34. package/dist/{chunk-VOYOYC5T.js → chunk-FX6ULETZ.js} +2 -2
  35. package/dist/chunk-GG5LHT27.js +2 -0
  36. package/dist/chunk-GKB4JJDU.js +2 -0
  37. package/dist/chunk-H7JF2CKK.js +2 -0
  38. package/dist/chunk-HHOMJCP5.js +4 -0
  39. package/dist/chunk-HRDSU5FN.js +9 -0
  40. package/dist/{chunk-BZ53S4ZN.js → chunk-HWVYTJOV.js} +2 -2
  41. package/dist/chunk-JJ5SAWBT.js +2 -0
  42. package/dist/chunk-JNMLBL36.js +2 -0
  43. package/dist/chunk-JS6B76AQ.js +2 -0
  44. package/dist/{chunk-ZQO43G2T.js → chunk-KZ4MG5NY.js} +2 -2
  45. package/dist/{chunk-UQLFQLAF.js → chunk-L446VQYQ.js} +2 -2
  46. package/dist/{chunk-NZ4UDB5N.js → chunk-LDJUB7XW.js} +2 -2
  47. package/dist/{chunk-MMLZEGMS.js → chunk-LEHVP4DY.js} +2 -2
  48. package/dist/chunk-MNCQPMCH.js +2 -0
  49. package/dist/chunk-MYTUWXHK.js +4 -0
  50. package/dist/chunk-N25HPUOK.js +2 -0
  51. package/dist/chunk-NABVR6B7.js +2 -0
  52. package/dist/{chunk-PTQVNJ4Q.js → chunk-NBNEVLRC.js} +2 -2
  53. package/dist/chunk-NTSR6SRP.js +2 -0
  54. package/dist/{chunk-RYXW3KRC.js → chunk-OFXN2BCT.js} +2 -2
  55. package/dist/chunk-PWAK75BU.js +2 -0
  56. package/dist/chunk-Q5P7NOVM.js +2 -0
  57. package/dist/chunk-RGKRYO22.js +4 -0
  58. package/dist/chunk-RM2WQ75T.js +2 -0
  59. package/dist/chunk-ROGZXWN2.js +2 -0
  60. package/dist/chunk-RSSXKJ6J.js +38 -0
  61. package/dist/chunk-RUV5IY25.js +7 -0
  62. package/dist/chunk-RVGEZYMQ.js +2 -0
  63. package/dist/{chunk-IPQTC36U.js → chunk-RXINFVBN.js} +2 -2
  64. package/dist/{chunk-RXRLZFUL.js → chunk-S2MRVIJ5.js} +2 -2
  65. package/dist/chunk-SA3DPTHT.js +7 -0
  66. package/dist/chunk-SGTKURU6.js +52 -0
  67. package/dist/chunk-SQNHOOJ5.js +3 -0
  68. package/dist/chunk-T3AEVJBG.js +4 -0
  69. package/dist/{chunk-DQVKIG3D.js → chunk-T4N2ZRVY.js} +2 -2
  70. package/dist/{chunk-5VG7RKEF.js → chunk-TBCHRDAC.js} +2 -2
  71. package/dist/chunk-THB6AM3V.js +11 -0
  72. package/dist/chunk-ULHLDOD6.js +4 -0
  73. package/dist/chunk-UQ73QF5D.js +43 -0
  74. package/dist/chunk-UVPY3RUZ.js +2 -0
  75. package/dist/chunk-V5FGK3DZ.js +2 -0
  76. package/dist/{chunk-3DGD6NKW.js → chunk-VB2EZZPA.js} +2 -2
  77. package/dist/{chunk-56P7PDST.js → chunk-WTY5FERW.js} +2 -2
  78. package/dist/chunk-WUOB4DHH.js +6 -0
  79. package/dist/chunk-XHMVZFA6.js +2 -0
  80. package/dist/chunk-XRUGSM76.js +10 -0
  81. package/dist/{chunk-UYD7FJ3K.js → chunk-XUCZ3RQ5.js} +2 -2
  82. package/dist/chunk-YFQIKYOP.js +2 -0
  83. package/dist/chunk-Z2LDWIJV.js +5 -0
  84. package/dist/chunk-ZNWWVYQL.js +3 -0
  85. package/dist/{chunk-UDGXK2WA.js → chunk-ZUUNREKS.js} +2 -2
  86. package/dist/cli.js +277 -252
  87. package/dist/{config-types-BDIWAYzr.d.ts → config-types-dvHOz0zU.d.ts} +4 -1
  88. package/dist/{db-Djj3Nqrb.d.ts → db-rMZO5JFK.d.ts} +1 -1
  89. package/dist/{health-D5J42g4D.d.ts → health-CtTIGh6H.d.ts} +1 -1
  90. package/dist/index.d.ts +9 -5
  91. package/dist/index.js +2 -2
  92. package/dist/queries/affected.d.ts +2 -2
  93. package/dist/queries/affected.js +1 -1
  94. package/dist/queries/bottlenecks.d.ts +2 -2
  95. package/dist/queries/bottlenecks.js +1 -1
  96. package/dist/queries/by-kind.d.ts +2 -2
  97. package/dist/queries/by-kind.js +1 -1
  98. package/dist/queries/call-graph.d.ts +2 -2
  99. package/dist/queries/call-graph.js +1 -1
  100. package/dist/queries/change-surface.d.ts +2 -2
  101. package/dist/queries/change-surface.js +1 -1
  102. package/dist/queries/cleanup-plan.d.ts +2 -2
  103. package/dist/queries/cleanup-plan.js +1 -1
  104. package/dist/queries/co-change.d.ts +2 -2
  105. package/dist/queries/co-change.js +1 -1
  106. package/dist/queries/code.d.ts +2 -2
  107. package/dist/queries/code.js +1 -1
  108. package/dist/queries/complexity-hotspots.d.ts +2 -2
  109. package/dist/queries/complexity-hotspots.js +1 -1
  110. package/dist/queries/complexity.d.ts +2 -2
  111. package/dist/queries/complexity.js +1 -1
  112. package/dist/queries/convergence.d.ts +2 -2
  113. package/dist/queries/convergence.js +1 -1
  114. package/dist/queries/coupling.d.ts +2 -2
  115. package/dist/queries/coupling.js +1 -1
  116. package/dist/queries/cycles.d.ts +2 -2
  117. package/dist/queries/cycles.js +1 -1
  118. package/dist/queries/dataflow.d.ts +2 -2
  119. package/dist/queries/dataflow.js +1 -1
  120. package/dist/queries/dead.d.ts +2 -2
  121. package/dist/queries/dead.js +1 -1
  122. package/dist/queries/deep-chains.d.ts +2 -2
  123. package/dist/queries/deep-chains.js +1 -1
  124. package/dist/queries/deps.d.ts +2 -2
  125. package/dist/queries/deps.js +1 -1
  126. package/dist/queries/diff-gate.d.ts +2 -2
  127. package/dist/queries/diff-gate.js +1 -1
  128. package/dist/queries/diff-impact.d.ts +2 -2
  129. package/dist/queries/diff-impact.js +1 -1
  130. package/dist/queries/doc-drift.d.ts +2 -2
  131. package/dist/queries/doc-drift.js +1 -1
  132. package/dist/queries/drift.d.ts +2 -2
  133. package/dist/queries/drift.js +1 -1
  134. package/dist/queries/extract-candidates.d.ts +2 -2
  135. package/dist/queries/extract-candidates.js +1 -1
  136. package/dist/queries/fan.d.ts +2 -2
  137. package/dist/queries/fan.js +1 -1
  138. package/dist/queries/files.d.ts +2 -2
  139. package/dist/queries/health.d.ts +3 -3
  140. package/dist/queries/health.js +1 -1
  141. package/dist/queries/hierarchy.d.ts +2 -2
  142. package/dist/queries/hierarchy.js +1 -1
  143. package/dist/queries/hotspots.d.ts +2 -2
  144. package/dist/queries/hotspots.js +1 -1
  145. package/dist/queries/imports.d.ts +2 -2
  146. package/dist/queries/imports.js +1 -1
  147. package/dist/queries/incomplete-migration.d.ts +2 -2
  148. package/dist/queries/incomplete-migration.js +1 -1
  149. package/dist/queries/index.d.ts +4 -4
  150. package/dist/queries/index.js +1 -1
  151. package/dist/queries/isolated.d.ts +2 -2
  152. package/dist/queries/isolated.js +1 -1
  153. package/dist/queries/locality-candidates.d.ts +2 -2
  154. package/dist/queries/locality-candidates.js +1 -1
  155. package/dist/queries/members.d.ts +2 -2
  156. package/dist/queries/members.js +1 -1
  157. package/dist/queries/methods.d.ts +2 -2
  158. package/dist/queries/methods.js +1 -1
  159. package/dist/queries/outline.d.ts +2 -2
  160. package/dist/queries/outline.js +1 -1
  161. package/dist/queries/passthrough-candidates.d.ts +2 -2
  162. package/dist/queries/passthrough-candidates.js +1 -1
  163. package/dist/queries/plan-context.d.ts +2 -2
  164. package/dist/queries/plan-context.js +1 -1
  165. package/dist/queries/react-component-duplicates.d.ts +2 -2
  166. package/dist/queries/react-component-duplicates.js +1 -1
  167. package/dist/queries/react-hook-candidates.d.ts +2 -2
  168. package/dist/queries/react-hook-candidates.js +1 -1
  169. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  170. package/dist/queries/react-large-component-pressure.js +1 -1
  171. package/dist/queries/recent-duplicates.d.ts +2 -2
  172. package/dist/queries/recent-duplicates.js +1 -1
  173. package/dist/queries/redundant-reexports.d.ts +2 -2
  174. package/dist/queries/redundant-reexports.js +1 -1
  175. package/dist/queries/refs.d.ts +2 -2
  176. package/dist/queries/refs.js +1 -1
  177. package/dist/queries/self-audit.d.ts +7 -4
  178. package/dist/queries/self-audit.js +1 -1
  179. package/dist/queries/similar-chains.d.ts +2 -2
  180. package/dist/queries/similar-chains.js +1 -1
  181. package/dist/queries/similar-files.d.ts +2 -2
  182. package/dist/queries/similar-files.js +1 -1
  183. package/dist/queries/similar-signatures.d.ts +2 -2
  184. package/dist/queries/similar-signatures.js +1 -1
  185. package/dist/queries/similar.d.ts +55 -16
  186. package/dist/queries/similar.js +1 -1
  187. package/dist/queries/slice.d.ts +2 -2
  188. package/dist/queries/slice.js +1 -1
  189. package/dist/queries/stale-abstractions.d.ts +2 -2
  190. package/dist/queries/stale-abstractions.js +1 -1
  191. package/dist/queries/stats.d.ts +2 -2
  192. package/dist/queries/surface.d.ts +2 -2
  193. package/dist/queries/surface.js +1 -1
  194. package/dist/queries/symbols.d.ts +2 -2
  195. package/dist/queries/symbols.js +1 -1
  196. package/dist/queries/system.d.ts +2 -2
  197. package/dist/queries/system.js +1 -1
  198. package/dist/queries/trace.d.ts +2 -2
  199. package/dist/queries/trace.js +1 -1
  200. package/dist/queries/unused-imports.d.ts +2 -2
  201. package/dist/queries/unused-imports.js +1 -1
  202. package/dist/queries/unused-params.d.ts +2 -2
  203. package/dist/queries/unused-params.js +1 -1
  204. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  205. package/dist/queries/vue-component-duplicates.js +1 -1
  206. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  207. package/dist/queries/vue-composable-candidates.js +1 -1
  208. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  209. package/dist/queries/vue-large-view-pressure.js +1 -1
  210. package/dist/queries/wrapper-candidates.d.ts +2 -2
  211. package/dist/queries/wrapper-candidates.js +1 -1
  212. package/dist/reindex-worker.js +9 -9
  213. package/dist/reindex.d.ts +30 -4
  214. package/dist/reindex.js +19 -19
  215. package/dist/runtime.d.ts +4 -3
  216. package/dist/runtime.js +2 -2
  217. package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-trnNvymv.d.ts} +1 -1
  218. package/docs/COMMAND_REFERENCE.md +2 -2
  219. package/docs/analyzer-inventory.md +8 -0
  220. package/docs/analyzer-validation-ledger.md +7 -0
  221. package/package.json +3 -1
  222. package/scripts/evidence-product-contract.mjs +197 -0
  223. package/skills/scip-hyper-optimization/SKILL.md +153 -24
  224. package/skills/scip-hyper-optimization/agents/openai.yaml +3 -3
  225. package/dist/chunk-2UYQLFVC.js +0 -2
  226. package/dist/chunk-2VM46FC5.js +0 -8
  227. package/dist/chunk-3Q77KKEY.js +0 -2
  228. package/dist/chunk-3VD3JMK2.js +0 -2
  229. package/dist/chunk-4KTOV4QN.js +0 -3
  230. package/dist/chunk-4N4WONI4.js +0 -102
  231. package/dist/chunk-65AU3HFZ.js +0 -2
  232. package/dist/chunk-6LNQOOTB.js +0 -2
  233. package/dist/chunk-72KY2ZFO.js +0 -2
  234. package/dist/chunk-7JRRXGVZ.js +0 -2
  235. package/dist/chunk-A536TEU4.js +0 -3
  236. package/dist/chunk-A6IDHNMC.js +0 -4
  237. package/dist/chunk-A6TANQNV.js +0 -2
  238. package/dist/chunk-AW2QHPLL.js +0 -4
  239. package/dist/chunk-BSN22NRK.js +0 -9
  240. package/dist/chunk-C5CTSJ6X.js +0 -6
  241. package/dist/chunk-CCKPYPDI.js +0 -35
  242. package/dist/chunk-CZ425R2B.js +0 -18
  243. package/dist/chunk-DS6QEB3G.js +0 -5
  244. package/dist/chunk-F6ICF7HL.js +0 -40
  245. package/dist/chunk-FAYI6KZ5.js +0 -2
  246. package/dist/chunk-FG4NT6VY.js +0 -2
  247. package/dist/chunk-FRPEPTYJ.js +0 -5
  248. package/dist/chunk-GBEYTDY5.js +0 -2
  249. package/dist/chunk-GRJY65YT.js +0 -2
  250. package/dist/chunk-HF25DFSC.js +0 -3
  251. package/dist/chunk-HHN2B5KA.js +0 -2
  252. package/dist/chunk-I46WR7MT.js +0 -10
  253. package/dist/chunk-JM72FNGA.js +0 -2
  254. package/dist/chunk-KX5PLFZ5.js +0 -3
  255. package/dist/chunk-LPL4MA6R.js +0 -2
  256. package/dist/chunk-LZHUWKGD.js +0 -2
  257. package/dist/chunk-OBGRLXWF.js +0 -3
  258. package/dist/chunk-P5RYBRIO.js +0 -4
  259. package/dist/chunk-PFOCOG57.js +0 -2
  260. package/dist/chunk-PKMZCDQD.js +0 -4
  261. package/dist/chunk-QPU7EXAW.js +0 -2
  262. package/dist/chunk-QVI3NR7E.js +0 -7
  263. package/dist/chunk-QX7LLCGB.js +0 -23
  264. package/dist/chunk-RVWSAMTT.js +0 -2
  265. package/dist/chunk-SGLLBSCV.js +0 -2
  266. package/dist/chunk-SULEXAHO.js +0 -38
  267. package/dist/chunk-TH2N6QHW.js +0 -2
  268. package/dist/chunk-UWYJDBDW.js +0 -2
  269. package/dist/chunk-VUKC6F77.js +0 -20
  270. package/dist/chunk-W2CBNBEL.js +0 -71
  271. package/dist/chunk-XIVO4SDZ.js +0 -2
  272. package/dist/chunk-XSNRACLV.js +0 -3
  273. package/dist/chunk-XUGQU7PM.js +0 -41
  274. package/dist/chunk-Y6E3JHC4.js +0 -2
  275. package/dist/chunk-YBEEVDJQ.js +0 -2
  276. package/dist/chunk-YGHUVQLR.js +0 -2
  277. package/dist/chunk-YWDVDAD7.js +0 -2
  278. package/dist/chunk-YZA6PPZL.js +0 -3
  279. package/dist/chunk-ZU6PROUY.js +0 -2
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface SimilarSymbolResult {
6
6
  symbolA: string;
@@ -52,6 +52,7 @@ declare function similar(db: ScipDatabase, symbolPattern: string, opts?: {
52
52
  limit?: number;
53
53
  scanLimit?: number;
54
54
  semantic?: boolean;
55
+ sourceCandidateMode?: SourceCandidateMode;
55
56
  }): SimilarSymbolResult[];
56
57
  declare function targetSpecificIdfWeights(target: SymbolFingerprint, index: Pick<CalleeFingerprintIndex, 'corpus' | 'docFreq'>): Map<string, number>;
57
58
  /**
@@ -68,12 +69,49 @@ declare function similarAll(db: ScipDatabase, opts?: {
68
69
  semantic?: boolean;
69
70
  focusFiles?: ReadonlySet<string>;
70
71
  }): SimilarSymbolResult[];
72
+ declare function similarAllCount(db: ScipDatabase, opts?: {
73
+ minSimilarity?: number;
74
+ scope?: string;
75
+ minCallees?: number;
76
+ crossFileOnly?: boolean;
77
+ scanLimit?: number;
78
+ semantic?: boolean;
79
+ focusFiles?: ReadonlySet<string>;
80
+ }): number;
71
81
  interface SymbolFingerprint {
72
82
  symbol: string;
73
83
  file: string;
74
84
  callees: Set<string>;
75
85
  paramCount: number;
76
86
  }
87
+ type SourceCandidateMode = 'full' | 'target-pruned';
88
+ interface CalleeFingerprintCorpusOptions {
89
+ minCallees: number;
90
+ scope?: string;
91
+ excludeSymbol?: string;
92
+ scanLimit?: number;
93
+ semantic?: boolean;
94
+ }
95
+ interface CalleeFingerprintIndexOptions {
96
+ minCallees: number;
97
+ scope?: string;
98
+ scanLimit?: number;
99
+ semantic?: boolean;
100
+ }
101
+ interface SourceFingerprintOptions {
102
+ scanLimit?: number;
103
+ }
104
+ interface SourceFingerprintCandidateOptions extends SourceFingerprintOptions {
105
+ minSimilarity: number;
106
+ candidateMode?: SourceCandidateMode;
107
+ }
108
+ interface SimilarityFingerprintProduct {
109
+ calleeCorpus(opts: CalleeFingerprintCorpusOptions): SymbolFingerprint[];
110
+ calleeIndex(opts: CalleeFingerprintIndexOptions): CalleeFingerprintIndex;
111
+ sourceCorpus(opts?: SourceFingerprintOptions): SourceFingerprint[];
112
+ sourceIndex(opts?: SourceFingerprintOptions): SourceFingerprintIndex;
113
+ sourceCandidates(target: SourceFingerprint, opts: SourceFingerprintCandidateOptions): SourceFingerprint[];
114
+ }
77
115
  interface CalleeFingerprintIndex {
78
116
  corpus: readonly SymbolFingerprint[];
79
117
  candidateIndexesByCallee: ReadonlyMap<string, readonly number[]>;
@@ -83,27 +121,28 @@ interface CalleeFingerprintIndex {
83
121
  medianIdf: number;
84
122
  ubiquityThreshold: number;
85
123
  }
124
+ interface SourceFingerprint {
125
+ symbol: string;
126
+ file: string;
127
+ tokens: Set<string>;
128
+ }
129
+ interface SourceFingerprintIndex {
130
+ corpus: readonly SourceFingerprint[];
131
+ candidateByToken: ReadonlyMap<string, readonly SourceFingerprint[]>;
132
+ docFreq: ReadonlyMap<string, number>;
133
+ ubiquityThreshold: number;
134
+ }
86
135
  interface RankedSimilarResult {
87
136
  result: SimilarSymbolResult;
88
137
  order: number;
89
138
  }
90
139
  declare function insertTopSimilarResult(top: RankedSimilarResult[], result: SimilarSymbolResult, limit: number, order: number): void;
91
- declare function getAllCalleeFingerprints(db: ScipDatabase, opts: {
92
- minCallees: number;
93
- scope?: string;
94
- excludeSymbol?: string;
95
- scanLimit?: number;
96
- semantic?: boolean;
97
- }): SymbolFingerprint[];
98
- declare function getCalleeFingerprintIndex(db: ScipDatabase, opts: {
99
- minCallees: number;
100
- scope?: string;
101
- scanLimit?: number;
102
- semantic?: boolean;
103
- }): CalleeFingerprintIndex;
140
+ declare function getAllCalleeFingerprints(db: ScipDatabase, opts: CalleeFingerprintCorpusOptions): SymbolFingerprint[];
141
+ declare function getCalleeFingerprintIndex(db: ScipDatabase, opts: CalleeFingerprintIndexOptions): CalleeFingerprintIndex;
142
+ declare function similarityFingerprintProduct(db: ScipDatabase): SimilarityFingerprintProduct;
104
143
  declare function buildCalleeFingerprintIndex(corpus: readonly SymbolFingerprint[]): CalleeFingerprintIndex;
105
144
  declare function candidateFingerprintsForTarget(target: SymbolFingerprint, index: CalleeFingerprintIndex): SymbolFingerprint[];
106
145
  declare function meaningfulCallees(callees: Iterable<string>): Set<string>;
107
146
  declare function classifySimilarityEvidence(sharedEvidence: readonly string[], basis: NonNullable<SimilarSymbolResult['similarityBasis']>): SimilarEvidenceClassification;
108
147
 
109
- export { type CalleeFingerprintIndex, type RankedSimilarResult, type SimilarActionTier, type SimilarEvidenceClass, type SimilarEvidenceClassification, type SimilarSymbolResult, type SymbolFingerprint, buildCalleeFingerprintIndex, candidateFingerprintsForTarget, classifySimilarityEvidence, getAllCalleeFingerprints, getCalleeFingerprintIndex, insertTopSimilarResult, meaningfulCallees, similar, similarAll, targetSpecificIdfWeights };
148
+ export { type CalleeFingerprintCorpusOptions, type CalleeFingerprintIndex, type CalleeFingerprintIndexOptions, type RankedSimilarResult, type SimilarActionTier, type SimilarEvidenceClass, type SimilarEvidenceClassification, type SimilarSymbolResult, type SimilarityFingerprintProduct, type SourceCandidateMode, type SourceFingerprint, type SourceFingerprintCandidateOptions, type SourceFingerprintIndex, type SourceFingerprintOptions, type SymbolFingerprint, buildCalleeFingerprintIndex, candidateFingerprintsForTarget, classifySimilarityEvidence, getAllCalleeFingerprints, getCalleeFingerprintIndex, insertTopSimilarResult, meaningfulCallees, similar, similarAll, similarAllCount, similarityFingerprintProduct, targetSpecificIdfWeights };
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../chunk-FRPEPTYJ.js";import"../chunk-YWOOQ4FF.js";import"../chunk-B75HZHUP.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{g as buildCalleeFingerprintIndex,h as candidateFingerprintsForTarget,j as classifySimilarityEvidence,e as getAllCalleeFingerprints,f as getCalleeFingerprintIndex,d as insertTopSimilarResult,i as meaningfulCallees,a as similar,c as similarAll,b as targetSpecificIdfWeights};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-Z2LDWIJV.js";import"../chunk-ELC77ZDE.js";import"../chunk-B75HZHUP.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{i as buildCalleeFingerprintIndex,j as candidateFingerprintsForTarget,l as classifySimilarityEvidence,f as getAllCalleeFingerprints,g as getCalleeFingerprintIndex,e as insertTopSimilarResult,k as meaningfulCallees,a as similar,c as similarAll,d as similarAllCount,h as similarityFingerprintProduct,b as targetSpecificIdfWeights};
2
2
  //# sourceMappingURL=similar.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface SliceResult {
6
6
  symbol: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-WG6KRH5F.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as slice};
1
+ import{a}from"../chunk-CXWCLVYL.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as slice};
2
2
  //# sourceMappingURL=slice.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  type StaleAbstractionActionTier = 'direct' | 'signal';
6
6
  type StalenessKind = 'unused-abstraction' | 'misplaced-single-consumer-type' | 'single-consumer-abstraction' | 'one-to-one-class-encapsulation';
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-AW2QHPLL.js";import"../chunk-GRJY65YT.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as staleAbstractions};
1
+ import{a}from"../chunk-T3AEVJBG.js";import"../chunk-2FMFF4RI.js";import"../chunk-UVPY3RUZ.js";import"../chunk-B75HZHUP.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.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-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface StatsResult {
6
6
  documents: number;
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface SurfaceResult {
6
6
  consumer: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-3DGD6NKW.js";import"../chunk-RYXW3KRC.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as surface};
1
+ import{a}from"../chunk-VB2EZZPA.js";import"../chunk-OFXN2BCT.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.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-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface SymbolResult {
6
6
  startLine: number;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-YGHUVQLR.js";import"../chunk-RYXW3KRC.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as symbols};
1
+ import{a}from"../chunk-AOWFUGDL.js";import"../chunk-OFXN2BCT.js";import"../chunk-NBNEVLRC.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.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-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import { SymbolResult } from './symbols.js';
3
3
  import 'better-sqlite3';
4
- import '../config-types-BDIWAYzr.js';
4
+ import '../config-types-dvHOz0zU.js';
5
5
 
6
6
  interface SystemResult {
7
7
  files: string[];
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-MMLZEGMS.js";import"../chunk-RYXW3KRC.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
1
+ import{a}from"../chunk-LEHVP4DY.js";import"../chunk-OFXN2BCT.js";import"../chunk-NBNEVLRC.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.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-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface TraceResult {
6
6
  definitions: Array<{
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-J7RWXLUL.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
1
+ import{a}from"../chunk-2GLNBCHB.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-ULHLDOD6.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
2
2
  //# sourceMappingURL=trace.js.map
@@ -1,4 +1,4 @@
1
- import '../db-Djj3Nqrb.js';
1
+ import '../db-rMZO5JFK.js';
2
2
  export { ImportResult, UnusedImportResult, importedBy, imports, unusedImports } from './imports.js';
3
3
  import 'better-sqlite3';
4
- import '../config-types-BDIWAYzr.js';
4
+ import '../config-types-dvHOz0zU.js';
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../chunk-CCKPYPDI.js";import"../chunk-RYXW3KRC.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
1
+ import{a,b,c}from"../chunk-4ISHQ7UW.js";import"../chunk-OFXN2BCT.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-ULHLDOD6.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
2
2
  //# sourceMappingURL=unused-imports.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface UnusedParamsFinding {
6
6
  symbol: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-7JRRXGVZ.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
1
+ import{a}from"../chunk-XHMVZFA6.js";import"../chunk-UVPY3RUZ.js";import"../chunk-B75HZHUP.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
2
2
  //# sourceMappingURL=unused-params.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  interface VueComponentDuplicateResult {
6
6
  fileA: string;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-HHN2B5KA.js";import"../chunk-BZ53S4ZN.js";import"../chunk-3VD3JMK2.js";import"../chunk-YWOOQ4FF.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
1
+ import{a}from"../chunk-JNMLBL36.js";import"../chunk-HWVYTJOV.js";import"../chunk-MNCQPMCH.js";import"../chunk-ELC77ZDE.js";import"../chunk-ULHLDOD6.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
2
2
  //# sourceMappingURL=vue-component-duplicates.js.map
@@ -1,7 +1,7 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import { F as FrontendBehaviorActionTier, a as FrontendBehaviorEvidenceClass } from '../frontend-behavior-evidence-BxKpKWUu.js';
3
3
  import 'better-sqlite3';
4
- import '../config-types-BDIWAYzr.js';
4
+ import '../config-types-dvHOz0zU.js';
5
5
 
6
6
  type VueComposableEvidenceClass = FrontendBehaviorEvidenceClass;
7
7
  type VueComposableActionTier = FrontendBehaviorActionTier;
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-LZHUWKGD.js";import"../chunk-BZ53S4ZN.js";import"../chunk-3VD3JMK2.js";import"../chunk-YWOOQ4FF.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
1
+ import{a}from"../chunk-7IWIMNHI.js";import"../chunk-HWVYTJOV.js";import"../chunk-MNCQPMCH.js";import"../chunk-ELC77ZDE.js";import"../chunk-ULHLDOD6.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
2
2
  //# sourceMappingURL=vue-composable-candidates.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  type VueLargeViewPressureAxis = 'template' | 'script' | 'style' | 'external-script' | 'custom-block' | 'total';
6
6
  type VueLargeViewContextKind = 'component' | 'route-page';
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-FG4NT6VY.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueLargeViewPressure};
1
+ import{a}from"../chunk-N25HPUOK.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueLargeViewPressure};
2
2
  //# sourceMappingURL=vue-large-view-pressure.js.map
@@ -1,6 +1,6 @@
1
- import { S as ScipDatabase } from '../db-Djj3Nqrb.js';
1
+ import { S as ScipDatabase } from '../db-rMZO5JFK.js';
2
2
  import 'better-sqlite3';
3
- import '../config-types-BDIWAYzr.js';
3
+ import '../config-types-dvHOz0zU.js';
4
4
 
5
5
  type WrapperActionTier = 'direct' | 'signal';
6
6
  interface WrapperCandidate {
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-QVI3NR7E.js";import"../chunk-GRJY65YT.js";import"../chunk-LM5SHAN4.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-GBEYTDY5.js";import"../chunk-C5CTSJ6X.js";import"../chunk-BGBBVSH4.js";import"../chunk-UQLFQLAF.js";import"../chunk-SULEXAHO.js";import"../chunk-F6ICF7HL.js";import"../chunk-4KTOV4QN.js";import"../chunk-PTQVNJ4Q.js";import"../chunk-VUKC6F77.js";import"../chunk-P5RYBRIO.js";import"../chunk-OBGRLXWF.js";import"../chunk-4N4WONI4.js";import"../chunk-JM72FNGA.js";import"../chunk-72KY2ZFO.js";import"../chunk-YZA6PPZL.js";import"../chunk-HF25DFSC.js";import"../chunk-DS6QEB3G.js";import"../chunk-XUGQU7PM.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
1
+ import{a}from"../chunk-RUV5IY25.js";import"../chunk-2FMFF4RI.js";import"../chunk-3XSNW5XB.js";import"../chunk-UVPY3RUZ.js";import"../chunk-B75HZHUP.js";import"../chunk-RM2WQ75T.js";import"../chunk-WUOB4DHH.js";import"../chunk-BGBBVSH4.js";import"../chunk-L446VQYQ.js";import"../chunk-RSSXKJ6J.js";import"../chunk-UQ73QF5D.js";import"../chunk-CYHIKTJN.js";import"../chunk-NBNEVLRC.js";import"../chunk-F6IXELII.js";import"../chunk-ULHLDOD6.js";import"../chunk-DVFP6PZI.js";import"../chunk-63CI3IXR.js";import"../chunk-NABVR6B7.js";import"../chunk-THB6AM3V.js";import"../chunk-SA3DPTHT.js";import"../chunk-SGTKURU6.js";import"../chunk-AREANYIA.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 w,b as L}from"./chunk-W2CBNBEL.js";import{a as b,b as k,f as z}from"./chunk-ONPCQ2PM.js";import{execFileSync as Jt}from"child_process";import{closeSync as qt,copyFileSync as zt,existsSync as I,mkdirSync as U,mkdtempSync as Gt,openSync as Xt,readFileSync as j,renameSync as h,rmSync as y,writeFileSync as he}from"fs";import{basename as R,dirname as g,extname as Ht,join as f}from"path";import{execFileSync as Ce}from"child_process";import{existsSync as Ee,readdirSync as X}from"fs";import{extname as H,join as K}from"path";var $e=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),Ne=[{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 t=[],n=Fe(e),r=_e(e);for(let i of Ne){if(Ae(e,i.files)){t.push(i.language);continue}if(Te(n,i.globs)){t.push(i.language);continue}Ue(r,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&G(t,"javascript"),t.includes("cpp")&&!r.has(".c")&&G(t,"c"),t}function Fe(e){try{return X(e)}catch{return[]}}function Ae(e,t){return t?.length?t.some(n=>Ee(K(e,n))):!1}function Te(e,t){return t?.length?e.some(n=>t.some(r=>Be(n,r))):!1}function Be(e,t){if(t==="*")return!0;if(!t.includes("*"))return e===t;let[n,r]=t.split("*");return e.startsWith(n??"")&&e.endsWith(r??"")}function _e(e){let t=We(e);if(t)return t;let n=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let a;try{a=X(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=K(i,s.name);if(s.isDirectory()){$e.has(s.name)||r.push(o);continue}let c=H(s.name).toLowerCase();c&&n.add(c)}}return n}function We(e){try{let t=Ce("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),n=new Set;for(let r of t.split(`
2
- `)){if(!r)continue;let i=H(r).toLowerCase();i&&n.add(i)}return n}catch{return null}}function Ue(e,t){return t?.length?t.some(n=>e.has(n)):!1}function G(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}import{existsSync as Y,readdirSync as Je}from"fs";import{join as M}from"path";var qe={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:t,indexerBinary:n,projectPath:r})=>{let i=r?["index","--output",e,"--no-progress-bar",r]:["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return t&&!r&&i.splice(1,0,"--pnpm-workspaces"),{binary:n,args:i}},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:t})=>({binary:t,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:t})=>({binary:t,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:t})=>({binary:"scip-dotnet",args:["index",V(e,[".sln",".csproj"])??e,"--output",t,"--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:t})=>({binary:"scip-dotnet",args:["index",V(e,[".sln",".vbproj"])??e,"--output",t,"--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:t})=>({binary:e,args:["--output",t]}),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:t})=>{let n=M(e,"vendor","bin","scip-php"),r=M(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",Y(r)?r:Y(n)?n:t]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return qe[e]}function V(e,t){let n;try{n=Je(e)}catch{return null}for(let r of t)for(let i of n)if(i.endsWith(r))return M(e,i);return null}import{readFileSync as ze,writeFileSync as Ge}from"fs";import{create as O}from"@bufbuild/protobuf";import{deserializeSCIP as Xe,serializeSCIP as He,DocumentSchema as Ke,IndexSchema as Qe,SymbolInformationSchema as Ye}from"@c4312/scip";function Ve(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=Ze(e),n=et(e.flatMap(i=>i.documents??[])),r=Z(e.flatMap(i=>i.externalSymbols??[]));return O(Qe,{metadata:t,documents:n,externalSymbols:r})}function C(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let n=e.map(i=>Xe(ze(i))),r=Ve(n);return Ge(t,Buffer.from(He(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Ze(e){let t=e[0]?.metadata;if(!t)return;let n=t.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(n&&i&&i!==n)throw new Error(`Cannot merge SCIP indexes with different project roots: ${n} vs ${i}`)}return t}function et(e){let t=new Map;for(let n of e){let r=t.get(n.relativePath);if(!r){t.set(n.relativePath,n);continue}t.set(n.relativePath,O(Ke,{language:r.language||n.language,relativePath:r.relativePath||n.relativePath,occurrences:tt([...r.occurrences,...n.occurrences]),symbols:Z([...r.symbols,...n.symbols]),text:rt(r.text,n.text),positionEncoding:r.positionEncoding||n.positionEncoding}))}return[...t.values()]}function tt(e){let t=new Set,n=[];for(let r of e){let i=JSON.stringify(r);t.has(i)||(t.add(i),n.push(r))}return n}function Z(e){let t=new Map;for(let n of e){let r=t.get(n.symbol);if(!r){t.set(n.symbol,n);continue}t.set(n.symbol,O(Ye,{symbol:r.symbol,documentation:it([...r.documentation,...n.documentation]),relationships:nt([...r.relationships,...n.relationships]),kind:r.kind||n.kind,displayName:r.displayName||n.displayName,enclosingSymbol:r.enclosingSymbol||n.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??n.signatureDocumentation}))}return[...t.values()]}function nt(e){let t=new Set,n=[];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("|");t.has(i)||(t.add(i),n.push(r))}return n}function rt(e,t){return e?t?e.length>=t.length?e:t:e:t}function it(e){return[...new Set(e)]}import{readFileSync as at,writeFileSync as st}from"fs";import{create as ee}from"@bufbuild/protobuf";import{deserializeSCIP as ot,DocumentSchema as ut,IndexSchema as ct,serializeSCIP as pt,SymbolRole as lt}from"@c4312/scip";function te(e){let t;try{t=ot(at(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let n=gt(t);return n.removedDefinitionOccurrences>0&&st(e,Buffer.from(pt(n.index))),{removedDefinitionOccurrences:n.removedDefinitionOccurrences,touchedDocuments:n.touchedDocuments}}function gt(e){let t=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&t.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&t.add(a.symbol);let n=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles&lt.Definition)===0||t.has(o.symbol)?!0:(n+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(ee(ut,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:n===0?e:ee(ct,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:n,touchedDocuments:r}}import{existsSync as dt,readFileSync as ft,readdirSync as mt,statSync as ht}from"fs";import l from"path";var yt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function ne(e,t=[]){let n=l.resolve(e),r=xt(n),i=t.flatMap(c=>bt(n,c)),a=Pt([...r,...i]),s=vt(n,a)?[n,...a]:a,o=s.length>0?s:[n];return[...new Set(o.map(c=>It(n,c)))].sort((c,u)=>c.localeCompare(u))}function xt(e){let t=[],n=[e];for(;n.length>0;){let r=n.pop(),i;try{i=mt(r,{withFileTypes:!0})}catch{continue}for(let a of i){let s=l.join(r,a.name);if(a.isDirectory()){!yt.has(a.name)&&!a.name.startsWith(".")&&n.push(s);continue}a.isFile()&&St(s)&&t.push(l.dirname(s))}}return t}function bt(e,t){let n=t.trim();if(!n)return[];let r=l.resolve(e,n);if(!kt(e,r))return[];try{let i=ht(r);if(i.isDirectory())return[r];if(i.isFile()&&re(l.basename(r)))return[l.dirname(r)]}catch{return[]}return[]}function St(e){if(!re(l.basename(e)))return!1;let t=ie(e);return t?l.basename(e)==="tsconfig.json"||"include"in t||"files"in t||"references"in t:!1}function re(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Pt(e){let t=[...new Set(e.map(n=>l.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&jt(n,r)))}function vt(e,t){if(t.length===0||t.some(r=>l.resolve(r)===e))return!1;let n=l.join(e,"tsconfig.json");return dt(n)&&Rt(n)}function Rt(e){let n=ie(e)?.include;return Array.isArray(n)?n.some(r=>typeof r=="string"&&r.trim()!==""&&!r.startsWith("!")&&(r.includes("/")||r.includes("**")||!l.extname(r))):!1}function ie(e){try{let t=JSON.parse(ft(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function It(e,t){let n=l.relative(e,t);return n?n.split(l.sep).join("/"):"."}function jt(e,t){let n=l.relative(e,t);return!!n&&!n.startsWith("..")&&!l.isAbsolute(n)}function kt(e,t){let n=l.relative(e,t);return!n.startsWith("..")&&!l.isAbsolute(n)}import{execFile as wt}from"child_process";import{existsSync as S,renameSync as $,rmSync as N}from"fs";import{cpus as Lt}from"os";import{join as ae}from"path";function Mt(e,t,n){if(!e.defaultOutputPath)return;let r=ae(t,e.defaultOutputPath);n!==r&&S(r)&&$(r,n)}function Dt(e,t,n){if(!e.defaultOutputPath)return null;let r=ae(t,e.defaultOutputPath);if(r===n)return null;let i=`${n}.default-output-backup`;return N(i,{force:!0}),S(r)?($(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ot(e){e&&(N(e.defaultOutputPath,{force:!0}),e.backupPath&&S(e.backupPath)&&$(e.backupPath,e.defaultOutputPath))}function Ct(e,t){if(e<=1)return 1;let n=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(t)&&t&&t>0?t:Number.isFinite(n)&&n>0?n:Math.min(8,Math.max(1,Lt().length));return Math.max(1,Math.min(e,Math.floor(r)))}async function se(e,t,n,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Ct(a.length,r),c=await $t(a,o,u=>E(u,t,n));if(o>1){let u=new Map;for(let d of c.filter(p=>p.skipped)){let p=a.find(x=>x.id===d.id);p&&(n(`Retrying ${p.label} indexer serially after parallel failure...`),u.set(p.id,await E(p,t,n)))}s.push(...c.map(d=>u.get(d.id)??d))}else s.push(...c);for(let u of i)s.push(await E(u,t,n));return s.sort((u,d)=>e.findIndex(p=>p.id===u.id)-e.findIndex(p=>p.id===d.id))}async function E(e,t,n){n(`Indexing ${e.label} with ${e.resolvedBinary}...`),N(e.scipPath,{force:!0});let r=Dt(e.config,t,e.scipPath);try{await Et(e.binary,e.args,{cwd:t,env:e.env,maxBuffer:50*1024*1024}),Mt(e.config,t,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
3
- `)[0]}`,o=e.label===e.language?s:`${e.label}: ${s}`;return n(`Skipping ${e.label}: ${s}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:o}}}finally{Ot(r)}if(!S(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`,a=e.label===e.language?i:`${e.label}: ${i}`;return n(`Skipping ${e.label}: ${i}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:a}}}return{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath}}function Et(e,t,n){return new Promise((r,i)=>{wt(e,[...t],n,a=>{a?i(a):r()})})}async function $t(e,t,n){if(e.length===0)return[];let r=new Array(e.length),i=0,a=Math.max(1,Math.min(e.length,t)),s=Array.from({length:a},async()=>{for(;i<e.length;){let o=i++;r[o]=await n(e[o])}});return await Promise.all(s),r}import{execFileSync as A}from"child_process";import{existsSync as F,readFileSync as Nt}from"fs";import{createRequire as Ft}from"module";import{platform as At}from"os";import{dirname as oe,join as P}from"path";var Tt=Ft(import.meta.url);function T(e){return[e.indexerBinary,...e.binaryAliases??[]]}function B(e){let t=T(e);return t.length===1?t[0]:t.join(" or ")}function v(e){for(let t of T(e))if(b(t))return t;return _t(e)}function ue(e){return v(e)!==null||Bt(e)}function Bt(e){return ce(e)!==null}function _t(e){let t=ce(e);if(!t)return null;let r=JSON.parse(Nt(t,"utf8")).bin;if(!r)return null;if(typeof r=="string")return P(oe(t),r);for(let i of T(e)){let a=r[i];if(a)return P(oe(t),a)}return null}function ce(e){if(!e.bundledNpmPackage)return null;try{return Tt.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function pe(e,t){for(let n of e.projectLocalBinaries??[]){let r=P(t,n);if(F(r))return r}return null}function le(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||de(n,t))return t;let r=Wt(n,t);return r?{...t,DOTNET_ROOT:r}:t}function ge(e,t){let n=e.installMethods,r=B(e);if(!n?.length)return t(`No auto-install method available for ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1;for(let i of n)if(b(i.prerequisite)){t(`Installing ${r} via ${i.label}...`);try{A(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let a=v(e);if(a){let s=a===e.indexerBinary?"":` (using ${a})`;return t(`Successfully installed ${r} via ${i.label}${s}`),!0}t(`${i.label} command completed but ${r} was not found on PATH`)}catch(a){let s=a instanceof Error?a.message:String(a);t(`${i.label} install failed: ${s}`)}}return t(`Could not auto-install ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1}function Wt(e,t){for(let n of Ut(t))if(de(e,{...t,DOTNET_ROOT:n}))return n;return null}function Ut(e){let t=[],n=e.DOTNET_ROOT;if(n&&F(n)&&t.push(n),At()==="darwin"&&b("brew"))try{let r=A("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=P(r,"libexec");F(i)&&!t.includes(i)&&t.push(i)}catch{}return t}function de(e,t){try{return A(e,["--version"],{stdio:"pipe",env:t}),!0}catch{return!1}}async function ye(e){let{projectRoot:t,maxHeapMb:n=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=Kt(e),s=Date.now();U(g(a.outputScip),{recursive:!0}),U(g(a.outputDb),{recursive:!0});let o=e.languages??Q(t);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=bn(t,o,{pnpmWorkspaces:e.pnpmWorkspaces,typescriptProjectMode:e.typescriptProjectMode,typescriptProjects:e.typescriptProjects}),u=await ln(f(g(a.outputDb),"index.lock"),{projectRoot:t,trigger:e.trigger,onStatus:r}),d=null;try{let p=Qt({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(p)return p;rn(i,r);let x=Yt(a);return d=x.runDir,await Vt({opts:e,languages:o,projectRoot:t,paths:a,tempPaths:x,fingerprint:c,start:s,maxHeapMb:n,skipAutoInstall:i,onStatus:r})}catch(p){throw je(a.metaPath,q({trigger:e.trigger,result:"failed",start:s,error:p instanceof Error?p.message:String(p)})),p}finally{d&&y(d,{recursive:!0,force:!0}),u()}}function Kt(e){let t=e.outputScip??f(e.projectRoot,"index.scip"),n=e.outputDb??f(e.projectRoot,"index.db");return{outputScip:t,outputDb:n,metaPath:f(g(n),"meta.json")}}function Qt(e){if(e.opts.skipIfUnchanged===!1||!I(e.paths.outputScip)||!I(e.paths.outputDb)||!Sn(e.paths.metaPath,e.fingerprint))return null;w({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let t=Date.now()-e.start,n=q({trigger:e.opts.trigger,result:"reused",start:e.start,languages:e.languages,skipped:[]});return je(e.paths.metaPath,n),e.onStatus(`Index unchanged; reused existing SQLite index in ${(t/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:t,reused:!0,skipped:[],lastRefresh:n}}function Yt(e){let t=Gt(f(g(e.outputDb),"reindex-"));return{runDir:t,tempOutputScip:f(t,R(e.outputScip)),tempOutputDb:f(t,R(e.outputDb)),tempMetaPath:f(t,R(e.metaPath))}}async function Vt(e){let t={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:n,skippedLanguages:r,reusedLanguages:i}=await Zt(e,t);i.length>0&&e.onStatus(`Reused ${i.length} cached language shard(s): ${i.join(", ")}`);let a=en(e,t,n,r),s=a.durationMs;return e.onStatus(`Done in ${(s/1e3).toFixed(1)}s`),{languages:n.map(o=>o.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:s,reused:!1,skipped:r,lastRefresh:a}}async function Zt(e,t){let n=tn(e),r=new Set(n.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:i,skippedLanguages:a}=an({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:t,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,onStatus:e.onStatus}),s=await se(i,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=on(s,a),c=[...n,...o];return un(c,a,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:c,skippedLanguages:a,reusedLanguages:[...r]}}function en(e,t,n,r){nn(e.paths.outputDb,n),cn(n,e.tempPaths.tempOutputScip,e.onStatus),pn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,t,e.onStatus),w({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus});let i=q({trigger:e.opts.trigger,result:"rebuilt",start:e.start,languages:n.map(a=>a.language),skipped:[...r]});return Ie(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects}),requestedLanguages:e.languages,indexedLanguages:n.map(a=>a.language),skipped:[...r],lastRefresh:i}),xn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath}),i}function tn(e){let t;try{t=JSON.parse(j(e.paths.metaPath,"utf-8"))}catch{return[]}if(t.version!==3||!t.languageFingerprints)return[];let n=[],r=Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects});for(let i of e.languages){let a=Re(e.paths.outputDb,i);I(a)&&m(t.languageFingerprints[i])===m(r[i])&&n.push({language:i,scipPath:a})}return n}function nn(e,t){for(let n of t){let r=Re(e,n.language);U(g(r),{recursive:!0}),n.scipPath!==r&&zt(n.scipPath,r)}}function rn(e,t){if(!k()){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(t("scip CLI not found on PATH. Attempting auto-install..."),!z(t))throw new Error(`The scip CLI is required but could not be installed.
5
- Install manually from: https://github.com/sourcegraph/scip/releases`)}}function an(e){let t=[],n=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?be(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=sn({...e,language:i,scipPath:a});for(let o of s)"skipped"in o?xe(n,o.skipped):t.push(o.prepared)}return{preparedRuns:t,skippedLanguages:n}}function sn(e){if(e.language!=="typescript"||e.typescriptProjectMode!=="workspace")return[_({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})];let t=ne(e.projectRoot,e.typescriptProjects);return t.length===0?[_({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})]:(e.onStatus(`Indexing TypeScript workspace as ${t.length} project shard(s).`),t.map((n,r)=>_({...e,id:`typescript:${n}`,label:`typescript (${n})`,scipPath:be(e.tempOutputScip,"typescript-project",r),outputScipPath:e.scipPath,pnpmWorkspaces:!1,projectPath:n})))}function _(e){let t=D(e.language),n=B(t),r=pe(t,e.projectRoot);if(!r&&!ue(t)){if(e.skipAutoInstall){let o=`${n} not found on PATH (auto-install disabled). ${t.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${n} not found. Attempting auto-install...`),!ge(t,e.onStatus)){let o=`${n} could not be auto-installed. ${t.installUrl?`Install manually from ${t.installUrl}`:`Install ${n} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let i=r??v(t);if(!i){let o=`${n} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:a,args:s}=t.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:i,projectPath:e.projectPath});return{prepared:{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,config:t,resolvedBinary:i,binary:a,args:s,env:le(t,e.env,i)}}}function on(e,t){let n=new Map;for(let i of e)if(i.skipped)xe(t,i.skipped);else{let a=`${i.language}\0${i.outputScipPath}`,s=n.get(a)??{language:i.language,outputScipPath:i.outputScipPath,scipPaths:[]};s.scipPaths.push(i.scipPath),n.set(a,s)}let r=[];for(let i of n.values())if(i.scipPaths.length>1)C(i.scipPaths,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath});else{let a=i.scipPaths[0];a!==i.outputScipPath&&h(a,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath})}return{indexedOutputs:r}}function xe(e,t){let n=e.find(r=>r.language===t.language);if(!n){e.push(t);return}n.reason.includes(t.reason)||(n.reason=`${n.reason}; ${t.reason}`)}function un(e,t,n,r,i){if(e.length===0){let a=t.map(s=>` - ${s.language}: ${s.reason}`).join(`
1
+ import{a as C,b as w,c as L}from"./chunk-2DOW7QCA.js";import{a as b,b as k,f as G}from"./chunk-ONPCQ2PM.js";import{execFileSync as Xt}from"child_process";import{closeSync as Ht,copyFileSync as Kt,existsSync as R,mkdirSync as J,mkdtempSync as Qt,openSync as Yt,readFileSync as I,renameSync as h,rmSync as y,writeFileSync as ye}from"fs";import{basename as j,dirname as g,extname as Vt,join as f}from"path";import{execFileSync as $e}from"child_process";import{existsSync as Ae,readdirSync as H}from"fs";import{extname as K,join as Q}from"path";var Ne=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:"clojure",files:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],extensions:[".clj",".cljs",".cljc"]},{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 Y(e){let t=[],n=Te(e),r=We(e);for(let i of Fe){if(Be(e,i.files)){t.push(i.language);continue}if(_e(n,i.globs)){t.push(i.language);continue}qe(r,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&X(t,"javascript"),t.includes("cpp")&&!r.has(".c")&&X(t,"c"),t}function Te(e){try{return H(e)}catch{return[]}}function Be(e,t){return t?.length?t.some(n=>Ae(Q(e,n))):!1}function _e(e,t){return t?.length?e.some(n=>t.some(r=>Ue(n,r))):!1}function Ue(e,t){if(t==="*")return!0;if(!t.includes("*"))return e===t;let[n,r]=t.split("*");return e.startsWith(n??"")&&e.endsWith(r??"")}function We(e){let t=Je(e);if(t)return t;let n=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let a;try{a=H(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=Q(i,s.name);if(s.isDirectory()){Ne.has(s.name)||r.push(o);continue}let c=K(s.name).toLowerCase();c&&n.add(c)}}return n}function Je(e){try{let t=$e("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),n=new Set;for(let r of t.split(`
2
+ `)){if(!r)continue;let i=K(r).toLowerCase();i&&n.add(i)}return n}catch{return null}}function qe(e,t){return t?.length?t.some(n=>e.has(n)):!1}function X(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}import{existsSync as V,readdirSync as ze}from"fs";import{isAbsolute as Ge,join as M,resolve as Xe}from"path";var He={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:t,indexerBinary:n,projectPath:r})=>{let i=r?["index","--output",e,"--no-progress-bar",r]:["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return t&&!r&&i.splice(1,0,"--pnpm-workspaces"),{binary:n,args:i}},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:t})=>({binary:t,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:t})=>({binary:t,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"},clojure:{language:"clojure",indexerBinary:"scip-clojure",projectLocalBinaries:["node_modules/.bin/scip-clojure"],checkCommand:"scip-clojure -h",indexArgs:({projectRoot:e,outputPath:t,indexerBinary:n,configPath:r})=>{let i=["-root",e,"-output",t];return r&&i.push("-config",Ge(r)?r:Xe(e,r)),{binary:n,args:i}},markerFiles:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-clojure"]}],installUrl:"https://github.com/PlunderStruck/scip-clojure"},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:t})=>({binary:"scip-dotnet",args:["index",Z(e,[".sln",".csproj"])??e,"--output",t,"--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:t})=>({binary:"scip-dotnet",args:["index",Z(e,[".sln",".vbproj"])??e,"--output",t,"--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:t})=>({binary:e,args:["--output",t]}),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:t})=>{let n=M(e,"vendor","bin","scip-php"),r=M(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",V(r)?r:V(n)?n:t]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return He[e]}function Z(e,t){let n;try{n=ze(e)}catch{return null}for(let r of t)for(let i of n)if(i.endsWith(r))return M(e,i);return null}import{readFileSync as Ke,writeFileSync as Qe}from"fs";import{create as O}from"@bufbuild/protobuf";import{deserializeSCIP as Ye,serializeSCIP as Ve,DocumentSchema as Ze,IndexSchema as et,SymbolInformationSchema as tt}from"@c4312/scip";function nt(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=rt(e),n=it(e.flatMap(i=>i.documents??[])),r=ee(e.flatMap(i=>i.externalSymbols??[]));return O(et,{metadata:t,documents:n,externalSymbols:r})}function E(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let n=e.map(i=>Ye(Ke(i))),r=nt(n);return Qe(t,Buffer.from(Ve(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function rt(e){let t=e[0]?.metadata;if(!t)return;let n=t.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(n&&i&&i!==n)throw new Error(`Cannot merge SCIP indexes with different project roots: ${n} vs ${i}`)}return t}function it(e){let t=new Map;for(let n of e){let r=t.get(n.relativePath);if(!r){t.set(n.relativePath,n);continue}t.set(n.relativePath,O(Ze,{language:r.language||n.language,relativePath:r.relativePath||n.relativePath,occurrences:at([...r.occurrences,...n.occurrences]),symbols:ee([...r.symbols,...n.symbols]),text:ot(r.text,n.text),positionEncoding:r.positionEncoding||n.positionEncoding}))}return[...t.values()]}function at(e){let t=new Set,n=[];for(let r of e){let i=JSON.stringify(r);t.has(i)||(t.add(i),n.push(r))}return n}function ee(e){let t=new Map;for(let n of e){let r=t.get(n.symbol);if(!r){t.set(n.symbol,n);continue}t.set(n.symbol,O(tt,{symbol:r.symbol,documentation:ut([...r.documentation,...n.documentation]),relationships:st([...r.relationships,...n.relationships]),kind:r.kind||n.kind,displayName:r.displayName||n.displayName,enclosingSymbol:r.enclosingSymbol||n.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??n.signatureDocumentation}))}return[...t.values()]}function st(e){let t=new Set,n=[];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("|");t.has(i)||(t.add(i),n.push(r))}return n}function ot(e,t){return e?t?e.length>=t.length?e:t:e:t}function ut(e){return[...new Set(e)]}import{readFileSync as ct,writeFileSync as lt}from"fs";import{create as te}from"@bufbuild/protobuf";import{deserializeSCIP as pt,DocumentSchema as gt,IndexSchema as dt,serializeSCIP as ft,SymbolRole as mt}from"@c4312/scip";function ne(e){let t;try{t=pt(ct(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let n=ht(t);return n.removedDefinitionOccurrences>0&&lt(e,Buffer.from(ft(n.index))),{removedDefinitionOccurrences:n.removedDefinitionOccurrences,touchedDocuments:n.touchedDocuments}}function ht(e){let t=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&t.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&t.add(a.symbol);let n=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles&mt.Definition)===0||t.has(o.symbol)?!0:(n+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(te(gt,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:n===0?e:te(dt,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:n,touchedDocuments:r}}import{existsSync as yt,readFileSync as xt,readdirSync as bt,statSync as Pt}from"fs";import p from"path";var St=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function re(e,t=[]){let n=p.resolve(e),r=vt(n),i=t.flatMap(c=>jt(n,c)),a=It([...r,...i]),s=kt(n,a)?[n,...a]:a,o=s.length>0?s:[n];return[...new Set(o.map(c=>wt(n,c)))].sort((c,u)=>c.localeCompare(u))}function vt(e){let t=[],n=[e];for(;n.length>0;){let r=n.pop(),i;try{i=bt(r,{withFileTypes:!0})}catch{continue}for(let a of i){let s=p.join(r,a.name);if(a.isDirectory()){!St.has(a.name)&&!a.name.startsWith(".")&&n.push(s);continue}a.isFile()&&Rt(s)&&t.push(p.dirname(s))}}return t}function jt(e,t){let n=t.trim();if(!n)return[];let r=p.resolve(e,n);if(!Mt(e,r))return[];try{let i=Pt(r);if(i.isDirectory())return[r];if(i.isFile()&&ie(p.basename(r)))return[p.dirname(r)]}catch{return[]}return[]}function Rt(e){if(!ie(p.basename(e)))return!1;let t=ae(e);return t?p.basename(e)==="tsconfig.json"||"include"in t||"files"in t||"references"in t:!1}function ie(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function It(e){let t=[...new Set(e.map(n=>p.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&Lt(n,r)))}function kt(e,t){if(t.length===0||t.some(r=>p.resolve(r)===e))return!1;let n=p.join(e,"tsconfig.json");return yt(n)&&Ct(n)}function Ct(e){let n=ae(e)?.include;return Array.isArray(n)?n.some(r=>typeof r=="string"&&r.trim()!==""&&!r.startsWith("!")&&(r.includes("/")||r.includes("**")||!p.extname(r))):!1}function ae(e){try{let t=JSON.parse(xt(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function wt(e,t){let n=p.relative(e,t);return n?n.split(p.sep).join("/"):"."}function Lt(e,t){let n=p.relative(e,t);return!!n&&!n.startsWith("..")&&!p.isAbsolute(n)}function Mt(e,t){let n=p.relative(e,t);return!n.startsWith("..")&&!p.isAbsolute(n)}import{execFile as Dt}from"child_process";import{existsSync as P,renameSync as A,rmSync as N}from"fs";import{cpus as Ot}from"os";import{join as se}from"path";function Et(e,t,n){if(!e.defaultOutputPath)return;let r=se(t,e.defaultOutputPath);n!==r&&P(r)&&A(r,n)}function $t(e,t,n){if(!e.defaultOutputPath)return null;let r=se(t,e.defaultOutputPath);if(r===n)return null;let i=`${n}.default-output-backup`;return N(i,{force:!0}),P(r)?(A(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function At(e){e&&(N(e.defaultOutputPath,{force:!0}),e.backupPath&&P(e.backupPath)&&A(e.backupPath,e.defaultOutputPath))}function Nt(e,t){if(e<=1)return 1;let n=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(t)&&t&&t>0?t:Number.isFinite(n)&&n>0?n:Math.min(8,Math.max(1,Ot().length));return Math.max(1,Math.min(e,Math.floor(r)))}async function oe(e,t,n,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Nt(a.length,r),c=await Tt(a,o,u=>$(u,t,n));if(o>1){let u=new Map;for(let d of c.filter(l=>l.skipped)){let l=a.find(x=>x.id===d.id);l&&(n(`Retrying ${l.label} indexer serially after parallel failure...`),u.set(l.id,await $(l,t,n)))}s.push(...c.map(d=>u.get(d.id)??d))}else s.push(...c);for(let u of i)s.push(await $(u,t,n));return s.sort((u,d)=>e.findIndex(l=>l.id===u.id)-e.findIndex(l=>l.id===d.id))}async function $(e,t,n){n(`Indexing ${e.label} with ${e.resolvedBinary}...`),N(e.scipPath,{force:!0});let r=$t(e.config,t,e.scipPath);try{await Ft(e.binary,e.args,{cwd:t,env:e.env,maxBuffer:50*1024*1024}),Et(e.config,t,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
3
+ `)[0]}`,o=e.label===e.language?s:`${e.label}: ${s}`;return n(`Skipping ${e.label}: ${s}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:o}}}finally{At(r)}if(!P(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`,a=e.label===e.language?i:`${e.label}: ${i}`;return n(`Skipping ${e.label}: ${i}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:a}}}return{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath}}function Ft(e,t,n){return new Promise((r,i)=>{Dt(e,[...t],n,a=>{a?i(a):r()})})}async function Tt(e,t,n){if(e.length===0)return[];let r=new Array(e.length),i=0,a=Math.max(1,Math.min(e.length,t)),s=Array.from({length:a},async()=>{for(;i<e.length;){let o=i++;r[o]=await n(e[o])}});return await Promise.all(s),r}import{execFileSync as T}from"child_process";import{existsSync as F,readFileSync as Bt}from"fs";import{createRequire as _t}from"module";import{platform as Ut}from"os";import{dirname as ue,join as S}from"path";var Wt=_t(import.meta.url);function B(e){return[e.indexerBinary,...e.binaryAliases??[]]}function _(e){let t=B(e);return t.length===1?t[0]:t.join(" or ")}function v(e){for(let t of B(e))if(b(t))return t;return qt(e)}function ce(e){return v(e)!==null||Jt(e)}function Jt(e){return le(e)!==null}function qt(e){let t=le(e);if(!t)return null;let r=JSON.parse(Bt(t,"utf8")).bin;if(!r)return null;if(typeof r=="string")return S(ue(t),r);for(let i of B(e)){let a=r[i];if(a)return S(ue(t),a)}return null}function le(e){if(!e.bundledNpmPackage)return null;try{return Wt.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function pe(e,t){for(let n of e.projectLocalBinaries??[]){let r=S(t,n);if(F(r))return r}return null}function ge(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||fe(n,t))return t;let r=zt(n,t);return r?{...t,DOTNET_ROOT:r}:t}function de(e,t){let n=e.installMethods,r=_(e);if(!n?.length)return t(`No auto-install method available for ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1;for(let i of n)if(b(i.prerequisite)){t(`Installing ${r} via ${i.label}...`);try{T(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let a=v(e);if(a){let s=a===e.indexerBinary?"":` (using ${a})`;return t(`Successfully installed ${r} via ${i.label}${s}`),!0}t(`${i.label} command completed but ${r} was not found on PATH`)}catch(a){let s=a instanceof Error?a.message:String(a);t(`${i.label} install failed: ${s}`)}}return t(`Could not auto-install ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1}function zt(e,t){for(let n of Gt(t))if(fe(e,{...t,DOTNET_ROOT:n}))return n;return null}function Gt(e){let t=[],n=e.DOTNET_ROOT;if(n&&F(n)&&t.push(n),Ut()==="darwin"&&b("brew"))try{let r=T("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=S(r,"libexec");F(i)&&!t.includes(i)&&t.push(i)}catch{}return t}function fe(e,t){try{return T(e,["--version"],{stdio:"pipe",env:t}),!0}catch{return!1}}async function xe(e){let{projectRoot:t,maxHeapMb:n=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=Zt(e),s=Date.now();J(g(a.outputScip),{recursive:!0}),J(g(a.outputDb),{recursive:!0});let o=e.languages??Y(t);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=jn(t,o,{pnpmWorkspaces:e.pnpmWorkspaces,typescriptProjectMode:e.typescriptProjectMode,typescriptProjects:e.typescriptProjects,clojureConfigPath:e.clojureConfigPath}),u=await mn(f(g(a.outputDb),"index.lock"),{projectRoot:t,trigger:e.trigger,onStatus:r}),d=null;try{let l=en({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(l)return l;un(i,r);let x=tn(a);return d=x.runDir,await nn({opts:e,languages:o,projectRoot:t,paths:a,tempPaths:x,fingerprint:c,start:s,maxHeapMb:n,skipAutoInstall:i,onStatus:r})}catch(l){throw Ce(a.metaPath,z({trigger:e.trigger,result:"failed",start:s,error:l instanceof Error?l.message:String(l)})),l}finally{d&&y(d,{recursive:!0,force:!0}),u()}}function Zt(e){let t=e.outputScip??f(e.projectRoot,"index.scip"),n=e.outputDb??f(e.projectRoot,"index.db");return{outputScip:t,outputDb:n,metaPath:f(g(n),"meta.json")}}function en(e){if(e.opts.skipIfUnchanged===!1||!R(e.paths.outputScip)||!R(e.paths.outputDb)||!Rn(e.paths.metaPath,e.fingerprint))return null;w(C(),{projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let t=Date.now()-e.start,n=z({trigger:e.opts.trigger,result:"reused",start:e.start,languages:e.languages,skipped:[]});return Ce(e.paths.metaPath,n),e.onStatus(`Index unchanged; reused existing SQLite index in ${(t/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:t,reused:!0,skipped:[],lastRefresh:n}}function tn(e){let t=Qt(f(g(e.outputDb),"reindex-"));return{runDir:t,tempOutputScip:f(t,j(e.outputScip)),tempOutputDb:f(t,j(e.outputDb)),tempMetaPath:f(t,j(e.metaPath))}}async function nn(e){let t={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:n,skippedLanguages:r,reusedLanguages:i}=await rn(e,t);i.length>0&&e.onStatus(`Reused ${i.length} cached language shard(s): ${i.join(", ")}`);let a=an(e,t,n,r),s=a.durationMs;return e.onStatus(`Done in ${(s/1e3).toFixed(1)}s`),{languages:n.map(o=>o.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:s,reused:!1,skipped:r,lastRefresh:a}}async function rn(e,t){let n=sn(e),r=new Set(n.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:i,skippedLanguages:a}=cn({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:t,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath,onStatus:e.onStatus}),s=await oe(i,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=pn(s,a),c=[...n,...o];return gn(c,a,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:c,skippedLanguages:a,reusedLanguages:[...r]}}function an(e,t,n,r){on(e.paths.outputDb,n),dn(n,e.tempPaths.tempOutputScip,e.onStatus),fn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,t,e.onStatus),w(C(),{projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus});let i=z({trigger:e.opts.trigger,result:"rebuilt",start:e.start,languages:n.map(a=>a.language),skipped:[...r]});return ke(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath}),requestedLanguages:e.languages,indexedLanguages:n.map(a=>a.language),skipped:[...r],lastRefresh:i}),vn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath}),i}function sn(e){let t;try{t=JSON.parse(I(e.paths.metaPath,"utf-8"))}catch{return[]}if(t.version!==3||!t.languageFingerprints)return[];let n=[],r=Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath});for(let i of e.languages){let a=Ie(e.paths.outputDb,i);R(a)&&m(t.languageFingerprints[i])===m(r[i])&&n.push({language:i,scipPath:a})}return n}function on(e,t){for(let n of t){let r=Ie(e,n.language);J(g(r),{recursive:!0}),n.scipPath!==r&&Kt(n.scipPath,r)}}function un(e,t){if(!k()){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(t("scip CLI not found on PATH. Attempting auto-install..."),!G(t))throw new Error(`The scip CLI is required but could not be installed.
5
+ Install manually from: https://github.com/sourcegraph/scip/releases`)}}function cn(e){let t=[],n=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?Pe(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=ln({...e,language:i,scipPath:a});for(let o of s)"skipped"in o?be(n,o.skipped):t.push(o.prepared)}return{preparedRuns:t,skippedLanguages:n}}function ln(e){if(e.language!=="typescript"||e.typescriptProjectMode!=="workspace")return[U({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})];let t=re(e.projectRoot,e.typescriptProjects);return t.length===0?[U({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})]:(e.onStatus(`Indexing TypeScript workspace as ${t.length} project shard(s).`),t.map((n,r)=>U({...e,id:`typescript:${n}`,label:`typescript (${n})`,scipPath:Pe(e.tempOutputScip,"typescript-project",r),outputScipPath:e.scipPath,pnpmWorkspaces:!1,projectPath:n})))}function U(e){let t=D(e.language),n=_(t),r=pe(t,e.projectRoot);if(!r&&!ce(t)){if(e.skipAutoInstall){let o=`${n} not found on PATH (auto-install disabled). ${t.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${n} not found. Attempting auto-install...`),!de(t,e.onStatus)){let o=`${n} could not be auto-installed. ${t.installUrl?`Install manually from ${t.installUrl}`:`Install ${n} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let i=r??v(t);if(!i){let o=`${n} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:a,args:s}=t.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:i,projectPath:e.projectPath,configPath:e.language==="clojure"?e.clojureConfigPath:void 0});return{prepared:{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,config:t,resolvedBinary:i,binary:a,args:s,env:ge(t,e.env,i)}}}function pn(e,t){let n=new Map;for(let i of e)if(i.skipped)be(t,i.skipped);else{let a=`${i.language}\0${i.outputScipPath}`,s=n.get(a)??{language:i.language,outputScipPath:i.outputScipPath,scipPaths:[]};s.scipPaths.push(i.scipPath),n.set(a,s)}let r=[];for(let i of n.values())if(i.scipPaths.length>1)E(i.scipPaths,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath});else{let a=i.scipPaths[0];a!==i.outputScipPath&&h(a,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath})}return{indexedOutputs:r}}function be(e,t){let n=e.find(r=>r.language===t.language);if(!n){e.push(t);return}n.reason.includes(t.reason)||(n.reason=`${n.reason}; ${t.reason}`)}function gn(e,t,n,r,i){if(e.length===0){let a=t.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
7
  `+a)}if(t.length!==0&&(i(`Indexed ${e.length} language output(s); skipped or incomplete: ${t.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
8
  `+t.map(a=>` - ${a.language}: ${a.reason}`).join(`
9
- `))}function cn(e,t,n){e.length>1?(n(`Merging ${e.length} language indexes...`),C(e.map(r=>r.scipPath),t)):e[0].scipPath!==t&&h(e[0].scipPath,t)}function pn(e,t,n,r){if(r("Converting to SQLite..."),!I(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=te(e);i.removedDefinitionOccurrences>0&&r(`Sanitized ${i.removedDefinitionOccurrences} invalid definition occurrences across ${i.touchedDocuments} documents before SQLite conversion.`);let a=k();if(!a)throw new Error("scip CLI is not available");Jt(a,["expt-convert","--output",t,e],{env:n,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 be(e,t,n){let r=Ht(e)||".scip",i=R(e,r);return f(g(e),`${i}.${n+1}.${t}${r}`)}async function ln(e,t){for(let n=0;n<2;n++){let r=gn(e,t);if(r)return r;let i=dn(e);if(i&&fn(t.trigger,i)){t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`),await hn(i.pid),y(e,{force:!0});continue}if(i&&!J(i.pid)){y(e,{force:!0});continue}throw new Error(`Another scip-query reindex is already running for ${g(e)}.`)}throw new Error(`Could not acquire scip-query reindex lock for ${g(e)}.`)}function gn(e,t){let n;try{n=Xt(e,"wx")}catch(i){if((typeof i=="object"&&i&&"code"in i?i.code:void 0)==="EEXIST")return null;throw i}let r={version:1,pid:process.pid,projectRoot:t.projectRoot,startedAt:new Date().toISOString(),trigger:t.trigger};return he(n,JSON.stringify(r)+`
10
- `),()=>{try{qt(n)}finally{y(e,{force:!0})}}}function dn(e){try{let t=JSON.parse(j(e,"utf-8"));return typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0?null:{version:1,pid:t.pid,projectRoot:typeof t.projectRoot=="string"?t.projectRoot:g(e),startedAt:typeof t.startedAt=="string"?t.startedAt:"unknown",trigger:t.trigger}}catch{return null}}function fn(e,t){return e?.kind==="manual-cli"&&mn(t?.trigger)}function mn(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function hn(e){fe(e,"SIGTERM"),!await me(e,2e3)&&(fe(e,"SIGKILL"),await me(e,1e3))}function fe(e,t){try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}async function me(e,t){let n=Date.now()+t;for(;Date.now()<n;){if(!J(e))return!0;await yn(50)}return!J(e)}function J(e){try{return process.kill(e,0),!0}catch{return!1}}function yn(e){return new Promise(t=>setTimeout(t,e))}function xn(e){W(e.tempOutputScip,e.outputScip),W(e.tempOutputDb,e.outputDb),W(e.tempMetaPath,e.metaPath)}function W(e,t){y(`${t}.tmp-replace`,{force:!0}),h(e,`${t}.tmp-replace`),h(`${t}.tmp-replace`,t)}function bn(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:ve(n),typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:Pe(n.typescriptProjects),files:L(e)}}function Se(e,t,n){return Object.fromEntries(t.map(r=>{let i=D(r).markerFiles,a=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:Pe(n.typescriptProjects)}:{typescriptProjectMode:"single",typescriptProjects:[]};return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&ve(n),...a,files:L(e,{language:r,markerFiles:i})}]}))}function Pe(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function ve(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function Re(e,t){return f(g(e),"language-indexes",`${t}.scip`)}function Sn(e,t){try{let n=JSON.parse(j(e,"utf-8"));return(n.version===2||n.version===3)&&n.status==="complete"&&m(n.fingerprint)===m(t)&&m([...n.indexedLanguages??[]].sort())===m(t.languages)}catch{return!1}}function Ie(e,t){let n=`${e}.tmp-${process.pid}-${Date.now()}`;he(n,`${JSON.stringify(t,null,2)}
11
- `),h(n,e)}function je(e,t){try{let n=JSON.parse(j(e,"utf-8"));if(n.version!==2&&n.version!==3)return;Ie(e,{...n,lastRefresh:t})}catch{}}function q(e){return{trigger:e.trigger??{kind:"unknown"},result:e.result,startedAt:new Date(e.start).toISOString(),completedAt:new Date().toISOString(),durationMs:Date.now()-e.start,indexedLanguages:e.languages?[...e.languages]:void 0,skipped:e.skipped?[...e.skipped]:void 0,error:e.error}}function m(e){return JSON.stringify(e)}var Me=process.env.SCIP_REINDEX_PROJECT_ROOT,De=process.env.SCIP_REINDEX_OUTPUT_SCIP,Oe=process.env.SCIP_REINDEX_OUTPUT_DB,ke=process.env.SCIP_REINDEX_LANGUAGES,Pn=wn(process.env.SCIP_REINDEX_INDEXER_CONCURRENCY),vn=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1",we=kn(process.env.SCIP_REINDEX_TYPESCRIPT_CONFIG),Rn=jn(process.env.SCIP_REINDEX_TRIGGER_KIND),In=process.env.SCIP_REINDEX_TRIGGER_DETAIL;(!Me||!De||!Oe)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var Le=ke?ke.split(",").filter(Boolean):void 0;ye({projectRoot:Me,outputScip:De,outputDb:Oe,languages:Le?.length?Le:void 0,pnpmWorkspaces:vn,typescriptProjectMode:we.projectMode,typescriptProjects:we.projects,indexerConcurrency:Pn,trigger:{kind:Rn,detail:In||void 0},onStatus:e=>process.stderr.write(`[reindex] ${e}
12
- `)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});function jn(e){switch(e){case"manual-cli":case"setup":case"watch-source":case"watch-git-head":case"watch-git-index":case"watch-git-state":return e;default:return"unknown"}}function kn(e){if(!e)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};let n=t,r=n.projectMode==="single"||n.projectMode==="workspace"?n.projectMode:void 0,i=Array.isArray(n.projects)?n.projects.filter(a=>typeof a=="string"&&a.trim()!==""):void 0;return{projectMode:r,projects:i&&i.length>0?i:void 0}}catch{return{}}}function wn(e){if(!e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0}
9
+ `))}function dn(e,t,n){e.length>1?(n(`Merging ${e.length} language indexes...`),E(e.map(r=>r.scipPath),t)):e[0].scipPath!==t&&h(e[0].scipPath,t)}function fn(e,t,n,r){if(r("Converting to SQLite..."),!R(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=ne(e);i.removedDefinitionOccurrences>0&&r(`Sanitized ${i.removedDefinitionOccurrences} invalid definition occurrences across ${i.touchedDocuments} documents before SQLite conversion.`);let a=k();if(!a)throw new Error("scip CLI is not available");Xt(a,["expt-convert","--output",t,e],{env:n,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 Pe(e,t,n){let r=Vt(e)||".scip",i=j(e,r);return f(g(e),`${i}.${n+1}.${t}${r}`)}async function mn(e,t){for(let n=0;n<2;n++){let r=hn(e,t);if(r)return r;let i=yn(e);if(i&&xn(t.trigger,i)){t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`),await Pn(i.pid),y(e,{force:!0});continue}if(i&&!q(i.pid)){y(e,{force:!0});continue}throw new Error(`Another scip-query reindex is already running for ${g(e)}.`)}throw new Error(`Could not acquire scip-query reindex lock for ${g(e)}.`)}function hn(e,t){let n;try{n=Yt(e,"wx")}catch(i){if((typeof i=="object"&&i&&"code"in i?i.code:void 0)==="EEXIST")return null;throw i}let r={version:1,pid:process.pid,projectRoot:t.projectRoot,startedAt:new Date().toISOString(),trigger:t.trigger};return ye(n,JSON.stringify(r)+`
10
+ `),()=>{try{Ht(n)}finally{y(e,{force:!0})}}}function yn(e){try{let t=JSON.parse(I(e,"utf-8"));return typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0?null:{version:1,pid:t.pid,projectRoot:typeof t.projectRoot=="string"?t.projectRoot:g(e),startedAt:typeof t.startedAt=="string"?t.startedAt:"unknown",trigger:t.trigger}}catch{return null}}function xn(e,t){return e?.kind==="manual-cli"&&bn(t?.trigger)}function bn(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function Pn(e){me(e,"SIGTERM"),!await he(e,2e3)&&(me(e,"SIGKILL"),await he(e,1e3))}function me(e,t){try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}async function he(e,t){let n=Date.now()+t;for(;Date.now()<n;){if(!q(e))return!0;await Sn(50)}return!q(e)}function q(e){try{return process.kill(e,0),!0}catch{return!1}}function Sn(e){return new Promise(t=>setTimeout(t,e))}function vn(e){W(e.tempOutputScip,e.outputScip),W(e.tempOutputDb,e.outputDb),W(e.tempMetaPath,e.metaPath)}function W(e,t){y(`${t}.tmp-replace`,{force:!0}),h(e,`${t}.tmp-replace`),h(`${t}.tmp-replace`,t)}function jn(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:Re(n),typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:ve(n.typescriptProjects),clojureConfigPath:je(n.clojureConfigPath),files:L(e)}}function Se(e,t,n){return Object.fromEntries(t.map(r=>{let i=D(r).markerFiles,a=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:ve(n.typescriptProjects)}:{typescriptProjectMode:"single",typescriptProjects:[]},s=r==="clojure"?je(n.clojureConfigPath):void 0;return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&Re(n),...a,clojureConfigPath:s,files:L(e,{language:r,markerFiles:i})}]}))}function ve(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function je(e){return e?.trim()||void 0}function Re(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function Ie(e,t){return f(g(e),"language-indexes",`${t}.scip`)}function Rn(e,t){try{let n=JSON.parse(I(e,"utf-8"));return(n.version===2||n.version===3)&&n.status==="complete"&&m(n.fingerprint)===m(t)&&m([...n.indexedLanguages??[]].sort())===m(t.languages)}catch{return!1}}function ke(e,t){let n=`${e}.tmp-${process.pid}-${Date.now()}`;ye(n,`${JSON.stringify(t,null,2)}
11
+ `),h(n,e)}function Ce(e,t){try{let n=JSON.parse(I(e,"utf-8"));if(n.version!==2&&n.version!==3)return;ke(e,{...n,lastRefresh:t})}catch{}}function z(e){return{trigger:e.trigger??{kind:"unknown"},result:e.result,startedAt:new Date(e.start).toISOString(),completedAt:new Date().toISOString(),durationMs:Date.now()-e.start,indexedLanguages:e.languages?[...e.languages]:void 0,skipped:e.skipped?[...e.skipped]:void 0,error:e.error}}function m(e){return JSON.stringify(e)}var De=process.env.SCIP_REINDEX_PROJECT_ROOT,Oe=process.env.SCIP_REINDEX_OUTPUT_SCIP,Ee=process.env.SCIP_REINDEX_OUTPUT_DB,we=process.env.SCIP_REINDEX_LANGUAGES,In=On(process.env.SCIP_REINDEX_INDEXER_CONCURRENCY),kn=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1",Le=Dn(process.env.SCIP_REINDEX_TYPESCRIPT_CONFIG),Cn=process.env.SCIP_REINDEX_CLOJURE_CONFIG_PATH||void 0,wn=Mn(process.env.SCIP_REINDEX_TRIGGER_KIND),Ln=process.env.SCIP_REINDEX_TRIGGER_DETAIL;(!De||!Oe||!Ee)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var Me=we?we.split(",").filter(Boolean):void 0;xe({projectRoot:De,outputScip:Oe,outputDb:Ee,languages:Me?.length?Me:void 0,pnpmWorkspaces:kn,typescriptProjectMode:Le.projectMode,typescriptProjects:Le.projects,clojureConfigPath:Cn,indexerConcurrency:In,trigger:{kind:wn,detail:Ln||void 0},onStatus:e=>process.stderr.write(`[reindex] ${e}
12
+ `)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});function Mn(e){switch(e){case"manual-cli":case"setup":case"watch-source":case"watch-git-head":case"watch-git-index":case"watch-git-state":return e;default:return"unknown"}}function Dn(e){if(!e)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};let n=t,r=n.projectMode==="single"||n.projectMode==="workspace"?n.projectMode:void 0,i=Array.isArray(n.projects)?n.projects.filter(a=>typeof a=="string"&&a.trim()!==""):void 0;return{projectMode:r,projects:i&&i.length>0?i:void 0}}catch{return{}}}function On(e){if(!e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0}
13
13
  //# sourceMappingURL=reindex-worker.js.map