scip-query 0.23.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (650) hide show
  1. package/CHANGELOG.md +491 -2
  2. package/README.md +111 -122
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-PRVFAGTQ.js +2 -0
  5. package/dist/call-graph-DVPAQV2F.js +2 -0
  6. package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
  7. package/dist/chunk-2FSBGL5P.js +2 -0
  8. package/dist/chunk-2HLAFUCY.js +2 -0
  9. package/dist/chunk-2IWUT6CJ.js +3 -0
  10. package/dist/chunk-2KNN7GTQ.js +2 -0
  11. package/dist/chunk-2LHXRE2B.js +8 -0
  12. package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
  13. package/dist/chunk-36SGVCGX.js +2 -0
  14. package/dist/chunk-3ABBFPTP.js +2 -0
  15. package/dist/chunk-3IVFU4FD.js +3 -0
  16. package/dist/chunk-3JIQS44J.js +7 -0
  17. package/dist/chunk-3ZRB6DNK.js +7 -0
  18. package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
  19. package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
  20. package/dist/chunk-4BP3UBDG.js +2 -0
  21. package/dist/chunk-4D6RO7G4.js +2 -0
  22. package/dist/chunk-4FEWQ6RH.js +2 -0
  23. package/dist/chunk-4IGEOBG7.js +2 -0
  24. package/dist/chunk-4QZXBUKC.js +2 -0
  25. package/dist/chunk-4WBDEVX2.js +4 -0
  26. package/dist/chunk-4WCUBZU3.js +8 -0
  27. package/dist/chunk-4WTUBQ36.js +40 -0
  28. package/dist/chunk-4XQ4O6IM.js +3 -0
  29. package/dist/chunk-55UQAMZO.js +4 -0
  30. package/dist/chunk-5D2LVK7O.js +125 -0
  31. package/dist/chunk-5IYJ56TT.js +2 -0
  32. package/dist/chunk-5PLMJC7Q.js +2 -0
  33. package/dist/chunk-5TNQJUR2.js +5 -0
  34. package/dist/chunk-62BDNPMI.js +2 -0
  35. package/dist/chunk-64DZ5TXR.js +7 -0
  36. package/dist/chunk-65245JCM.js +2 -0
  37. package/dist/chunk-6FFVZZL4.js +2 -0
  38. package/dist/chunk-6KO5JHAR.js +2 -0
  39. package/dist/chunk-6LRXOOSX.js +2 -0
  40. package/dist/chunk-6LSEIIF7.js +2 -0
  41. package/dist/chunk-6YMNWD3H.js +6 -0
  42. package/dist/chunk-72AD6ZRR.js +5 -0
  43. package/dist/chunk-73AAKPUC.js +4 -0
  44. package/dist/chunk-76CZ77DF.js +2 -0
  45. package/dist/chunk-7VPEEAAG.js +2 -0
  46. package/dist/chunk-7WTPQ4NX.js +14 -0
  47. package/dist/chunk-7Y5T6XDP.js +2 -0
  48. package/dist/chunk-A2IIGFMJ.js +5 -0
  49. package/dist/chunk-AB5KCTEV.js +2 -0
  50. package/dist/chunk-AC566WBP.js +6 -0
  51. package/dist/chunk-AGWFSTXC.js +3 -0
  52. package/dist/chunk-AOSIYPTA.js +2 -0
  53. package/dist/chunk-AUVEWPIF.js +2 -0
  54. package/dist/chunk-B56T42J3.js +25 -0
  55. package/dist/chunk-BIQEF5NE.js +2 -0
  56. package/dist/chunk-BL6XJKTA.js +3 -0
  57. package/dist/chunk-BMKOQJRI.js +2 -0
  58. package/dist/chunk-BOZ4EXBB.js +3 -0
  59. package/dist/chunk-BUTWYEPH.js +2 -0
  60. package/dist/chunk-BZB4QPIP.js +2 -0
  61. package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
  62. package/dist/chunk-CFN45HFP.js +2 -0
  63. package/dist/chunk-CFYMZFXT.js +368 -0
  64. package/dist/chunk-CN5EH7O3.js +2 -0
  65. package/dist/chunk-D254DNNQ.js +4 -0
  66. package/dist/chunk-D3FDISIC.js +2 -0
  67. package/dist/chunk-D3NX5XIE.js +3 -0
  68. package/dist/chunk-DA7RPPDF.js +3 -0
  69. package/dist/chunk-DDMC3FON.js +3 -0
  70. package/dist/chunk-DIO3FUSG.js +2 -0
  71. package/dist/chunk-DJ2NNSUK.js +3 -0
  72. package/dist/chunk-DKYQIM3C.js +18 -0
  73. package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
  74. package/dist/chunk-DVFP6PZI.js +2 -0
  75. package/dist/chunk-E3FDPXZK.js +2 -0
  76. package/dist/chunk-E7YNJLCB.js +2 -0
  77. package/dist/chunk-EFGW5JPH.js +2 -0
  78. package/dist/chunk-EJVTR244.js +13 -0
  79. package/dist/chunk-EOV7RTRZ.js +2 -0
  80. package/dist/chunk-ETOIKRHO.js +2 -0
  81. package/dist/chunk-EYK3ZAO2.js +3 -0
  82. package/dist/chunk-F2V2LPET.js +52 -0
  83. package/dist/chunk-F4LUHJTF.js +2 -0
  84. package/dist/chunk-F4PUT6IT.js +2 -0
  85. package/dist/chunk-F56GCXXS.js +5 -0
  86. package/dist/chunk-FC2EVQRM.js +2 -0
  87. package/dist/chunk-FL7NBMHP.js +3 -0
  88. package/dist/chunk-FMRN2TRL.js +3 -0
  89. package/dist/chunk-FVULPZDF.js +20 -0
  90. package/dist/chunk-GCKCF5FL.js +43 -0
  91. package/dist/chunk-GH2PYF46.js +2 -0
  92. package/dist/chunk-GHJAGXIP.js +2 -0
  93. package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
  94. package/dist/chunk-GS6KDO4R.js +2 -0
  95. package/dist/chunk-GUUBXNN7.js +2 -0
  96. package/dist/chunk-GVWX5T43.js +80 -0
  97. package/dist/chunk-GZKFETP5.js +2 -0
  98. package/dist/chunk-H4EQHO6J.js +9 -0
  99. package/dist/chunk-H73WY2RM.js +2 -0
  100. package/dist/chunk-H75GSPRV.js +60 -0
  101. package/dist/chunk-HDR3AHSV.js +61 -0
  102. package/dist/chunk-HQBSL74Y.js +2 -0
  103. package/dist/chunk-HRRFKWPZ.js +2 -0
  104. package/dist/chunk-HXENDJC6.js +2 -0
  105. package/dist/chunk-IIBAZNSW.js +21 -0
  106. package/dist/chunk-INLMWEUU.js +12 -0
  107. package/dist/chunk-IWQPAF4F.js +2 -0
  108. package/dist/chunk-IZJ6YUKP.js +35 -0
  109. package/dist/chunk-J2TMAIN5.js +60 -0
  110. package/dist/chunk-J5FJMODQ.js +142 -0
  111. package/dist/chunk-J7HZPIO3.js +2 -0
  112. package/dist/chunk-JEVRKFRL.js +2 -0
  113. package/dist/chunk-JFXSGAEB.js +30 -0
  114. package/dist/chunk-JVRTHGFS.js +3 -0
  115. package/dist/chunk-JYWEX7RR.js +360 -0
  116. package/dist/chunk-K3YL22N6.js +2 -0
  117. package/dist/chunk-K4CN7GXK.js +12 -0
  118. package/dist/chunk-K5TBVXU4.js +30 -0
  119. package/dist/chunk-KDDIE2DP.js +9 -0
  120. package/dist/chunk-KHWRRPV4.js +2 -0
  121. package/dist/chunk-KI6NBKDY.js +14 -0
  122. package/dist/chunk-KU3QRSTH.js +2 -0
  123. package/dist/chunk-KZBJWZJB.js +2 -0
  124. package/dist/chunk-L7GFM3NP.js +3 -0
  125. package/dist/chunk-LMO6PK3V.js +35 -0
  126. package/dist/chunk-LN4YXJJU.js +2 -0
  127. package/dist/chunk-LOVIZBJ4.js +43 -0
  128. package/dist/chunk-LPCRK4A2.js +11 -0
  129. package/dist/chunk-MMHZKBFA.js +2 -0
  130. package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
  131. package/dist/chunk-N2WN6I3L.js +2 -0
  132. package/dist/chunk-N3ORQT7L.js +2 -0
  133. package/dist/chunk-NAZ3RAIW.js +2 -0
  134. package/dist/chunk-NDUNO5JQ.js +2 -0
  135. package/dist/chunk-NEIWRNAZ.js +4 -0
  136. package/dist/chunk-NJJMVD65.js +2 -0
  137. package/dist/chunk-NLOQOBXI.js +20 -0
  138. package/dist/chunk-NOLZOVCU.js +2 -0
  139. package/dist/chunk-NOWINRRN.js +2 -0
  140. package/dist/chunk-NZAXKGRL.js +16 -0
  141. package/dist/chunk-O2C4UILI.js +2 -0
  142. package/dist/chunk-O3RHA6ZT.js +3 -0
  143. package/dist/chunk-O4UZSPPI.js +3 -0
  144. package/dist/chunk-OGFV2BUX.js +2 -0
  145. package/dist/chunk-OZCJXZK6.js +499 -0
  146. package/dist/chunk-P6ODM7BY.js +2 -0
  147. package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
  148. package/dist/chunk-PH52RA7D.js +2 -0
  149. package/dist/chunk-PKN354TH.js +3 -0
  150. package/dist/chunk-PWOASWEG.js +11 -0
  151. package/dist/chunk-QIWXRW72.js +2 -0
  152. package/dist/chunk-QJRMOK5N.js +2 -0
  153. package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
  154. package/dist/chunk-QXEUDXBT.js +3 -0
  155. package/dist/chunk-QYUVVBMR.js +6 -0
  156. package/dist/chunk-QZ7KQZRN.js +2 -0
  157. package/dist/chunk-R6LQBUDH.js +2 -0
  158. package/dist/chunk-RBS42E55.js +20 -0
  159. package/dist/chunk-RSJKPCFX.js +26 -0
  160. package/dist/chunk-S6CZA3MV.js +2 -0
  161. package/dist/chunk-STMVAHJP.js +2 -0
  162. package/dist/chunk-SYVPTTVW.js +2 -0
  163. package/dist/chunk-T3I6NHBH.js +2 -0
  164. package/dist/chunk-T6DK3ZP7.js +2 -0
  165. package/dist/chunk-TKD34PHN.js +4 -0
  166. package/dist/chunk-TNNQFH7W.js +2 -0
  167. package/dist/chunk-TNV7SSUF.js +2 -0
  168. package/dist/chunk-TO7ZR3EH.js +8 -0
  169. package/dist/chunk-TOU3CHK4.js +2 -0
  170. package/dist/chunk-TRBI4UKT.js +2 -0
  171. package/dist/chunk-TZCVNCAN.js +4 -0
  172. package/dist/chunk-U4LZA5LL.js +3 -0
  173. package/dist/chunk-U5RIG3JP.js +3 -0
  174. package/dist/chunk-UP5KXN2I.js +2 -0
  175. package/dist/chunk-UQFR3NDH.js +5 -0
  176. package/dist/chunk-UXYXF7GV.js +2 -0
  177. package/dist/chunk-VB3GOKOS.js +2 -0
  178. package/dist/chunk-VF5JZICY.js +2 -0
  179. package/dist/chunk-VTY3VK6E.js +2 -0
  180. package/dist/chunk-VX2O4RIS.js +2 -0
  181. package/dist/chunk-WKPV2TDZ.js +2 -0
  182. package/dist/chunk-WOFQ5DTB.js +2 -0
  183. package/dist/chunk-WS4C6TCK.js +2 -0
  184. package/dist/chunk-WXU3DGPU.js +2 -0
  185. package/dist/chunk-X6RMKHJQ.js +81 -0
  186. package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
  187. package/dist/chunk-XHTVFLWW.js +2 -0
  188. package/dist/chunk-XKIDJCIK.js +2 -0
  189. package/dist/chunk-XTYTYZPT.js +2 -0
  190. package/dist/chunk-Y2JHHTTA.js +2 -0
  191. package/dist/chunk-YGVRMGYN.js +4 -0
  192. package/dist/chunk-YNQCGEQE.js +2 -0
  193. package/dist/chunk-YOQVEXVE.js +14 -0
  194. package/dist/chunk-YRT2WLYY.js +2 -0
  195. package/dist/chunk-YTAP5Y2G.js +2 -0
  196. package/dist/chunk-YTYWI7VB.js +2 -0
  197. package/dist/chunk-YULZRALL.js +2 -0
  198. package/dist/chunk-Z33WQG4Q.js +2 -0
  199. package/dist/chunk-ZGTYGDMF.js +16 -0
  200. package/dist/chunk-ZHMRSZFD.js +43 -0
  201. package/dist/chunk-ZHSP366W.js +10 -0
  202. package/dist/chunk-ZIBYCYKK.js +7 -0
  203. package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
  204. package/dist/chunk-ZO4YXUT6.js +4 -0
  205. package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
  206. package/dist/cli-main.js +6 -6
  207. package/dist/cli.js +1 -1
  208. package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
  209. package/dist/code-IL5WH3NZ.js +2 -0
  210. package/dist/code-result-json-ANTBEDFP.js +4 -0
  211. package/dist/command-descriptors-HEEMDHTU.js +222 -0
  212. package/dist/deps-EOWFC6FD.js +2 -0
  213. package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
  214. package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
  215. package/dist/files-K4AI3JUM.js +2 -0
  216. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  217. package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
  218. package/dist/hierarchy-6W5NDIFI.js +2 -0
  219. package/dist/imports-WH365QY4.js +2 -0
  220. package/dist/index.d.ts +13 -1
  221. package/dist/index.js +1 -1
  222. package/dist/members-K3PHMF5S.js +2 -0
  223. package/dist/methods-E7KVMBX4.js +2 -0
  224. package/dist/output-continuation-command-BJSY67SN.js +3 -0
  225. package/dist/output-pagination-UZJ5ACIX.js +24 -0
  226. package/dist/postinstall.js +1 -1
  227. package/dist/project-reindex-EP24WT4X.js +3 -0
  228. package/dist/queries/affected.js +1 -1
  229. package/dist/queries/architecture.d.ts +15 -4
  230. package/dist/queries/architecture.js +1 -1
  231. package/dist/queries/bottlenecks.js +1 -1
  232. package/dist/queries/by-kind.js +1 -1
  233. package/dist/queries/call-graph.d.ts +3 -1
  234. package/dist/queries/call-graph.js +1 -1
  235. package/dist/queries/change-surface.d.ts +1 -0
  236. package/dist/queries/change-surface.js +1 -1
  237. package/dist/queries/cleanup-plan.d.ts +3 -3
  238. package/dist/queries/cleanup-plan.js +1 -1
  239. package/dist/queries/co-change.d.ts +20 -2
  240. package/dist/queries/co-change.js +1 -1
  241. package/dist/queries/code.d.ts +1 -1
  242. package/dist/queries/code.js +1 -1
  243. package/dist/queries/complexity.d.ts +6 -3
  244. package/dist/queries/complexity.js +1 -1
  245. package/dist/queries/context.d.ts +1 -7
  246. package/dist/queries/context.js +1 -1
  247. package/dist/queries/coupling.js +1 -1
  248. package/dist/queries/cycles.js +1 -1
  249. package/dist/queries/dead.d.ts +2 -0
  250. package/dist/queries/dead.js +1 -1
  251. package/dist/queries/decorative-checkers.js +1 -1
  252. package/dist/queries/dependence-slice.d.ts +46 -22
  253. package/dist/queries/dependence-slice.js +1 -1
  254. package/dist/queries/dependency-depth.d.ts +1 -7
  255. package/dist/queries/dependency-depth.js +1 -1
  256. package/dist/queries/deps.js +1 -1
  257. package/dist/queries/diff-impact.d.ts +3 -1
  258. package/dist/queries/diff-impact.js +1 -1
  259. package/dist/queries/doc-drift.js +1 -1
  260. package/dist/queries/drift.d.ts +1 -1
  261. package/dist/queries/drift.js +1 -1
  262. package/dist/queries/duplicate-bodies.d.ts +29 -2
  263. package/dist/queries/duplicate-bodies.js +1 -1
  264. package/dist/queries/entry-map.d.ts +2 -4
  265. package/dist/queries/entry-map.js +1 -1
  266. package/dist/queries/evidence.d.ts +121 -61
  267. package/dist/queries/evidence.js +1 -1
  268. package/dist/queries/fan.js +1 -1
  269. package/dist/queries/files.js +1 -1
  270. package/dist/queries/health.d.ts +1 -1
  271. package/dist/queries/health.js +1 -1
  272. package/dist/queries/hierarchy.d.ts +2 -2
  273. package/dist/queries/hierarchy.js +1 -1
  274. package/dist/queries/hotspots.d.ts +1 -1
  275. package/dist/queries/hotspots.js +1 -1
  276. package/dist/queries/imports.d.ts +1 -0
  277. package/dist/queries/imports.js +1 -1
  278. package/dist/queries/incomplete-migration.d.ts +3 -3
  279. package/dist/queries/incomplete-migration.js +1 -1
  280. package/dist/queries/index.d.ts +17 -65
  281. package/dist/queries/index.js +1 -1
  282. package/dist/queries/locality-candidates.d.ts +4 -4
  283. package/dist/queries/locality-candidates.js +1 -1
  284. package/dist/queries/members.d.ts +2 -2
  285. package/dist/queries/members.js +1 -1
  286. package/dist/queries/methods.js +1 -1
  287. package/dist/queries/not-implemented.d.ts +2 -6
  288. package/dist/queries/not-implemented.js +1 -1
  289. package/dist/queries/outline.js +1 -1
  290. package/dist/queries/passthrough-candidates.d.ts +9 -1
  291. package/dist/queries/passthrough-candidates.js +1 -1
  292. package/dist/queries/react-component-duplicates.d.ts +19 -3
  293. package/dist/queries/react-component-duplicates.js +1 -1
  294. package/dist/queries/react-hook-candidates.d.ts +22 -3
  295. package/dist/queries/react-hook-candidates.js +1 -1
  296. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  297. package/dist/queries/react-large-component-pressure.js +1 -1
  298. package/dist/queries/recent-duplicates.js +1 -1
  299. package/dist/queries/redundant-reexports.d.ts +4 -14
  300. package/dist/queries/redundant-reexports.js +1 -1
  301. package/dist/queries/refs.d.ts +4 -1
  302. package/dist/queries/refs.js +1 -1
  303. package/dist/queries/review.d.ts +188 -0
  304. package/dist/queries/review.js +2 -0
  305. package/dist/queries/similar-files.d.ts +7 -10
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.js +1 -1
  308. package/dist/queries/similar.d.ts +19 -1
  309. package/dist/queries/similar.js +1 -1
  310. package/dist/queries/slice-cohesion.d.ts +205 -0
  311. package/dist/queries/slice-cohesion.js +2 -0
  312. package/dist/queries/source-inspection.d.ts +6 -202
  313. package/dist/queries/source-inspection.js +1 -1
  314. package/dist/queries/source-search.d.ts +2 -3
  315. package/dist/queries/source-search.js +1 -1
  316. package/dist/queries/stats.d.ts +1 -0
  317. package/dist/queries/stats.js +1 -1
  318. package/dist/queries/surface.js +1 -1
  319. package/dist/queries/symbols.js +1 -1
  320. package/dist/queries/system.d.ts +4 -2
  321. package/dist/queries/system.js +1 -1
  322. package/dist/queries/test-quality.d.ts +1 -1
  323. package/dist/queries/test-quality.js +1 -1
  324. package/dist/queries/twin-drift.d.ts +23 -7
  325. package/dist/queries/twin-drift.js +1 -1
  326. package/dist/queries/unused-imports.js +1 -1
  327. package/dist/queries/unused-params.d.ts +3 -15
  328. package/dist/queries/unused-params.js +1 -1
  329. package/dist/queries/vue-component-duplicates.js +1 -1
  330. package/dist/queries/vue-composable-candidates.js +1 -1
  331. package/dist/queries/vue-large-view-pressure.js +1 -1
  332. package/dist/query-service-fastpath.js +5 -5
  333. package/dist/query-service-server.js +4 -4
  334. package/dist/refs-CCBJG7WK.js +2 -0
  335. package/dist/refs-pagination-DRNLVU4S.js +2 -0
  336. package/dist/reindex-worker.js +79 -29
  337. package/dist/reindex.js +45 -45
  338. package/dist/repository-cache-worker.js +2 -0
  339. package/dist/runtime.d.ts +8 -8
  340. package/dist/runtime.js +3 -4
  341. package/dist/rust-semantic-session-server.js +1 -1
  342. package/dist/rust-semantic-session-worker.js +1 -1
  343. package/dist/rust-semantic-worker.js +1 -1
  344. package/dist/service-queries-2WAJI7R6.js +6 -0
  345. package/dist/source-inspection-91U9zdO3.d.ts +341 -0
  346. package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
  347. package/dist/stats-G7DIV6VU.js +2 -0
  348. package/dist/surface-IO55UALI.js +2 -0
  349. package/dist/system-ZBMSHJXU.js +2 -0
  350. package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
  351. package/dist/typescript-indexer.js +2 -0
  352. package/dist/typescript-mailbox-worker.js +1 -1
  353. package/dist/watch-server.js +3 -3
  354. package/docs/AGENT_GUIDE.md +19 -128
  355. package/docs/CLI_JSON_OUTPUT.md +21 -17
  356. package/docs/COMMAND_REFERENCE.md +34 -49
  357. package/docs/CURRENT_COMMANDS.md +123 -0
  358. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
  359. package/docs/DETECTOR_GUIDE.md +55 -12
  360. package/docs/PRODUCT_VISION.md +135 -0
  361. package/docs/PROPERTY_TESTING.md +73 -0
  362. package/docs/REVIEW.md +76 -0
  363. package/docs/SKILLS.md +51 -0
  364. package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
  365. package/docs/accuracy-audit-checklist.md +70 -13
  366. package/docs/analyzer-inventory.md +2 -2
  367. package/docs/locality-analyzer-design.md +9 -9
  368. package/package.json +18 -80
  369. package/scripts/evidence-product-contract.mjs +7 -3
  370. package/scripts/record-review-coverage.mjs +118 -0
  371. package/scripts/scip-windows-provenance.mjs +29 -19
  372. package/skills/scip-architecture-review/SKILL.md +57 -0
  373. package/skills/scip-architecture-review/agents/openai.yaml +4 -0
  374. package/skills/scip-architecture-review/references/design-checks.md +17 -0
  375. package/skills/scip-explore/SKILL.md +15 -59
  376. package/skills/scip-explore/agents/openai.yaml +3 -3
  377. package/skills/scip-explore/references/external-evidence.md +2 -2
  378. package/skills/scip-explore/references/information-model.md +26 -29
  379. package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
  380. package/skills/scip-integrity-audit/SKILL.md +53 -181
  381. package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
  382. package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
  383. package/skills/scip-plan/SKILL.md +39 -65
  384. package/skills/scip-plan/agents/openai.yaml +2 -2
  385. package/skills/scip-query/SKILL.md +28 -81
  386. package/skills/scip-query/agents/openai.yaml +2 -2
  387. package/skills/scip-query/references/command-guide.md +169 -0
  388. package/skills/scip-setup/SKILL.md +4 -2
  389. package/skills/scip-setup/agents/openai.yaml +3 -3
  390. package/dist/by-kind-XI2CSWEY.js +0 -2
  391. package/dist/call-graph-UONR6JR5.js +0 -2
  392. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  393. package/dist/chunk-26CT72HM.js +0 -2
  394. package/dist/chunk-2E7CX53V.js +0 -2
  395. package/dist/chunk-2GRUZAQF.js +0 -43
  396. package/dist/chunk-2LDBDR6J.js +0 -29
  397. package/dist/chunk-2OOY75BW.js +0 -2
  398. package/dist/chunk-2R3V3PSD.js +0 -4
  399. package/dist/chunk-2WC2OEDO.js +0 -4
  400. package/dist/chunk-35NLDRZC.js +0 -2
  401. package/dist/chunk-3AF4TUFK.js +0 -3
  402. package/dist/chunk-3D3QG236.js +0 -2
  403. package/dist/chunk-3FHOF22C.js +0 -21
  404. package/dist/chunk-3JKSW6LJ.js +0 -2
  405. package/dist/chunk-3L2ZBPEX.js +0 -133
  406. package/dist/chunk-3PJABJSU.js +0 -2
  407. package/dist/chunk-3SVF22I5.js +0 -2
  408. package/dist/chunk-3WR4E3A3.js +0 -3
  409. package/dist/chunk-4FTZ4P5G.js +0 -2
  410. package/dist/chunk-4UX2F3JX.js +0 -2
  411. package/dist/chunk-4WNW27SX.js +0 -2
  412. package/dist/chunk-5ENOG4VP.js +0 -61
  413. package/dist/chunk-64BFSI5I.js +0 -2
  414. package/dist/chunk-66DVSJQG.js +0 -455
  415. package/dist/chunk-6HFCYNYE.js +0 -9
  416. package/dist/chunk-6PQNKL3G.js +0 -3
  417. package/dist/chunk-6V5CNXL6.js +0 -2
  418. package/dist/chunk-6VVV4WRR.js +0 -4
  419. package/dist/chunk-7BWFZPPZ.js +0 -2
  420. package/dist/chunk-7CYG22FH.js +0 -2
  421. package/dist/chunk-7F45LJKI.js +0 -2
  422. package/dist/chunk-7IWV2EG3.js +0 -3
  423. package/dist/chunk-7KCZELVM.js +0 -2
  424. package/dist/chunk-AFHTBORT.js +0 -2
  425. package/dist/chunk-AVRYW5OZ.js +0 -2
  426. package/dist/chunk-B3X6KU75.js +0 -2
  427. package/dist/chunk-B5D7QPBE.js +0 -4
  428. package/dist/chunk-BBCIS4DX.js +0 -16
  429. package/dist/chunk-BDUVI7TO.js +0 -3
  430. package/dist/chunk-BE7ZZTMC.js +0 -2
  431. package/dist/chunk-BHVUJOCQ.js +0 -3
  432. package/dist/chunk-BJT7LSPK.js +0 -3
  433. package/dist/chunk-BKVWUP7Y.js +0 -2
  434. package/dist/chunk-BQGB4HBD.js +0 -2
  435. package/dist/chunk-BRV7PIFF.js +0 -2
  436. package/dist/chunk-CEEZJXEF.js +0 -2
  437. package/dist/chunk-CIYLO6SI.js +0 -7
  438. package/dist/chunk-CJZXN4NU.js +0 -2
  439. package/dist/chunk-CNO7TOKL.js +0 -2
  440. package/dist/chunk-COF23M5F.js +0 -2
  441. package/dist/chunk-CWFP7GM5.js +0 -2
  442. package/dist/chunk-D2DHWI3D.js +0 -2
  443. package/dist/chunk-D4N5SQ2M.js +0 -4
  444. package/dist/chunk-DBRSYFXR.js +0 -2
  445. package/dist/chunk-DHUIOLDT.js +0 -2
  446. package/dist/chunk-DIRJWYBM.js +0 -6
  447. package/dist/chunk-DIUFNHRJ.js +0 -35
  448. package/dist/chunk-DRENNWRG.js +0 -2
  449. package/dist/chunk-DTZCKZEU.js +0 -4
  450. package/dist/chunk-DULC3QFP.js +0 -5
  451. package/dist/chunk-DYGHBZ2N.js +0 -16
  452. package/dist/chunk-E5R6AQ73.js +0 -40
  453. package/dist/chunk-E73UNJTF.js +0 -38
  454. package/dist/chunk-EKV5HX33.js +0 -2
  455. package/dist/chunk-EQHFIL6T.js +0 -3
  456. package/dist/chunk-ESIQ66Z7.js +0 -2
  457. package/dist/chunk-EVFUMY4R.js +0 -3
  458. package/dist/chunk-F7DY272B.js +0 -2
  459. package/dist/chunk-FBN2FGXG.js +0 -2
  460. package/dist/chunk-FDLOBR6P.js +0 -4
  461. package/dist/chunk-FESCRNVV.js +0 -5
  462. package/dist/chunk-FFRKR4EQ.js +0 -2
  463. package/dist/chunk-FGA2U4OR.js +0 -8
  464. package/dist/chunk-FIQRSHVM.js +0 -2
  465. package/dist/chunk-FPYLNQPT.js +0 -2
  466. package/dist/chunk-FRUSVINH.js +0 -2
  467. package/dist/chunk-GSP44ENC.js +0 -2
  468. package/dist/chunk-GUFSG5TX.js +0 -2
  469. package/dist/chunk-GYIZ4NXB.js +0 -2
  470. package/dist/chunk-GZIUDL6G.js +0 -2
  471. package/dist/chunk-H5EXS3HM.js +0 -2
  472. package/dist/chunk-HCXEQRFF.js +0 -18
  473. package/dist/chunk-HEHOQQKH.js +0 -2
  474. package/dist/chunk-HKGFPJ4T.js +0 -4
  475. package/dist/chunk-HLZTEXRA.js +0 -2
  476. package/dist/chunk-HOENASQM.js +0 -3
  477. package/dist/chunk-HVF5VBG6.js +0 -2
  478. package/dist/chunk-I55I7XXP.js +0 -2
  479. package/dist/chunk-IDFEUFKS.js +0 -2
  480. package/dist/chunk-IHGQTTVW.js +0 -2
  481. package/dist/chunk-IICPE7B2.js +0 -20
  482. package/dist/chunk-IL676XCC.js +0 -18
  483. package/dist/chunk-IW5XQG5G.js +0 -2
  484. package/dist/chunk-IZDPJ2QI.js +0 -2
  485. package/dist/chunk-J66VOFW6.js +0 -5
  486. package/dist/chunk-JFMEXGFE.js +0 -2
  487. package/dist/chunk-JGKUET5J.js +0 -3
  488. package/dist/chunk-JS4PGXMV.js +0 -3
  489. package/dist/chunk-JWTGMPIT.js +0 -80
  490. package/dist/chunk-JYR66JN5.js +0 -5
  491. package/dist/chunk-KFOYCQAJ.js +0 -9
  492. package/dist/chunk-KLFEXGQA.js +0 -2
  493. package/dist/chunk-KMVGRIO2.js +0 -2
  494. package/dist/chunk-KYSDI3GE.js +0 -5
  495. package/dist/chunk-L6PJPETJ.js +0 -29
  496. package/dist/chunk-LDVT66YM.js +0 -2
  497. package/dist/chunk-LEECKFCJ.js +0 -2
  498. package/dist/chunk-LMZ5PRUV.js +0 -2
  499. package/dist/chunk-LQRQN2XA.js +0 -2
  500. package/dist/chunk-LXABEJX3.js +0 -2
  501. package/dist/chunk-MNV5FSBW.js +0 -3
  502. package/dist/chunk-MPQ4OTBM.js +0 -2
  503. package/dist/chunk-MTDBHTSF.js +0 -2
  504. package/dist/chunk-MV3CDXPI.js +0 -38
  505. package/dist/chunk-MWN53KRN.js +0 -60
  506. package/dist/chunk-MXNGIEPU.js +0 -3
  507. package/dist/chunk-N2ZSIIGR.js +0 -117
  508. package/dist/chunk-N5B2NILC.js +0 -5
  509. package/dist/chunk-NJITK2GP.js +0 -2
  510. package/dist/chunk-NOGJXYFO.js +0 -2
  511. package/dist/chunk-NOYBFVJA.js +0 -554
  512. package/dist/chunk-NWQXSFFU.js +0 -3
  513. package/dist/chunk-ODDUPDP7.js +0 -13
  514. package/dist/chunk-OLIWTZI3.js +0 -3
  515. package/dist/chunk-OLNV6I6U.js +0 -2
  516. package/dist/chunk-OR2E3AGZ.js +0 -2
  517. package/dist/chunk-OSR2GEHQ.js +0 -2
  518. package/dist/chunk-OSSESPDX.js +0 -3
  519. package/dist/chunk-OWOOWNJ5.js +0 -7
  520. package/dist/chunk-P42EIXTA.js +0 -2
  521. package/dist/chunk-PJFGPYTU.js +0 -2
  522. package/dist/chunk-PP7KNN7L.js +0 -2
  523. package/dist/chunk-PU7T5QYQ.js +0 -2
  524. package/dist/chunk-PWWAJSKV.js +0 -74
  525. package/dist/chunk-PZL5T7SU.js +0 -73
  526. package/dist/chunk-QBE3YX64.js +0 -23
  527. package/dist/chunk-QGVTFRY2.js +0 -7
  528. package/dist/chunk-QOJONDS7.js +0 -2
  529. package/dist/chunk-QU5XRYB5.js +0 -4
  530. package/dist/chunk-QUU5OBVK.js +0 -11
  531. package/dist/chunk-RBLQNW26.js +0 -20
  532. package/dist/chunk-RTQ7NEKG.js +0 -81
  533. package/dist/chunk-SQXRS7BG.js +0 -4
  534. package/dist/chunk-SSK6LDPC.js +0 -2
  535. package/dist/chunk-SZHGTCPP.js +0 -7
  536. package/dist/chunk-T4N4P2K5.js +0 -16
  537. package/dist/chunk-TA3QKLLU.js +0 -2
  538. package/dist/chunk-TEBQMNVI.js +0 -43
  539. package/dist/chunk-TPFHAQ2G.js +0 -2
  540. package/dist/chunk-TQPCBMWT.js +0 -5
  541. package/dist/chunk-TQZV7KV4.js +0 -2
  542. package/dist/chunk-TRNAEQ6P.js +0 -3
  543. package/dist/chunk-TY7CRN3Z.js +0 -2
  544. package/dist/chunk-UHFYCMZO.js +0 -35
  545. package/dist/chunk-UICY4GTQ.js +0 -7
  546. package/dist/chunk-UVGEWT4Y.js +0 -26
  547. package/dist/chunk-UXW33INU.js +0 -29
  548. package/dist/chunk-VMPRET3I.js +0 -5
  549. package/dist/chunk-VNLGKHS6.js +0 -6
  550. package/dist/chunk-VQILFTEH.js +0 -2
  551. package/dist/chunk-VUPHCS7Y.js +0 -57
  552. package/dist/chunk-VVZSBTSU.js +0 -23
  553. package/dist/chunk-VZRNID6A.js +0 -2
  554. package/dist/chunk-W5OXRYGE.js +0 -7
  555. package/dist/chunk-W6STWDQI.js +0 -57
  556. package/dist/chunk-W7CXK74K.js +0 -2
  557. package/dist/chunk-WB3WYIRE.js +0 -4
  558. package/dist/chunk-WDNVY4E7.js +0 -20
  559. package/dist/chunk-WK46TNUM.js +0 -3
  560. package/dist/chunk-WNTFFKAX.js +0 -12
  561. package/dist/chunk-WOIKCX6A.js +0 -2
  562. package/dist/chunk-WUN6KBHV.js +0 -2
  563. package/dist/chunk-WYCTJDVR.js +0 -2
  564. package/dist/chunk-WYPL7GF7.js +0 -2
  565. package/dist/chunk-XDAUYDFT.js +0 -2
  566. package/dist/chunk-XDQMU3BT.js +0 -2
  567. package/dist/chunk-XFA4SSO3.js +0 -3
  568. package/dist/chunk-XGZEP6GR.js +0 -8
  569. package/dist/chunk-XPDPNWTQ.js +0 -368
  570. package/dist/chunk-XRYABF57.js +0 -8
  571. package/dist/chunk-YBGKCQIS.js +0 -2
  572. package/dist/chunk-YEN6CYC7.js +0 -16
  573. package/dist/chunk-YF5IB2LF.js +0 -2
  574. package/dist/chunk-YI2AWIHC.js +0 -3
  575. package/dist/chunk-YPWBKGFU.js +0 -2
  576. package/dist/chunk-YPWHBBIS.js +0 -2
  577. package/dist/chunk-YSH6U3L4.js +0 -3
  578. package/dist/chunk-YU5DZUZI.js +0 -10
  579. package/dist/chunk-YWO5DDRC.js +0 -16
  580. package/dist/chunk-Z4CDXYNQ.js +0 -2
  581. package/dist/chunk-ZF5KHH7C.js +0 -2
  582. package/dist/chunk-ZOHS7AQV.js +0 -21
  583. package/dist/chunk-ZTI4SBFV.js +0 -3
  584. package/dist/code-MI6F2TTU.js +0 -2
  585. package/dist/code-result-json-FXALY4HE.js +0 -2
  586. package/dist/command-descriptors-P34VABY5.js +0 -343
  587. package/dist/dataflow-4KEMJPC6.js +0 -2
  588. package/dist/dependence-slice-R7FPWD5M.js +0 -2
  589. package/dist/deps-7EMQUYUT.js +0 -2
  590. package/dist/direct-navigation-6YO234F2.js +0 -3
  591. package/dist/entry-map-KOOLR26E.js +0 -2
  592. package/dist/files-OPIPJIGZ.js +0 -2
  593. package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
  594. package/dist/hierarchy-QPD2CAER.js +0 -2
  595. package/dist/imports-M6HUXRXC.js +0 -2
  596. package/dist/members-I5MEFOCT.js +0 -2
  597. package/dist/methods-5JYGGHXA.js +0 -2
  598. package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
  599. package/dist/output-continuation-command-UPQAAKBP.js +0 -3
  600. package/dist/output-pagination-3OFL2MJV.js +0 -19
  601. package/dist/project-reindex-UKKQ5PLS.js +0 -3
  602. package/dist/queries/anchors.d.ts +0 -123
  603. package/dist/queries/anchors.js +0 -2
  604. package/dist/queries/complexity-hotspots.d.ts +0 -40
  605. package/dist/queries/complexity-hotspots.js +0 -2
  606. package/dist/queries/convergence.d.ts +0 -33
  607. package/dist/queries/convergence.js +0 -2
  608. package/dist/queries/dataflow.d.ts +0 -77
  609. package/dist/queries/dataflow.js +0 -2
  610. package/dist/queries/deep-chains.d.ts +0 -5
  611. package/dist/queries/deep-chains.js +0 -2
  612. package/dist/queries/extract-candidates.d.ts +0 -52
  613. package/dist/queries/extract-candidates.js +0 -2
  614. package/dist/queries/isolated.d.ts +0 -24
  615. package/dist/queries/isolated.js +0 -2
  616. package/dist/queries/plan-context.d.ts +0 -33
  617. package/dist/queries/plan-context.js +0 -2
  618. package/dist/queries/reference-neighborhood.d.ts +0 -4
  619. package/dist/queries/reference-neighborhood.js +0 -2
  620. package/dist/queries/reference-reachability.d.ts +0 -48
  621. package/dist/queries/reference-reachability.js +0 -2
  622. package/dist/queries/self-audit.d.ts +0 -63
  623. package/dist/queries/self-audit.js +0 -2
  624. package/dist/queries/similar-chains.d.ts +0 -48
  625. package/dist/queries/similar-chains.js +0 -2
  626. package/dist/queries/slice.d.ts +0 -4
  627. package/dist/queries/slice.js +0 -2
  628. package/dist/queries/stale-abstractions.d.ts +0 -72
  629. package/dist/queries/stale-abstractions.js +0 -2
  630. package/dist/queries/system-map.d.ts +0 -449
  631. package/dist/queries/system-map.js +0 -2
  632. package/dist/queries/trace.js +0 -2
  633. package/dist/queries/twin-ab.d.ts +0 -66
  634. package/dist/queries/twin-ab.js +0 -2
  635. package/dist/queries/value-flow.d.ts +0 -43
  636. package/dist/queries/value-flow.js +0 -2
  637. package/dist/queries/wrapper-candidates.d.ts +0 -34
  638. package/dist/queries/wrapper-candidates.js +0 -2
  639. package/dist/refs-PSU4JZZW.js +0 -2
  640. package/dist/refs-pagination-JG6CJMRC.js +0 -2
  641. package/dist/slice-HYRATV64.js +0 -2
  642. package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
  643. package/dist/stats-OOJ74B32.js +0 -2
  644. package/dist/surface-VTGDYWF5.js +0 -2
  645. package/dist/symbol-resolution-WD5EU5JE.js +0 -2
  646. package/dist/system-LRQNFOR2.js +0 -2
  647. package/dist/trace-F4B6OLL4.js +0 -2
  648. package/dist/value-flow-VRPZY72V.js +0 -2
  649. package/skills/concrete-plan/SKILL.md +0 -8
  650. package/skills/concrete-plan/agents/openai.yaml +0 -4
@@ -0,0 +1,7 @@
1
+ import{b as C}from"./chunk-O3RHA6ZT.js";import{b as E}from"./chunk-6LSEIIF7.js";import{n as D}from"./chunk-NZAXKGRL.js";import{e as L,g as P}from"./chunk-4WCUBZU3.js";import{d as y,x as v}from"./chunk-5D2LVK7O.js";import{g as S}from"./chunk-A2IIGFMJ.js";function W(e,n={}){let{scope:r,minLoc:t=1,maxDepth:c=5,scanLimit:d}=n,s=new E(e),o=B(e,r,t,d),a=new I;for(let i of o)a.add(i);let u=[],b=new Map;o.length>0&&u.push(k(e,0,o,a));let g=o.map(i=>i.definition).filter(i=>i!==null),x=new Set(o.map(i=>i.symbol)),h=new Set,N=i=>{let f=s.calleeMap(i,{semantic:!1}),l=new Set(h);for(let m of i)for(let p of f.get(m.symbolId)??[])x.has(p.symbol)||l.add(p.symbol);return l},R=i=>{let f=[];for(let l of i){let m=M(e,s,l);if(!m)continue;let p=j(e,m,a);p.removable?(x.add(l),h.delete(l),b.delete(l),f.push(O(m,"cascade"))):p.blockingFiles.length>0&&(h.add(l),b.set(l,{shortName:y(m.symbol),file:m.relativePath,blockingFiles:p.blockingFiles}))}return f};for(let i=1;i<=c&&g.length>0;i++){let f=R(N(g));if(f.length===0)break;for(let l of f)a.add(l);u.push(k(e,i,f,a)),g=f.map(l=>l.definition).filter(l=>l!==null)}let w=u.reduce((i,f)=>i+f.loc,0),_=u.reduce((i,f)=>i+f.entries.length,0);return{batches:u,totalSymbols:_,totalLoc:w,blocked:[...b.values()]}}function B(e,n,r,t){let c=C(e,{scope:n,minLoc:r,skipBarrels:!0,deadCodeOnly:!0,scanLimit:t,semantic:!1}),d=[];for(let s of c.symbols)s.kind==="dead-code"&&(L(e,s.relativePath)||P(e,s.symbol,s.relativePath)||d.push({symbol:s.symbol,shortName:s.shortName,file:s.relativePath,startLine:s.startLine,endLine:s.endLine,loc:s.loc,evidence:"graph-fact",definition:F(e,s.symbol)}));return d}function M(e,n,r){let t=F(e,r);if(t&&!e.isIgnored(t.relativePath)&&!L(e,t.relativePath)&&!P(e,t.symbol,t.relativePath)&&n.fileKind(t.relativePath)!=="test"&&!S(e,t.relativePath,t.startLine,"dead"))return t}function O(e,n){return{symbol:e.symbol,shortName:y(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let r=e.get(`SELECT d.relative_path
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
+ JOIN documents d ON d.id = der.document_id
5
+ WHERE gs.symbol = ?
6
+ LIMIT 1`,n);return r?v(e,r.relative_path).find(t=>t.symbol===n)??null:null}function j(e,n,r){let t=D(e,n);if(t.length===0)return{removable:!1,blockingFiles:[]};let c=new Set;for(let d of t)d.file===n.relativePath&&d.line>=n.startLine&&d.line<=n.endLine||r.contains(d.file,d.line)||c.add(d.file);return{removable:c.size===0,blockingFiles:[...c]}}function k(e,n,r,t){let c=[...r].sort((o,a)=>o.file.localeCompare(a.file)||o.startLine-a.startLine),d=new Set(c.map(o=>o.file)),s=[];for(let o of d){let a=v(e,o);a.length>0&&a.every(u=>t.contains(o,u.startLine))&&s.push(o)}return{depth:n,entries:c.map(({definition:o,...a})=>a),loc:c.reduce((o,a)=>o+a.loc,0),filesEmptied:s.sort()}}var I=class{ranges=new Map;add(n){let r=this.ranges.get(n.file)??[];r.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,r)}contains(n,r){let t=this.ranges.get(n);return t?t.some(c=>r>=c.start&&r<=c.end):!1}};export{W as a,I as b};
7
+ //# sourceMappingURL=chunk-3ZRB6DNK.js.map
@@ -1,2 +1,2 @@
1
1
  import{statSync as r}from"fs";function o(t){let e=t.get("SELECT COUNT(*) as c FROM documents").c,s=t.get("SELECT COUNT(*) as c FROM global_symbols").c,n=t.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,i=t.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:e,symbols:s,definitions:n,references:i,...a(t.generation.databasePath)}}function a(t){try{let e=r(t);return{indexSizeBytes:e.size,lastBuilt:e.mtime}}catch{return{indexSizeBytes:0,lastBuilt:null}}}export{o as a};
2
- //# sourceMappingURL=chunk-6YTSKJJ3.js.map
2
+ //# sourceMappingURL=chunk-42EOW5VI.js.map
@@ -1,2 +1,2 @@
1
- import{c as r}from"./chunk-VMPRET3I.js";function s(o,e,t={}){if(e.length===0)throw new Error("The source search pattern must not be empty.");return r(o,[e],t)[0]}export{s as a};
2
- //# sourceMappingURL=chunk-6I6L7Z62.js.map
1
+ import{c as r}from"./chunk-F56GCXXS.js";function s(o,e,t={}){if(e.length===0)throw new Error("The source search pattern must not be empty.");return r(o,[e],t)[0]}export{s as a};
2
+ //# sourceMappingURL=chunk-4BHGBMNO.js.map
@@ -0,0 +1,2 @@
1
+ import{r as d}from"./chunk-FVULPZDF.js";import{Da as p,c as u,qa as f,ra as l}from"./chunk-5TNQJUR2.js";import{existsSync as S,readdirSync as h,statSync as D}from"fs";import{join as c}from"path";var m="components.json",U=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),K=3,b=/(?:^|\/)components\/ui$/i,A=p("ui-kit-surface",{clearGroups:["whole-project"]});function N(t){return A.get(t,()=>E(t))}function x(t,i){let r=u(i),n=r.lastIndexOf("/");if(n<0)return null;let e=r.slice(0,n);for(let o of N(t).directories)if(e===o.directory)return o;return b.test(e)?{directory:e,source:"ui-directory-convention"}:null}function R(t,i){return x(t,i)!==null}function E(t){let i=new Map;for(let r of M(t.config.projectRoot)){let n=_(t,r);n&&!i.has(n)&&i.set(n,{directory:n,source:"shadcn-components-manifest",manifest:r})}return{directories:[...i.values()].sort((r,n)=>r.directory.localeCompare(n.directory))}}function M(t){let i=[],r=(n,e)=>{let o=n?c(t,n):t,s=n?`${n}/${m}`:m;if(S(c(t,s))&&i.push(s),e>=K)return;let g=T(o);for(let a of g)!a.isDirectory()||U.has(a.name)||a.name.startsWith(".")||r(n?`${n}/${a.name}`:a.name,e+1)};return r("",0),i}function _(t,i){let r;try{r=JSON.parse(f(t.config.projectRoot,i,{inputKind:"components manifest"}))}catch(o){return o instanceof Error&&l(o),null}if(!y(r))return null;let n=r.aliases;if(!y(n))return null;let e=j(n);return e?I(t,i,e):null}function I(t,i,r){let n=i.includes("/")?i.slice(0,i.lastIndexOf("/")):"",e=[];if(r.startsWith("./")||r.startsWith("../")||r.startsWith("/"))e.push(u(c(n,r)));else{let o=d(t,i,r);o&&e.push(o);let s=r.replace(/^[@~]\//,"");e.push(u(c(n,"src",s)),u(c(n,s)))}for(let o of e){let s=c(t.config.projectRoot,o);if(S(s)&&D(s).isDirectory())return o.replace(/\/+$/,"")}return null}function y(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function T(t){try{return h(t,{withFileTypes:!0})}catch{return[]}}function j(t){let i=typeof t.ui=="string"?t.ui:null,r=typeof t.components=="string"?t.components:null;return i??(r?`${r}/ui`:null)}export{x as a,R as b};
2
+ //# sourceMappingURL=chunk-4BP3UBDG.js.map
@@ -0,0 +1,2 @@
1
+ import{a as p}from"./chunk-QXEUDXBT.js";import{H as u,T as h,Y as a,s as c}from"./chunk-J5FJMODQ.js";import{c as m,d as y,e as L,k as g}from"./chunk-YULZRALL.js";function $(n,o){let r=p(n,o);if(!r)return[];let s=a(n,r.relativePath),t=new Set(s.map(e=>e.symbol)),l=h(n,r.relativePath),i=a(n,r.relativePath,{includeClassMemberFallbacks:!0}).filter(e=>e.symbol!==r.symbol).filter(e=>g(r.symbol,e.symbol)).map(e=>({symbol:e.symbol,shortName:m(e.symbol),startLine:t.has(e.symbol)?e.startLine:l.get(e.symbol)?.start_line??e.startLine,endLine:t.has(e.symbol)?e.endLine:l.get(e.symbol)?.end_line??e.endLine,kind:L(e.symbol)??"unknown"})).sort((e,b)=>e.startLine-b.startLine||e.endLine-b.endLine);return c(r.relativePath)!=="clojure"?i:M(i,f(n,r))}function f(n,o){let r=y(o.symbol);if(!r)return[];let s=m(o.symbol);return(u(n,o.relativePath)?.clojureMembers??[]).filter(t=>t.ownerName===r).map(t=>({symbol:`${o.symbol}${t.memberName}().`,shortName:`${s}:${t.memberName}()`,startLine:t.startLine,endLine:t.endLine,kind:t.memberKind}))}function M(n,o){let r=new Map;for(let s of[...n,...o])r.set(`${s.shortName}:${s.startLine}:${s.endLine}`,s);return[...r.values()].sort((s,t)=>s.startLine-t.startLine||s.endLine-t.endLine)}export{$ as a};
2
+ //# sourceMappingURL=chunk-4D6RO7G4.js.map
@@ -0,0 +1,2 @@
1
+ import{a as i,k as p}from"./chunk-U5RIG3JP.js";import f from"better-sqlite3";var d=25,S=new Set(["typescript","javascript"]);function L(r,c,t){let n=null;try{n=new f(r,{readonly:!0,fileMustExist:!0});let e=new Set(n.prepare("SELECT relative_path FROM documents").pluck().all().map(p)),o=h(c,t),a=new Set([...o.values()].flatMap(s=>[...s])),u=[...a].filter(s=>!e.has(s)).sort();if(u.length===0)return{state:"complete",expectedDocumentCount:a.size,actualDocumentCount:e.size};let g=new Set(u),l=t.filter(s=>[...o.get(s)??[]].some(m=>g.has(m)));return{state:"incomplete",expectedDocumentCount:a.size,actualDocumentCount:e.size,missingDocumentCount:u.length,missingPaths:u.slice(0,d),affectedLanguages:l}}catch(e){return{state:"unavailable",reason:e instanceof Error?e.message:String(e)}}finally{n?.close()}}function h(r,c){let t=new Map,n=c.filter(e=>S.has(e));for(let e of n)t.set(e,new Set);for(let e of r.files){let o=p(e.path);for(let a of n)i(o,[a])==="source"&&t.get(a).add(o)}return t}export{L as a};
2
+ //# sourceMappingURL=chunk-4FEWQ6RH.js.map
@@ -0,0 +1,2 @@
1
+ import{b as W,c as H,d as Y}from"./chunk-KU3QRSTH.js";import{a as U}from"./chunk-4FEWQ6RH.js";import{A as v,C,s as G}from"./chunk-BIQEF5NE.js";import{a as N,b as F,d as b}from"./chunk-JEVRKFRL.js";import{a,b as h,f as y,g as T,h as d}from"./chunk-HRRFKWPZ.js";import{C as B,f as $,n as V,x as L,z as q}from"./chunk-TKD34PHN.js";import{L as M,c as g,e as k,o as j,u as _,v as D}from"./chunk-U5RIG3JP.js";import{a as A,h as E,i as m}from"./chunk-62BDNPMI.js";import{existsSync as Ee}from"fs";import{randomUUID as pn}from"crypto";import{isAbsolute as fn,join as _e,relative as gn,resolve as mn}from"path";import{createHash as re}from"crypto";var S=1,K=2,J=1,P=1,x="sha256";function en(e,n,t){if(!d(e)||!y(n))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:J,canonicalizationVersion:P,hashAlgorithm:x,projection:{name:e,version:n},digest:re(x).update(ie(e,n,t)).digest("hex")}}function ie(e,n,t){return`{"canonicalizationVersion":${P},"projection":${JSON.stringify(e)},"projectionVersion":${n},"value":${JSON.stringify(t)}}`}function oe(e){if(!a(e))return{kind:"malformed",reason:"observation receipt must be an object"};let n=e.schemaVersion;if(!Number.isInteger(n))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(n===S)return ae(e)?{kind:"legacy",schemaVersion:S,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(n===K)return ue(e)?{kind:"supported",schemaVersion:K,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let t=n;return{kind:"unsupported",schemaVersion:t,direction:t<S?"older":"future"}}function z(e){let n=oe(e);return n.kind==="legacy"||n.kind==="supported"}function se(e,n){return e.schemaVersion===n.schemaVersion&&e.canonicalizationVersion===n.canonicalizationVersion&&e.hashAlgorithm===n.hashAlgorithm&&e.projection.name===n.projection.name&&e.projection.version===n.projection.version}function ae(e){if(!a(e))return!1;let n=e.index,t=e.worktree;return h(e.observedAt)&&d(e.projectIdentity)&&Oe(e.authorityKind)&&ce(n)&&de(t)&&xe(e.authorityKind,n,t)}function ce(e){return e===void 0||a(e)&&d(e.generationIdentity)&&(e.source==="immutable"||e.source==="legacy")&&(e.alignment==="not-certified"||e.alignment==="leased")}function de(e){return e===void 0||a(e)&&d(e.identity)&&typeof e.clean=="boolean"&&(e.headCommit===void 0||d(e.headCommit))&&(e.treeOid===void 0||d(e.treeOid))}function ue(e){if(!a(e))return!1;let n=e.facts,t=e.observedSources;return!h(e.observedAt)||!a(n)||!pe(t)||!le(e.stabilityProofs,t,n)||!fe(n)?!1:he(e.diagnostics)&&Ce(n,t)}function pe(e){return Array.isArray(e)&&e.length>0&&e.every(be)&&R(e,n=>n.kind)}function le(e,n,t){return Array.isArray(e)&&e.every(ve)&&R(e,r=>r.source)&&!e.some(r=>!n.some(i=>i.kind===r.source))&&e.every(r=>Se(r,t))}function fe(e){return["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(t=>e[t]!==void 0&&!p(e[t]))?!1:ge(e.relevantInputs)&&me(e.index)}function ge(e){return e===void 0||Array.isArray(e)&&e.every(ye)&&R(e,n=>`${n.subject}\0${n.identity.projection.name}`)}function me(e){return e===void 0||a(e)&&p(e.generation)&&(e.inputs===void 0||p(e.inputs))&&(e.source==="immutable"||e.source==="legacy")}function he(e){return e===void 0||a(e)&&(e.clean===void 0||typeof e.clean=="boolean")&&(e.headCommit===void 0||d(e.headCommit))&&(e.treeOid===void 0||d(e.treeOid))}function p(e){return!a(e)||!a(e.projection)?!1:e.schemaVersion===J&&e.canonicalizationVersion===P&&e.hashAlgorithm===x&&d(e.projection.name)&&y(e.projection.version)&&T(e.digest)}function ye(e){return a(e)&&d(e.subject)&&p(e.identity)}function be(e){return a(e)&&Q(e.kind)&&(e.identity===void 0||p(e.identity))}function ve(e){return a(e)&&Q(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,n){let t=e.index,r=n.find(u=>u.kind==="index-generation");if(!Pe(t,r))return!1;let i=e.workspaceInstance,o=n.find(u=>u.kind==="live-workspace");if(o?.identity&&(!p(i)||!O(o.identity,i)))return!1;let s=e.wholeContent,c=n.find(u=>u.kind==="repository-snapshot");return!(c?.identity&&(!p(s)||!O(c.identity,s)))}function Se(e,n){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&a(n.index)&&n.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function O(e,n){return se(e,n)&&e.digest===n.digest}function xe(e,n,t){return e==="index-worktree"?n!==void 0&&t!==void 0:e==="index-only"?n!==void 0&&t===void 0:e==="worktree-only"?n===void 0&&t!==void 0:e==="process-local"&&n===void 0&&t===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function Q(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function R(e,n){return new Set(e.map(n)).size===e.length}function Pe(e,n){if(n){if(!a(e)||!p(e.generation)||n.identity&&!O(n.identity,e.generation))return!1}else if(e!==void 0)return!1;return!0}function on(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e;return Re(n)&&Ie(n)&&we(n)}function Re(e){return e.kind==="automated-adjudication"&&e.policyVersion===1&&(e.decidedBy==="agent"||e.decidedBy==="human")&&F.includes(e.reasonCode)}function Ie(e){return Array.isArray(e.evidence)&&e.evidence.length>0&&e.evidence.every(ke)&&(e.observation===void 0||z(e.observation))}function we(e){return!!e.invalidateOn&&typeof e.invalidateOn=="object"&&typeof e.invalidateOn.targetContentChange=="boolean"&&typeof e.invalidateOn.detectorMajorChange=="boolean"}function ke(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e;return je(n)&&Ae(n)}function je(e){return(e.kind==="source"||e.kind==="config"||e.kind==="test"||e.kind==="graph")&&typeof e.referent=="string"&&e.referent.trim()!==""&&typeof e.claim=="string"&&e.claim.trim()!==""}function Ae(e){return(e.contentHash===void 0||/^[a-f0-9]{64}$/u.test(e.contentHash))&&(e.generation===void 0||typeof e.generation=="string"&&e.generation.length>0)}var l=".scipquery.json",De=2e3,X=5e3,Z=X,Me=15*6e4,ee={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},Te={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:De,cooldownMs:Z,gitPollMs:2e3,idleTimeoutMs:Me,autoRefresh:!0,ignore:[],resourceBudget:ee};var vn=new Set(N);function Cn(e){let n=_e(e,l);if(!Ee(n))return{};let t;try{t=E(n,{maxBytes:A,inputKind:"scip-query project config"})}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${l} at ${n}: ${i}`,{cause:r})}return Ne(Y(t),n,"read").config}function Sn(e){return{...Te,...e.watch,cooldownMs:Math.max(X,e.watch?.cooldownMs??Z),resourceBudget:{...ee,...e.watch?.resourceBudget}}}function Ne(e,n,t){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let i=t==="read"?`invalid ${l} at ${n}: ${e.reason}`:`Cannot update ${n}: the latest project config is ${e.reason}.`;throw new Error(`${i} The file was left untouched.`)}let r=t==="read"?`invalid ${l} at ${n}`:`Cannot update ${n}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${W} and current v${H}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as f,lstatSync as Fe}from"fs";import{dirname as $e,resolve as Ve}from"path";function $n(e,n,t,r={}){let i=new Date().toISOString();if(!f(t.dbPath))return{state:"missing",checkedAt:i,metaPath:t.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!f(t.metaPath))return{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let o=b(m(t.metaPath,"reindex metadata"));return o.kind==="unsupported"?{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Reindex metadata version ${o.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"}:o.kind==="malformed"?{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Could not decode reindex metadata: ${o.reason}`,remedy:"Run: scip-query reindex"}:Le(e,n,t,r,o,i)}catch(o){return{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Could not read reindex metadata: ${o instanceof Error?o.message:String(o)}`,remedy:"Run: scip-query reindex"}}}function Le(e,n,t,r,i,o){let s=i.metadata,c=n.languages??G(e),u=qe(e,n,t,r,c,s.fingerprint),I=[...s.indexedLanguages??[]].sort(),ne=i.capabilities.publishableGeneration&&k(g(s.fingerprint),u)&&JSON.stringify(I)===JSON.stringify(u.languages),{accepted:w,reason:te}=Ue(t,u,I,ne);return{state:w?"fresh":"stale",checkedAt:o,metaPath:t.metaPath,updatedAt:s.updatedAt,lastRefresh:s.lastRefresh,reason:te,remedy:w?void 0:"Run: scip-query reindex"}}function qe(e,n,t,r,i,o){return Be(e,n,t,r,i,o)??Ke(e,i,n,t.cacheDir??$e(t.dbPath))}function Be(e,n,t,r,i,o){if(!t.cacheDir||!r.gitContext||!C(r.gitContext,t.cacheDir,o))return;let s=Ge(e,n,i,r.gitContext,r.gitObservation,o);if(!(!s||!C(s,t.cacheDir,o)))return o}function Ge(e,n,t,r,i,o){if(!Je(o,t,n)||!ze(e,o,n))return;let s=i?.context===r?r:_(r),c=i&&i.context===r?i.projectFileInventorySequence:void 0;return s?.clean&&D(e,void 0,{cachedInventoryAfterSequence:c})?s:void 0}function Ue(e,n,t,r){let i=v(e.dbPath,e.metaPath),o=i.state==="invalid"||i.state==="drifted",s=r?U(e.dbPath,n,t):void 0,c=s?.state==="incomplete";return{accepted:r&&!o&&!c,reason:We(i,s,r)}}function We(e,n,t){return e.state==="invalid"||e.state==="drifted"?`SQLite generation requires repair: ${e.reason}`:n?.state==="incomplete"?`SQLite generation is missing ${n.missingDocumentCount} indexed source document(s): ${n.missingPaths.join(", ")}`:t?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files."}function Vn(e){let n=new Date().toISOString();if(!f(e.dbPath))return{state:"missing",checkedAt:n,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!f(e.metaPath))return{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let t=b(m(e.metaPath,"reindex metadata"));return t.kind==="unsupported"?{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Reindex metadata version ${t.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"}:t.kind==="malformed"?{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${t.reason}`,remedy:"Run: scip-query reindex"}:He(e,n,t)}catch(t){return{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${t instanceof Error?t.message:String(t)}`,remedy:"Run: scip-query reindex"}}}function He(e,n,t){let r=t.metadata,i=Ye(t),o=v(e.dbPath,e.metaPath),s=o.state==="invalid"||o.state==="drifted",c=i&&!s;return{state:c?"fresh":"stale",checkedAt:n,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:s?`SQLite generation requires repair: ${o.reason}`:i?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:c?void 0:"Run: scip-query reindex"}}function Ye(e){let n=e.metadata,t=[...n.indexedLanguages??[]].sort(),r=g(n.fingerprint),i=[...r?.languages??[]].sort();return e.capabilities.publishableGeneration&&r!==null&&JSON.stringify(t)===JSON.stringify(i)}function Ke(e,n,t,r=$(e,t)){return V(e,r,()=>q(e,n,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath}))}function Je(e,n,t){let r=Qe(n,t);return e.version===r.version&&e.typescriptSymbolIdentityVersion===r.typescriptSymbolIdentityVersion&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function ze(e,n,t){if(!(n.languages.includes("typescript")||!!n.clojureConfigPath))return!0;let i=L(e);if(n.clojureConfigPath){let o=j(n.clojureConfigPath);if(!i.includes(o))return!1;try{if(!Fe(Ve(e,o)).isFile())return!1}catch{return!1}}return!n.languages.includes("typescript")||M(e,t.indexer?.typescript?.projectMode,t.indexer?.typescript?.projects??[],i)}function Qe(e,n){return B(e,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}export{K as a,en as b,on as c,Cn as d,Sn as e,$n as f,Vn as g};
2
+ //# sourceMappingURL=chunk-4IGEOBG7.js.map
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-GMVSHUKZ.js";import{a as C}from"./chunk-NOWINRRN.js";import{a as E}from"./chunk-BOJ5SVE2.js";import{b as T}from"./chunk-6LSEIIF7.js";import{a as x}from"./chunk-BGBBVSH4.js";import{a as S,g as P}from"./chunk-4WCUBZU3.js";import{d,f as p,g as u,j as f}from"./chunk-5D2LVK7O.js";import{i as v,j as w}from"./chunk-7WTPQ4NX.js";import{d as b,e as y,g as h}from"./chunk-A2IIGFMJ.js";import{basename as $,extname as F}from"path";function D(i,e,o,t,n,r){let a=new Set;R(i,e,o,t)&&a.add(n);let l=I(r);for(let s of r)s.value&&k(a,s.label,s.value,l);return[...a].slice(0,6)}function I(i){let e={self:new Set,other:new Set},o=0;for(let t of i)if(!(!t.side||!t.value)){o+=1;for(let n of L(t.value))e[t.side].add(n)}return o===0||e.self.size===0||e.other.size===0?new Set:new Set([...e.self].filter(t=>e.other.has(t)))}function k(i,e,o,t){let n=L(o);e.endsWith("name")&&z(n)&&i.add(`${e} has type-guard boundary shape`);for(let r of n){if(t.has(r))continue;let a=B.get(r);a&&i.add(`${e} has ${a} term: ${r}`)}}function R(i,e,o,t){if(o<=0)return!1;let n=b(i,e);if(n.length===0)return!1;for(let r=o-1;r>=0&&r>=o-5;r-=1){let a=(n[r]??"").trim();if(a!==""){if(y(a)===t)return!0;if(!_(a))return!1}}return!1}function L(i){return i.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function z(i){return i.some(e=>j.has(e))&&i.some(e=>N.has(e))}var B=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),j=new Set(["can","has","is","should"]),N=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);function _(i){return["//","*","/*","@","#"].some(e=>i.startsWith(e))}function ae(i,e){let{scope:o,maxLoc:t=15,limit:n=30,scanLimit:r}=e??{},a=new T(i),l=C({candidates:()=>Y(i,a,o,t),orderCandidates:E,scanLimit:r,profile:{name:"passthrough-candidates"},prepare:s=>a.calleeMap(s,{semantic:e?.semantic!==!1}),evaluate:(s,c)=>q(i,s,c.get(s.symbolId)??[]),orderResults:(s,c)=>s.loc-c.loc||s.file.localeCompare(c.file)});return M(l).slice(0,n===void 0?l.length:n)}var m=3;function M(i){let e=new Map,o=new Map;for(let t of i){if(t.file===t.forwardsToFile)continue;let n=`${t.file}\0${t.forwardsToFile}`;e.set(n,(e.get(n)??0)+1);let r=u(t.symbol),a=u(t.forwardsTo);if(!r||!a||r===a)continue;let l=`${t.file}\0${r}`;o.set(l,(o.get(l)??0)+1)}return i.map(t=>{let n=e.get(`${t.file}\0${t.forwardsToFile}`)??0,r=u(t.symbol),a=r?o.get(`${t.file}\0${r}`)??0:0;if(n<m&&a<m)return t;let l=n>=m?`facade: ${n} sibling forwards from this file to ${t.forwardsToFile}`:`facade: ${a} methods of ${r} forward to members of its collaborators`,s=[...t.boundaryEvidence,l];return{...t,boundaryEvidence:s,actionTier:"signal",recommendation:A("signal",s,t.publicFacadeEvidence)}})}function q(i,e,o){let t=U(o);if(t.size!==1||!v(i,e.relativePath,e.startLine,e.endLine))return null;let[,n]=[...t.entries()][0],r=O(i,e,n),a=G(i,e),l=r.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:x(e),forwardsTo:n.symbol,forwardsToShort:d(n.symbol),forwardsToFile:n.file,actionTier:l,boundaryEvidence:r,publicFacadeEvidence:a,recommendation:A(l,r,a)}}function O(i,e,o){return D(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:p(e.symbol),side:"self"},{label:"callee name",value:p(o.symbol),side:"other"},{label:"passthrough module",value:$(e.relativePath,F(e.relativePath)),side:"self"},{label:"callee module",value:$(o.file,F(o.file)),side:"other"}])}function A(i,e,o){if(i==="signal"){if(o.length>0)return`Review the public API before inlining; public-facade evidence: ${o.slice(0,2).join("; ")}.`;let t=e.filter(K);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function G(i,e){return g(i,e)?S(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:P(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function K(i){return i.includes("public surface")}function U(i){let e=i.some(t=>f(t.symbol))?i.filter(t=>f(t.symbol)):i,o=new Map;for(let t of e)o.has(t.symbol)||o.set(t.symbol,t);return o}function Y(i,e,o,t){return e.productionCallableDefinitions({scope:o,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(n=>!w(i,n)).filter(n=>!h(i,n.relativePath,n.startLine,"passthrough"))}export{ae as a,M as b};
2
+ //# sourceMappingURL=chunk-4QZXBUKC.js.map
@@ -0,0 +1,4 @@
1
+ import{a as w}from"./chunk-KI6NBKDY.js";import{b as v}from"./chunk-6LSEIIF7.js";import{b as E}from"./chunk-FMRN2TRL.js";import{b as P,d as M}from"./chunk-72AD6ZRR.js";import{d as L,e as x}from"./chunk-5D2LVK7O.js";import{b as p,f as d,g as B}from"./chunk-7WTPQ4NX.js";import{D as h,F as S,O as g}from"./chunk-FVULPZDF.js";import{qa as f,ra as y}from"./chunk-5TNQJUR2.js";function Q(n,e,s={}){let r=E(n,e);if(r.candidates.length>0)throw new Error(`Ambiguous symbol: ${e}. Use an exact SCIP symbol or file:line.`);let t=r.match;if(!t)return null;let a=N(n,t),i=t.endLine-t.startLine+1,o=new v(n).callableCallees(t,s),c=o.filter(m=>m.evidenceStrength==="exact"),l=new Set(c.map(m=>m.symbol)),D=new Set(o.filter(m=>!l.has(m.symbol)).map(m=>m.symbol));return{symbol:t.symbol,shortName:L(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:i,branches:a.branches,estimateBasis:a.estimateBasis,metricRules:a.metricRules??`${a.estimateBasis}-estimate-v1`,cyclomaticEstimate:a.branches+1,calleeCount:l.size,candidateCalleeCount:D.size,fanIn:w(n,t.symbolId),fanOut:$(c,t.relativePath)}}function N(n,e){b(n,e.relativePath,e.startLine,e.endLine);let s=F(e,C(n,e.relativePath));if(s)return s;let r=g(n,e.relativePath);if(r){let t=S(r.rootNode,e.startLine,e.endLine);if(t)return{branches:O(t),estimateBasis:"ast"}}return{branches:I(b(n,e.relativePath,e.startLine,e.endLine),R(n,e.relativePath)),estimateBasis:"regex-fallback"}}function V(n,e){let s=new Map,r=new Map;for(let t of e){b(n,t.relativePath,t.startLine,t.endLine);let a=r.get(t.relativePath)??[];a.push(t),r.set(t.relativePath,a)}for(let[t,a]of r)j(n,t,a,s);return s}function j(n,e,s,r){let t=C(n,e),a=new Map;for(let o of B(n,e)?.callables??[])o.branches!==void 0&&a.set(`${o.startLine}:${o.endLine}`,o.branches);let i=[];for(let o of s){let c=F(o,t);if(c){r.set(o.symbolId,c);continue}let l=a.get(`${o.startLine}:${o.endLine}`);l===void 0?i.push(o):r.set(o.symbolId,{branches:l,estimateBasis:"ast"})}i.length>0&&k(n,e,i,r)}function k(n,e,s,r){let t=g(n,e),a=t===null?[]:s.filter(o=>t.rootNode.startPosition.row<=o.startLine&&t.rootNode.endPosition.row>=o.endLine),i=new Set(a.map(o=>o.symbolId));if(t&&a.length>0){for(let o of a)r.set(o.symbolId,{branches:0,estimateBasis:"ast"});z(t.rootNode,a,r)}for(let o of s)i.has(o.symbolId)||r.set(o.symbolId,A(n,o))}function C(n,e){if(!/\.[cm]?[jt]sx?$/i.test(e))return[];try{return M(e,f(n.config.projectRoot,e)).functions}catch(s){if(!y(s))throw s;return[]}}function F(n,e){let s=x(n.symbol),r=e.filter(t=>t.startLine-1>=n.startLine&&t.endLine-1<=n.endLine&&t.name.split(".").at(-1)?.replace(/^(get|set) /,"")===s);if(r.length===1)return{branches:r[0].cyclomatic-1,estimateBasis:"ast",metricRules:P}}function A(n,e){return{branches:I(b(n,e.relativePath,e.startLine,e.endLine),R(n,e.relativePath)),estimateBasis:"regex-fallback"}}function R(n,e){return n.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function b(n,e,s,r){let t=f(n.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
2
+ `),a=t.slice(s,r+1).join(`
3
+ `);if(s<0||r<s||r>=t.length||!a.trim())throw new Error(`Current source does not cover the indexed definition in ${e}. Reindex before measuring complexity.`);return a}function $(n,e){return new Set(n.filter(s=>s.file!==e).map(s=>s.symbol)).size}function O(n){let e=0;return h(n,s=>{e+=d(s)}),e}function z(n,e,s){let r=[...e].sort((t,a)=>t.startLine-a.startLine||a.endLine-t.endLine);h(n,t=>{let a=d(t);if(a===0)return;let i=t.startPosition.row,o=t.endPosition.row;for(let c of r){if(c.startLine>i)break;if(c.endLine<o)continue;let l=s.get(c.symbolId);l&&(l.branches+=a)}})}function I(n,e){let s=p(n),r=0;return r+=u(s,[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g]),e==="python"?r+=u(s,[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g]):e==="rust"?r+=u(s,[/\bmatch\b/g,/=>/g,/\bloop\b/g]):e==="ruby"?r+=u(s,[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g]):e==="go"&&(r+=u(s,[/\bselect\b/g,/\bdefer\b/g])),r}function u(n,e){let s=0;for(let r of e){let t=n.match(r);t&&(s+=t.length)}return s}export{Q as a,N as b,V as c,O as d};
4
+ //# sourceMappingURL=chunk-4WBDEVX2.js.map
@@ -0,0 +1,8 @@
1
+ import{c as m}from"./chunk-E3FDPXZK.js";import{a as _}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-GCKCF5FL.js";import{a as A,e as b,x as v}from"./chunk-5D2LVK7O.js";import{r as O}from"./chunk-7WTPQ4NX.js";import{a as S}from"./chunk-FVULPZDF.js";import{d as D}from"./chunk-A2IIGFMJ.js";import{Da as u,c as f,qa as l,ra as d,sa as F}from"./chunk-5TNQJUR2.js";import{existsSync as y,readdirSync as M}from"fs";import{join as h}from"path";var ft={files:new Set,pathPrefixes:[]},ut={reasonsByFile:new Map},k=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,gt=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,$=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],lt=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),pt=4,dt=u("package-surface",{clearGroups:["whole-project"]}),St=u("package-operational-surface",{clearGroups:["whole-project"]});function L(t){return dt.get(t,()=>ht(t.config.projectRoot))}function E(t,e){let r=L(t);return r.files.has(e)?!0:r.pathPrefixes.some(n=>e.startsWith(n))}function G(t,e){return L(t).files.has(e)}function mt(t){return St.get(t,()=>bt(t.config.projectRoot))}function ve(t,e){return mt(t).reasonsByFile.get(e)??[]}function ht(t){let e=new Set,r=[];for(let{manifest:n,packageRoot:s}of V(t))for(let i of yt(n))W(t,s,i,e,r);return e.size===0&&r.length===0?ft:{files:e,pathPrefixes:r}}function bt(t){let e=new Map;for(let{manifest:r,packageRoot:n}of V(t)){let s=Pt(r);for(let o of s)C(t,n,o,"package binary",e);let i=r.scripts;if(!(!i||typeof i!="object")){for(let[o,a]of Object.entries(i))if(typeof a=="string")for(let c of xt(a))C(t,n,c,`package script "${o}"`,e)}}return e.size===0?ut:{reasonsByFile:e}}function V(t){let e=[],r=U(t,"");return r&&e.push({manifest:r,packageRoot:""}),X(t,"",e,0),e}function X(t,e,r,n){if(n>=pt)return;let s=h(t,e);if(y(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||lt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name,a=U(t,o);a&&r.push({manifest:a,packageRoot:o}),X(t,o,r,n+1)}}function U(t,e){let r;try{r=l(t,h(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(n){if(!d(n))throw n;return null}try{let n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}}function yt(t){let e=[];for(let n of["main","module","types","browser"])typeof t[n]=="string"&&e.push(t[n]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let n of Object.values(r))typeof n=="string"&&e.push(n);return B(t.exports,e),e}function Pt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(r=>typeof r=="string")}function xt(t){let e=[],r=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let n of t.matchAll(r)){let s=n[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function C(t,e,r,n,s){let i=new Set;W(t,e,r,i,[]);for(let o of i){let a=s.get(o)??[];a.includes(n)||a.push(n),s.set(o,a)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))B(r,e)}function W(t,e,r,n,s){let i=r.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let o=i.indexOf("*");if(o>=0){let c=i.slice(0,o);for(let p of I(c))p!==""&&s.push(g(e,p));return}let a=i.replace(gt,"");for(let c of I(a)){c===a&&c===i&&n.add(g(e,i));for(let p of $)kt(t,n,e,c+p)}n.add(g(e,i))}function I(t){let e=[t];return k.test(t)&&(e.push(t.replace(k,"src/")),e.push(t.replace(k,""))),e}function kt(t,e,r,n){let s=g(r,n);if(e.add(s),!n.startsWith("src/")||y(h(t,s)))return;let i=$.find(x=>n.endsWith(x));if(!i)return;let o=n.slice(0,-i.length);Et(t,e,r,o,i);let a=o.lastIndexOf("/");if(a<=4)return;let c=o.slice(0,a),p=o.slice(a+1);for(let x of K(t,r,c,`${p}${i}`))e.add(x)}function Et(t,e,r,n,s){let i=g(r,`${n}/index${s}`);y(h(t,i))&&e.add(i)}function K(t,e,r,n){let s=h(t,e,r);if(!y(s))return[];let i=[];for(let o of M(s,{withFileTypes:!0})){let a=`${r}/${o.name}`;o.isDirectory()?i.push(...K(t,e,a,n)):o.isFile()&&o.name===n&&i.push(g(e,a))}return i}function g(t,e){return t?`${t}/${e}`:e}import{existsSync as T,readdirSync as Tt}from"fs";import{dirname as Rt,join as R}from"path";var wt={rootFiles:new Set,sourcePrefixes:[]},jt=new Set([".git",".scipquery","node_modules","target"]),_t=6,Ft=u("rust-library-surface",{clearGroups:["whole-project"]});function H(t,e,r){if(!r.endsWith(".rs")||!Nt(Dt(t),r))return!1;let n=v(t,r).find(s=>s.symbol===e);return n?At(D(t,r)[n.startLine]??""):!1}function Dt(t){return Ft.get(t,()=>Ot(t.config.projectRoot))}function Ot(t){let e=new Set,r=new Set;for(let n of vt(t)){let s=l(t,R(n,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=Ct(s),o=g(n,"src/lib.rs"),a=i?g(n,i):!It(s)&&F(t,o)?o:null;if(!a)continue;e.add(a);let c=Rt(a).replaceAll("\\","/");r.add(c==="."?"":`${c}/`)}return e.size===0?wt:{rootFiles:e,sourcePrefixes:[...r].sort()}}function Nt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:Mt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function At(t){return/^\s*pub\s+(?!\()/.test(t)}function vt(t){if(!T(t))return[];let e=[];return q(t,"",e,0),e}function q(t,e,r,n){let s=R(t,e);if(T(s)&&(T(R(s,"Cargo.toml"))&&r.push(e),!(n>=_t)))for(let i of Tt(s,{withFileTypes:!0})){if(!i.isDirectory()||jt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name;q(t,o,r,n+1)}}function Ct(t){let e=!1;for(let r of t.split(`
2
+ `)){let n=r.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(n);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(n)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function It(t){let e=!1;for(let r of t.split(`
3
+ `)){let n=r.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(n);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(n))return!0}return!1}function Mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}import{existsSync as $t,readdirSync as Lt}from"fs";import{join as Gt}from"path";var Vt=/^(?:[\w.-]+\.config\.[cm]?[jt]s|package\.json)$/,Xt=/(?:\.{1,2}\/)?[\w@./-]+\.(?:[cm]?[jt]sx?)\b/g,Ut=u("config-referenced-files",{clearGroups:["whole-project"]});function Bt(t){return Ut.get(t,()=>Wt(t))}function Y(t,e){return Bt(t).has(f(e))}function Wt(t){let e=new Set,r=t.config.projectRoot,n;try{n=Lt(r)}catch{return e}let s=n.filter(o=>Vt.test(o)&&$t(Gt(r,o)));if(s.length===0)return e;let i=new Set(S(t,{includeIgnored:!1}).map(o=>f(o)));for(let o of s){let a;try{a=l(r,o,{inputKind:"root configuration file"})}catch(c){if(d(c))continue;continue}Kt(a,i,e)}return e}function Kt(t,e,r){for(let n of t.matchAll(Xt)){let s=f(n[0]).replace(/^\.\//,"");s.startsWith("..")||s.startsWith("/")||e.has(s)&&r.add(s)}}import{existsSync as w,readdirSync as Ht}from"fs";import{join as P}from"path";var qt=["trigger.config.ts","trigger.config.mts","trigger.config.js","trigger.config.mjs"],Yt=["./src/trigger","./trigger"],Zt=/\bdirs\s*:\s*\[([^\]]*)\]/,Jt=/["'`]([^"'`]+)["'`]/g,Qt=["","apps","packages","services"],zt=u("framework-task-surface",{clearGroups:["whole-project"]});function te(t){return zt.get(t,()=>ee(t))}function Z(t,e){let r=f(e);return te(t).directories.some(n=>r===n.directory||r.startsWith(`${n.directory}/`))}function ee(t){let e=new Map;for(let r of re(t.config.projectRoot))for(let n of ne(t,r))e.has(n)||e.set(n,{directory:n,framework:"trigger.dev",config:r});return{directories:[...e.values()].sort((r,n)=>r.directory.localeCompare(n.directory))}}function re(t){let e=[],r=n=>{for(let s of qt){let i=n?`${n}/${s}`:s;w(P(t,i))&&e.push(i)}};r("");for(let n of Qt.slice(1)){let s=P(t,n);if(!w(s))continue;let i;try{i=Ht(s)}catch{continue}for(let o of i)r(`${n}/${o}`)}return e}function ne(t,e){let r;try{r=l(t.config.projectRoot,e,{inputKind:"framework task config"})}catch(a){return d(a)?[]:[]}let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",s=Zt.exec(r)?.[1],i=s?[...s.matchAll(Jt)].map(a=>a[1]):Yt,o=[];for(let a of i){let c=f(P(n,a)).replace(/\/+$/,"");c===""||c.startsWith("..")||w(P(t.config.projectRoot,c))&&o.push(c)}return o}function se(t){return m(t)==="barrel"}function Q(t){return ie.get(t,()=>{let r=S(t,{includeIgnored:!1}).filter(o=>{let a=m(o);return a==="entry"||a==="worker"});if(r.length===0)return new Set;let n=N(t),s=new Set,i=new Set;for(;r.length>0;){let o=r.shift();if(!s.has(o)){s.add(o),m(o)==="barrel"&&i.add(o);for(let a of n.get(o)??[])s.has(a)||r.push(a)}}return i})}var ie=u("live-barrels",{clearGroups:["whole-project"]});function oe(t,e){return Q(t).has(f(e))}function hr(t){let e=Q(t);return S(t,{includeIgnored:!1}).filter(r=>se(r)&&!e.has(r)&&!ae(t,r))}function ae(t,e){let r=f(e),n=A(t).forFile(r,{facts:!0}).facts?.callables;return n&&n.length>0?!0:(t.get(`SELECT COUNT(*) AS n
4
+ FROM defn_enclosing_ranges der
5
+ JOIN documents d ON d.id = der.document_id
6
+ WHERE d.relative_path = ?
7
+ AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function br(t,e){let r=f(e),n=m(e);return n==="entry"||n==="worker"||Re(r)||Z(t,r)||Y(t,r)||oe(t,r)}function ce(t,e,r){let n=f(r),s=[];E(t,n)&&s.push("package-surface-file"),ge(t,e,n)&&s.push("transitive-package-surface"),H(t,e,n)&&s.push("rust-public-library"),Te(e,n)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(o=>f(o)===n)&&s.push("configured-file"),i.pathPrefixes?.some(o=>n.startsWith(f(o)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(o=>je(e,o))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(o=>{try{return _(o,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function yr(t,e,r){return ce(t,e,r).length>0}var fe=u("package-surface-reachability",{clearGroups:["whole-project"]}),ue=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function ge(t,e,r){let n=le(t).get(r);return n===void 0?!1:n===null||n.has(b(e))}function Pr(t,e,r){let n=pe(t).get(r);return n===void 0?!1:n===null||n.has(b(e))}function le(t){return fe.get(t,()=>z(t,e=>E(t,e)))}function pe(t){return ue.get(t,()=>z(t,e=>G(t,e)))}function z(t,e){let r=new Map,n=[];for(let s of S(t,{includeIgnored:!1}))e(s)&&(r.set(s,null),n.push(s));for(;n.length>0;){let s=n.shift(),i=r.get(s);i!==void 0&&_e(t,s,i,r,n)}return r}function de(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(n=>t.has(n))?null:void 0;let r=e.names.filter(n=>t.has(n));return r.length>0?new Set(r):void 0}function Se(t,e,r){if(!t.has(e))return t.set(e,r),!0;let n=t.get(e);if(n===void 0)return!1;if(n===null||r===null)return n===null?!1:(t.set(e,null),!0);let s=!1;for(let i of r)n.has(i)||(n.add(i),s=!0);return s}var tt=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),me=new Set(["default","generateMetadata","generateStaticParams"]),he=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),be=new Set(["default","middleware","config"]),ye=new Set(["register","onRequestError"]),Pe=new Set(["onRouterTransitionStart"]),xe=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),ke=new Set(["load","actions","entries",...tt]),Ee=new Set(["default"]);function Te(t,e){let r=b(t);return r===""?!1:Fe(e,r)}function Re(t){return et(t)||rt(t)||nt(t)||st(t)||it(t)||ot(t)||at(t)||ct(t)}function et(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function rt(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return j(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function it(t){return j(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function ot(t){return j(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function j(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function at(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function ct(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function we(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function je(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let n=e.slice(0,r),s=e.slice(r+1);return t.includes(J(n)+"/")&&t.includes(J(s)+".")}function J(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function _e(t,e,r,n,s){for(let i of O(t,e)){if(!i.sourcePath||t.isIgnored(i.sourcePath))continue;let o=de(r,i);o!==void 0&&Se(n,i.sourcePath,o)&&s.push(i.sourcePath)}}function Fe(t,e){return et(t)?tt.has(e):rt(t)?me.has(e):nt(t)?he.has(e):st(t)?be.has(e):it(t)?ye.has(e):ot(t)?Pe.has(e):at(t)?xe.has(e):ct(t)?ke.has(e):we(t)?Ee.has(e):!1}export{E as a,ve as b,se as c,hr as d,br as e,ce as f,yr as g,Pr as h,Re as i};
8
+ //# sourceMappingURL=chunk-4WCUBZU3.js.map
@@ -0,0 +1,40 @@
1
+ import{c as ze,d as me,e as We,f as Ue,o as He}from"./chunk-NZAXKGRL.js";import{b as K}from"./chunk-YNQCGEQE.js";import{a as Qe}from"./chunk-KHWRRPV4.js";import{e as qe}from"./chunk-72AD6ZRR.js";import{a as Be}from"./chunk-GCKCF5FL.js";import{d as Ge,e as Je}from"./chunk-DVFP6PZI.js";import{E as Ke,F as $e,e as k,i as je,x as N,y as Z,z as Ve}from"./chunk-5D2LVK7O.js";import{g as X,n as j,o as V,r as ke,s as Fe,u as _e}from"./chunk-7WTPQ4NX.js";import{A as fe,C as Me,D as Y,G as de,H as pe,I as P,O,S as Pe,q as Ae}from"./chunk-FVULPZDF.js";import{b as De}from"./chunk-D3FDISIC.js";import{d as Q}from"./chunk-A2IIGFMJ.js";import{c as Oe,d as Te}from"./chunk-PH52RA7D.js";import{Ba as ve,Da as M,d as ue,q as Ne,t as Ie}from"./chunk-5TNQJUR2.js";function F(e){return e?`${e.startLine}:${e.startColumn}:${e.endLine}:${e.endColumn}`:""}function $(e,n,r,t){let i=new Map;if(r.length===0)return i;t??=j(e,n)??[];let s=new Set;for(let a of r){let o=Ye(e,n,a,t);if(!o||o.startColumn===void 0||o.endColumn===void 0)continue;let l=F({...o,startColumn:o.startColumn,endColumn:o.endColumn});i.has(l)?s.add(l):i.set(l,a)}for(let a of s)i.delete(a);return i}function Ye(e,n,r,t=j(e,n)??[]){let i=k(r.symbol),s=i==="<constructor>"?"constructor":i,a=t.filter(l=>l.name===s&&l.startLine>=r.startLine&&l.endLine<=r.endLine&&(l.startLine!==r.startLine||l.startColumn===void 0||l.startColumn>=(r.startChar??0))&&(l.endLine!==r.endLine||l.endColumn===void 0||!r.endChar||l.endColumn<=r.endChar)),o=a.filter(l=>!a.some(f=>f!==l&&(f.startLine<l.startLine||f.startLine===l.startLine&&(f.startColumn??0)<(l.startColumn??0))&&(f.endLine>l.endLine||f.endLine===l.endLine&&(f.endColumn??Number.MAX_SAFE_INTEGER)>=(l.endColumn??0))));return o.length===1?o[0]:void 0}import{extname as Yn}from"path";import{ts as y}from"@ts-morph/common";import{ts as S}from"@ts-morph/common";function ee(e){for(let n=e.parent;n;n=n.parent)if(S.isFunctionLike(n))return n;return null}function ne(e,n,r=new Set){let t=new Set;for(e=C(e);S.isIdentifier(e)&&!t.has(e);){t.add(e);let i=D(e,n);if(!i||r.has(i))return;if(!S.isVariableDeclaration(i)||!i.initializer||!(i.parent.flags&S.NodeFlags.Const)||!S.isIdentifier(C(i.initializer)))return i;e=C(i.initializer)}}function D(e,n){if(S.isIdentifier(e)){let r=S.isShorthandPropertyAssignment(e.parent)?n.getShorthandAssignmentValueSymbol(e.parent):n.getSymbolAtLocation(e);return r?.valueDeclaration??r?.declarations?.find(t=>S.isImportSpecifier(t)||S.isImportClause(t)||S.isNamespaceImport(t))}if(e.kind===S.SyntaxKind.ThisKeyword){for(let r=e.parent;r;r=r.parent)if(S.isFunctionLike(r)&&!S.isArrowFunction(r))return r}}function Xe(e){for(;S.isBindingElement(e);)e=e.parent.parent;return S.isParameter(e)}function C(e){for(;S.isParenthesizedExpression(e)||S.isAsExpression(e)||S.isTypeAssertionExpression(e)||S.isSatisfiesExpression(e)||S.isNonNullExpression(e);)e=e.expression;return e}function z(e,n,r=new Set,t=new Set){if(e=C(e),S.isPropertyAccessExpression(e)||S.isElementAccessExpression(e)){let a=z(e.expression,n,r,t);if(!a)return;let o=S.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return{...a,path:[...a.path,o]}}let i=D(e,n);if(!i||t.has(i))return;if(t.add(i),r.has(i))return{binding:i,path:[],reassigned:!0};let s=In(i);return s?z(s,n,r,t):{binding:i,path:[],reassigned:!1}}function In(e){if(!S.isVariableDeclaration(e)||!e.initializer||!(e.parent.flags&S.NodeFlags.Const))return;let n=C(e.initializer);return S.isIdentifier(n)||S.isPropertyAccessExpression(n)||S.isElementAccessExpression(n)?n:void 0}function I(e){return e=C(e),S.isStringLiteralLike(e)||S.isNumericLiteral(e)?e.text:null}function W(e,n){return e.slice(0,Math.min(e.length,n.length)).every((r,t)=>r===null||n[t]===null||r===n[t])}function Ze(e,n,r){let t=C(e),i=new Set;for(;S.isIdentifier(t);){let s=D(t,n);if(!s||i.has(s))return null;let a=vn(s,r);if(!a)return null;i.add(s),t=C(a)}return t}function vn(e,n){return S.isVariableDeclaration(e)&&e.parent.flags&S.NodeFlags.Const&&!n.has(e)?e.initializer:void 0}import{ts as c}from"@ts-morph/common";function en(e,n){let r=new Set,t=u=>{for(let d of Pn(u)){let x=D(d,n);x&&r.add(x)}c.isCallExpression(u)&&Mn(u,n,r),c.forEachChild(u,t)};t(e);let i,s=()=>i??=An(e,n),a,o=()=>a??=On(s(),n),l,f=()=>l??=Tn(e,n,s().aliases);return{written:r,hasEscapedValue(u,d){return v(u,n,s().aliases,new Set,d).some(x=>f().some(b=>b.binding===x.binding&&b.path.length<=x.path.length&&W(b.path,x.path)))},usesParameter(u){return v(u,n,s().aliases).some(({binding:d})=>Xe(d))},hasWrite(u,d,x,b,R=u){let h=z(u,n,r);if(h)return h.reassigned||d&&v(u,n,s().aliases,new Set,x).some(w=>(o().get(w.binding)??[]).some(m=>(!R||!(m.source.getStart()<=R.getStart()&&m.source.end>=R.end))&&(b||m.path.length<=w.path.length)&&W(m.path,w.path)))}}}function An(e,n){let r=new Map,t=[],i=[],s=a=>{Bn(a,n,r),t.push(...kn(a)),(c.isCallExpression(a)||c.isNewExpression(a))&&i.push(a),c.forEachChild(a,s)};s(e);for(let a of i)Fn(a,n,r);return{aliases:r,memberWrites:t,calls:i}}function On({aliases:e,memberWrites:n,calls:r},t){let i=new Map,s=(a,o,l,f)=>{for(let u of v(a,t,e,new Set,o)){let d=i.get(u.binding)??[];d.push({path:u.path,source:l,unknown:f}),i.set(u.binding,d)}};for(let a of n)s(a,[],a,!1);for(let a of r)for(let o of _n(a,t)){if(!o.unknown){s(o.target,o.path,a,!1);continue}for(let l of re(o.target,t,e,new Set,o.path.slice(0,-1))){let f=i.get(l.binding)??[];f.push({path:l.path,source:a,unknown:!0}),i.set(l.binding,f)}}return i}function Tn(e,n,r){let t=n.getSymbolAtLocation(e);return t?n.getExportsOfModule(t).flatMap(i=>{let a=(i.flags&c.SymbolFlags.Alias?n.getAliasedSymbol(i):i).valueDeclaration;if(!a||a.getSourceFile()!==e)return[];let o=c.isVariableDeclaration(a)?a.initializer:a;return o?re(o,n,r,new Set).filter(l=>l.binding!==a):[]}):[]}function Mn(e,n,r){if(!c.isCallExpression(e)||e.questionDotToken)return;let t=C(e.expression);if(!(!c.isIdentifier(t)||t.text!=="eval"||D(t,n)))for(let i of n.getSymbolsInScope(e,c.SymbolFlags.Value|c.SymbolFlags.Alias)){let s=i.valueDeclaration??i.declarations?.[0];s&&r.add(s)}}function nn(e){if(c.isBinaryExpression(e)&&e.operatorToken.kind>=c.SyntaxKind.FirstAssignment&&e.operatorToken.kind<=c.SyntaxKind.LastAssignment)return e.left;if((c.isPrefixUnaryExpression(e)||c.isPostfixUnaryExpression(e))&&(e.operator===c.SyntaxKind.PlusPlusToken||e.operator===c.SyntaxKind.MinusMinusToken))return e.operand;if(c.isForOfStatement(e)||c.isForInStatement(e))return e.initializer}function Pn(e){let n=nn(e);return n?rn(n):[]}function tn(e){let n=C(e);return n!==e?[n]:c.isSpreadElement(e)||c.isSpreadAssignment(e)?[e.expression]:c.isArrayLiteralExpression(e)?e.elements:c.isObjectLiteralExpression(e)?e.properties:c.isPropertyAssignment(e)?[e.initializer]:c.isBinaryExpression(e)&&e.operatorToken.kind===c.SyntaxKind.EqualsToken?[e.left]:[]}function rn(e){return c.isIdentifier(e)?[e]:c.isShorthandPropertyAssignment(e)?[e.name]:tn(e).flatMap(rn)}function kn(e){let n=c.isDeleteExpression(e)?e.expression:nn(e);return n?sn(n):[]}function sn(e){return c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)?[e]:tn(e).flatMap(sn)}function Fn(e,n,r){let t=ie(e.expression,n);if(!t)return;let i=C(e.expression);(c.isPropertyAccessExpression(i)||c.isElementAccessExpression(i))&&ge(t,{expression:i.expression,path:[]},r);for(let[s,a]of t.parameters.entries()){let o=e.arguments?.[s];o&&!c.isSpreadElement(o)&&!a.dotDotDotToken&&_(a.name,{expression:o,path:[]},n,r)}}function ie(e,n){if(e=C(e),c.isArrowFunction(e)||c.isFunctionExpression(e))return e;let r=c.isElementAccessExpression(e)?I(e.argumentExpression):null,t=r!==null&&c.isElementAccessExpression(e)?n.getTypeAtLocation(e.expression).getProperty(r):n.getSymbolAtLocation(e),i=c.isIdentifier(e)?D(e,n):t?.valueDeclaration,s=i&&(c.isVariableDeclaration(i)||c.isPropertyAssignment(i))?i.initializer:i;return s&&c.isFunctionLike(s)&&"body"in s&&s.body?s:void 0}function se(e){let n=e.body;if(!n)return[];if(!c.isBlock(n))return[n];let r=[],t=i=>{c.isFunctionLike(i)||(c.isReturnStatement(i)&&i.expression&&r.push(i.expression),c.forEachChild(i,t))};return t(n),r}function _n(e,n){let r=C(e.expression),t=e.arguments??[],i=Jn(e,n);if(i)return i;if(ie(r,n))return[];let s=[...t];return(c.isPropertyAccessExpression(r)||c.isElementAccessExpression(r))&&s.push(r.expression),s.map(a=>({target:c.isSpreadElement(a)?a.expression:a,path:c.isIdentifier(a)&&c.isNamespaceImport(D(a,n)??a)?[null,null]:[null],unknown:!0}))}function Bn(e,n,r){if(c.isVariableDeclaration(e)&&e.initializer&&_(e.name,{expression:e.initializer,path:[]},n,r),c.isBinaryExpression(e)&&[c.SyntaxKind.EqualsToken,c.SyntaxKind.AmpersandAmpersandEqualsToken,c.SyntaxKind.BarBarEqualsToken,c.SyntaxKind.QuestionQuestionEqualsToken].includes(e.operatorToken.kind)&&_(e.left,{expression:e.right,path:[]},n,r),c.isForOfStatement(e)){let t=c.isVariableDeclarationList(e.initializer)?e.initializer.declarations[0]?.name:e.initializer;t&&_(t,{expression:e.expression,path:[null]},n,r)}}function _(e,n,r,t){if(e=C(e),c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)){let i=z(e,r);i&&ge(i.binding,{...n,targetPath:i.path},t);return}if(c.isIdentifier(e)){ge(D(e,r),n,t);return}for(let i of jn(e))_(i.target,{...n,path:[...n.path,...i.path],shallowCopy:n.shallowCopy||i.shallowCopy,arrayRestOffset:i.arrayRestOffset??n.arrayRestOffset},r,t),i.fallback&&_(i.target,{expression:i.fallback,path:[]},r,t)}function ge(e,n,r){if(!e)return;let t=r.get(e)??[];t.push(n),r.set(e,t)}function jn(e){return c.isObjectBindingPattern(e)||c.isArrayBindingPattern(e)?e.elements.flatMap((n,r)=>{if(!c.isBindingElement(n))return[];if(n.dotDotDotToken)return[{target:n.name,path:[],shallowCopy:!0,...c.isArrayBindingPattern(e)?{arrayRestOffset:r}:{}}];let t=c.isArrayBindingPattern(e)?String(r):te(n.propertyName??n.name);return[{target:n.name,path:[t],fallback:n.initializer}]}):c.isObjectLiteralExpression(e)?e.properties.flatMap(n=>c.isSpreadAssignment(n)?[{target:n.expression,path:[],shallowCopy:!0}]:c.isPropertyAssignment(n)?[{target:n.initializer,path:[te(n.name)]}]:c.isShorthandPropertyAssignment(n)?[{target:n.name,path:[n.name.text],fallback:n.objectAssignmentInitializer}]:[]):c.isArrayLiteralExpression(e)?e.elements.map((n,r)=>({target:n,path:[String(r)]})):c.isBinaryExpression(e)&&e.operatorToken.kind===c.SyntaxKind.EqualsToken?[{target:e.left,path:[],fallback:e.right}]:[]}function te(e){return c.isIdentifier(e)?e.text:I(c.isComputedPropertyName(e)?e.expression:e)}function v(e,n,r,t=new Set,i=[]){if(e=C(e),c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)){let l=c.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return v(e.expression,n,r,t,[l,...i])}let s=Hn(e);if(s)return s.flatMap(l=>v(l,n,r,t,i));if(c.isCallExpression(e))return Gn(e,n,r,t,i);if(c.isObjectLiteralExpression(e)||c.isArrayLiteralExpression(e))return on(e,i).flatMap(l=>v(l.expression,n,r,t,l.path));let a=D(e,n);if(!a||t.has(a))return[];let o=new Set(t).add(a);return[{binding:a,path:i},...(r.get(a)??[]).flatMap(l=>{let f=an(l,i);return f?v(l.expression,n,r,o,f):[]})]}function an(e,n){let r=e.targetPath??[];if(e.targetPath&&n.length<=r.length||r.length>n.length||!W(r,n))return null;let t=n.slice(r.length);if(e.shallowCopy&&t.length<2)return null;if(e.arrayRestOffset!==void 0){let[i,...s]=t;return[...e.path,i===null?null:String(Number(i)+e.arrayRestOffset),...s]}return[...e.path,...t]}function on(e,n){return n.length<2?[]:c.isObjectLiteralExpression(e)?Vn(e,n):$n(e,n)}function Vn(e,n){let r=[];for(let t of[...e.properties].reverse()){if(c.isSpreadAssignment(t)){r.push({expression:t.expression,path:n});continue}let i=te(t.name);if(!(n[0]!==null&&i!==null&&i!==n[0])&&(r.push(...Kn(t).map(s=>({expression:s,path:n.slice(1)}))),n[0]!==null&&i===n[0]))break}return r}function Kn(e){return c.isPropertyAssignment(e)?[e.initializer]:c.isShorthandPropertyAssignment(e)?[e.name]:c.isGetAccessorDeclaration(e)?se(e):c.isMethodDeclaration(e)?[e]:[]}function $n(e,n){let r=n[0]===null||e.elements.some(c.isSpreadElement);return e.elements.flatMap((t,i)=>!r&&String(i)!==n[0]?[]:c.isSpreadElement(t)?[{expression:t.expression,path:[null,...n.slice(1)]}]:[{expression:t,path:n.slice(1)}])}function re(e,n,r,t,i=[]){let s=C(e);if(t.has(s))return[];let a=new Set(t).add(s),o=f=>re(f.expression,n,r,a,f.path);if(c.isPropertyAccessExpression(s)||c.isElementAccessExpression(s)){let f=c.isPropertyAccessExpression(s)?s.name.text:I(s.argumentExpression);return o({expression:s.expression,path:[f,...i]})}let l=D(s,n);if(l){if(t.has(l))return[];let f=(r.get(l)??[]).flatMap(u=>{let d=zn(u,i);return d?re(u.expression,n,r,new Set(a).add(l),d):[]});return[{binding:l,path:[...i,null]},...f]}return Wn(s,i,n).flatMap(o)}function zn(e,n){let r=e.targetPath;if(r&&n.length<r.length&&W(r,n))return e.path;let t=e.shallowCopy&&n.length===0?[null,null]:[...n,null],i=an(e,t);return i?i.slice(0,-1):null}function Wn(e,n,r){if(c.isFunctionLike(e)&&"body"in e&&e.body)return se(e).map(t=>({expression:t,path:n}));if(c.isObjectLiteralExpression(e)||c.isArrayLiteralExpression(e)){let t=n.length?[...n,null]:[null,null];return on(e,t).map(i=>({...i,path:i.path.slice(0,-1)}))}return c.isConditionalExpression(e)?[e.whenTrue,e.whenFalse].map(t=>({expression:t,path:n})):c.isBinaryExpression(e)?[e.left,e.right].map(t=>({expression:t,path:n})):c.isCallExpression(e)||c.isNewExpression(e)?Un(e,n,r):[]}function Un(e,n,r){let t=ie(e.expression,r);return(t?se(t):[...e.arguments??[]]).map(s=>({expression:c.isSpreadElement(s)?s.expression:s,path:n}))}function Hn(e){if(c.isConditionalExpression(e))return[e.whenTrue,e.whenFalse];if(!c.isBinaryExpression(e))return null;let n=e.operatorToken.kind;return n===c.SyntaxKind.EqualsToken?[e.right]:[c.SyntaxKind.AmpersandAmpersandToken,c.SyntaxKind.BarBarToken,c.SyntaxKind.QuestionQuestionToken,c.SyntaxKind.AmpersandAmpersandEqualsToken,c.SyntaxKind.BarBarEqualsToken,c.SyntaxKind.QuestionQuestionEqualsToken].includes(n)?[e.left,e.right]:null}function Gn(e,n,r,t,i){if(cn(e,n)==="Object.assign")return e.arguments.flatMap((a,o)=>o===0||i.length>=2?v(a,n,r,t,i):[]);let s=ie(e.expression,n);return!s||t.has(s)?[]:se(s).flatMap(a=>v(a,n,r,new Set(t).add(s),i))}function Jn(e,n){let r=e.arguments??[],t=r[0];if(!t)return null;switch(cn(e,n)){case"Reflect.set":return qn(t,r,n);case"Object.defineProperty":return ln(r[2])?[{target:t,path:[null],unknown:!0}]:[{target:t,path:[r[1]?I(r[1]):null],unknown:!1}];case"Object.defineProperties":return Qn(r[1])?[{target:t,path:[null],unknown:!0}]:ye(r[1]).map(i=>({target:t,path:[i],unknown:!1}));case"Object.assign":return r.slice(1).flatMap(ye).map(i=>({target:t,path:[i],unknown:!1}));default:return null}}function qn(e,n,r){let t=n[1]?I(n[1]):null,i=n[3]??e,s=t===null?void 0:r.getTypeAtLocation(e).getProperty(t)?.valueDeclaration,a=C(e),o=!!s&&[c.SyntaxKind.PropertyAssignment,c.SyntaxKind.PropertyDeclaration,c.SyntaxKind.MethodDeclaration].includes(s.kind),f=c.isObjectLiteralExpression(a)&&a.properties.length===0||n[3]===void 0&&o;return[{target:i,path:f?[t]:[null],unknown:!f}]}function ln(e){return!e||ye(e).some(n=>n===null||n==="get"||n==="set")}function Qn(e){let n=e&&C(e);return!n||!c.isObjectLiteralExpression(n)?!0:n.properties.some(r=>!c.isPropertyAssignment(r)||ln(r.initializer))}function ye(e){let n=C(e);return c.isObjectLiteralExpression(n)?n.properties.map(r=>c.isSpreadAssignment(r)?null:te(r.name)):[null]}function cn(e,n){let r=C(e.expression);return!c.isCallExpression(e)||!c.isPropertyAccessExpression(r)||!c.isIdentifier(r.expression)||D(r.expression,n)?null:`${r.expression.text}.${r.name.text}`}var Xn=new Set([".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"]),un=new WeakMap;function A(e,n){let r=un.get(n);if(r)return r;let t=Xn.has(Yn(e))?qe(e,n.text):null,i=t&&t.errors.length===0?t:null,s,a=()=>s??=Zn(n,i),o,l=()=>o??=et(n),f,u=()=>f===void 0?f=i?en(i.sourceFile,i.checker):null:f,d=new Set,x=()=>u()?.written??d,b=m=>a().expressions.get(`${m.startIndex}:${m.endIndex}`),R=m=>{let p=a().identifiers.get(m.startIndex);if(!(!p||!t))return D(p,t.checker)},h=(m,p=!1,g=[],E=!0,L=m)=>{let T=b(m);if(!T||!t)return!1;let ce=L?b(L)??T:null;return u()?.hasWrite(T,p,g,E,ce)??!!R(ae(m))},w={available:!!t&&t.errors.length===0,moduleReferences(){return t&&t.errors.length===0?Qe(t.sourceFile,()=>t.checker).map(m=>({...m,line:m.line+n.startPosition.row})):[]},constantInitializer(m){let p=R(m);return!p||!y.isVariableDeclaration(p)||!p.initializer||!(p.parent.flags&y.NodeFlags.Const)||x().has(p)?null:l().get(`${p.initializer.getStart()}:${p.initializer.end}`)??null},callableValue(m){let p=b(m);if(!p||!t)return null;let g=ne(p,t.checker,x()),E=g&&y.isVariableDeclaration(g)?g.initializer:g;return ot(E,l())},hasObservedWrite:h,hasEscapedValue(m,p){let g=b(m);return!!g&&!!u()?.hasEscapedValue(g,p)},hasObservedCallableWrite(m,p=[],g=m){return h(m,!0,p,!1,g)},callableParameters(m){let p=[...a().expressions.values()].filter(g=>y.isFunctionLike(g)&&g.end+n.startIndex===m.endIndex&&g.getStart()+n.startIndex<=m.startIndex);return p.length!==1||!y.isFunctionLike(p[0])?null:p[0].parameters.filter(g=>g.name.getText()!=="this").map(g=>g.dotDotDotToken?"rest":g.initializer?"default":y.isIdentifier(g.name)?"direct":"destructured")},hasLocalBinding(m){let p=a().identifiers.get(ae(m).startIndex);return!!p&&!!t?.checker.getSymbolAtLocation(p)?.declarations?.length},isParameterBinding(m){let p=b(m);return!!p&&!!u()?.usesParameter(p)},valueDeclaration(m){if(!t)return null;let p=b(m),g=p&&ne(p,t.checker,x());if(!g||!y.isVariableDeclaration(g)||!y.isIdentifier(g.name))return null;let E=t.sourceFile.getLineAndCharacterOfPosition(g.getStart()),L=t.sourceFile.getLineAndCharacterOfPosition(g.end);return{name:g.name.text,startLine:E.line+n.startPosition.row,startColumn:E.character+(E.line===0?n.startPosition.column:0),endLine:L.line+n.startPosition.row,endColumn:L.character+(L.line===0?n.startPosition.column:0)}},importedValue(m){let p=b(m);return p&&t?U(p,t.checker,new Set):null},constructedValue(m){let p=b(m);return p&&t?fn(p,t.checker,new Set):null},resource(m){let p=ae(m),g=R(p);if(!g)return{resourceKey:`access:${m.startIndex}:${m.endIndex}`,identityBasis:"source-access-occurrence"};let E=m.text.slice(p.endIndex-m.startIndex).trim();return{resourceKey:`binding:${g.getStart()}:${g.end}:${E}`,identityBasis:"compiler-binding-access-path"}},isCaptured(m){let p=a().identifiers.get(m.startIndex),g=R(m),E=g&&ee(g),L=p&&ee(p);return!!E&&!!L&&E!==L},directParameterPosition(m){let p=b(m),g=p&&C(p);if(!g||!y.isIdentifier(g)||!t)return null;let E=ne(g,t.checker,x());if(!E||!y.isParameter(E)||!y.isIdentifier(E.name)||ee(g)!==E.parent||x().has(E))return null;let T=E.parent.parameters.filter(ce=>ce.name.getText()!=="this").indexOf(E);return T>=0?T:null},tupleElements(m){let p=b(m);if(!p||!t||h(m,!0))return null;let g=Ze(p,t.checker,x());if(!g||!y.isArrayLiteralExpression(g)||g.elements.some(L=>y.isSpreadElement(L)||y.isOmittedExpression(L)))return null;let E=g.elements.map(L=>l().get(`${L.getStart()}:${L.end}`));return E.every(L=>!!L)?E:null}};return un.set(n,w),w}function Zn(e,n){let r=new Map,t=new Map;if(n){let i=s=>{let a=s.getStart(n.sourceFile)+e.startIndex;y.isIdentifier(s)&&r.set(a,s),t.set(`${a}:${s.end+e.startIndex}`,s),y.forEachChild(s,i)};i(n.sourceFile)}return{identifiers:r,expressions:t}}function et(e){let n=new Map,r=t=>{n.set(`${t.startIndex-e.startIndex}:${t.endIndex-e.startIndex}`,t);for(let i of t.namedChildren)r(i)};return r(e),n}function fn(e,n,r){if(r.has(e))return null;if(r.add(e),y.isCallExpression(e)||y.isNewExpression(e))return U(e.expression,n,new Set);if(!y.isIdentifier(e))return null;let t=n.getSymbolAtLocation(e)?.valueDeclaration;return t&&y.isVariableDeclaration(t)&&t.initializer&&t.parent.flags&y.NodeFlags.Const?fn(t.initializer,n,r):null}function U(e,n,r){if(r.has(e))return null;if(r.add(e),e=C(e),y.isPropertyAccessExpression(e)||y.isElementAccessExpression(e)){let t=U(e.expression,n,r),i=y.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return t&&i!==null&&(t.member===null||t.member==="default")?{module:t.module,member:i}:null}return y.isCallExpression(e)?tt(e,n):nt(e,n,r)}function nt(e,n,r){if(!y.isIdentifier(e))return null;let t=n.getSymbolAtLocation(e)?.declarations?.[0];return t?y.isVariableDeclaration(t)&&t.initializer&&t.parent.flags&y.NodeFlags.Const?U(t.initializer,n,r):y.isBindingElement(t)?st(t,n,r):it(t):null}function tt(e,n){if(!y.isIdentifier(e.expression)||e.expression.text!=="require")return null;let r=e.arguments[0];return n.getSymbolAtLocation(e.expression)?.valueDeclaration||e.arguments.length!==1||!r||!y.isStringLiteralLike(r)?null:{module:r.text,member:null}}function rt(e){return y.isImportSpecifier(e)&&!e.isTypeOnly?{member:(e.propertyName??e.name).text}:y.isNamespaceImport(e)?{member:null}:y.isImportClause(e)&&!e.isTypeOnly?{member:"default"}:null}function it(e){let n=rt(e);if(!n)return null;let{member:r}=n;for(let t=e.parent;t;t=t.parent){if(y.isImportClause(t)&&t.isTypeOnly)return null;if(y.isImportDeclaration(t))return y.isStringLiteralLike(t.moduleSpecifier)?{module:t.moduleSpecifier.text,member:r}:null}return null}function st(e,n,r){if(!y.isObjectBindingPattern(e.parent)||e.dotDotDotToken||e.initializer)return null;let t=e.parent.parent;if(!y.isVariableDeclaration(t)||!t.initializer||!(t.parent.flags&y.NodeFlags.Const))return null;let i=U(t.initializer,n,r),s=e.propertyName??e.name;if(!i||i.member!==null)return null;let a=at(s);return a===null?null:{module:i.module,member:a}}function at(e){return y.isIdentifier(e)||y.isStringLiteralLike(e)?e.text:null}function ae(e){let n=e.childForFieldName("object")??e.childForFieldName("array");return n?ae(n):e}function ot(e,n){if(!e||!(y.isFunctionDeclaration(e)||y.isFunctionExpression(e)||y.isArrowFunction(e)))return null;let r=n.get(`${e.getStart()}:${e.end}`);return r?.type==="export_statement"?r.childForFieldName("declaration"):r??null}var lt=4;function dn(e,n,r,t={}){return pn(e,n,r,t.maxReexportDepth??lt,0,new Set)}function pn(e,n,r,t,i,s){let a=`${n}\0${r}`;if(s.has(a)||i>t)return[];s.add(a);let o=N(e,n).filter(l=>l.leaf===r);return o.length>0?o:ke(e,n).flatMap(l=>l.sourcePath?l.kind==="named"&&!l.names.includes(r)?[]:pn(e,l.sourcePath,r,t,i+1,new Set(s)):[])}import{ts as B}from"@ts-morph/common";var be=new WeakMap;function mn(e){if(e.type!=="string"&&e.type!=="template_string")return null;if(be.has(e))return be.get(e);let n=ct(e.text);return be.set(e,n),n}function ct(e){let n=B.createSourceFile("literal.ts",e,B.ScriptTarget.Latest,!1,B.ScriptKind.TS);if(n.parseDiagnostics.length>0||n.statements.length!==1)return null;let r=n.statements[0];if(!B.isExpressionStatement(r))return null;let t=r.expression;return B.isStringLiteralLike(t)?{value:t.text,interpolated:!1}:B.isTemplateExpression(t)?{value:t.head.text+t.templateSpans.map(i=>"{}"+i.literal.text).join(""),interpolated:!0}:null}function H(e,n,r){if(e.length!==3&&e.length!==4)return;let t=e[0],i=e.length===4?e[2]:t,s=gn(r[t],e[1],n),a=gn(r[i],e[e.length-1],n);if(!(s===void 0||a===void 0)&&!(i<t||i===t&&a<s))return{startLine:t,startColumn:s,endLine:i,endColumn:a}}function gn(e,n,r){if(e===void 0||!Number.isSafeInteger(n)||n<0)return;let t=r||([...e.slice(0,n)].every(i=>i.charCodeAt(0)<128)?"UTF-16":void 0);switch(t){case"UTF-16":return n<=e.length?n:void 0;case"UTF-8":case"UTF-32":return ut(e,n,t);default:return}}function ut(e,n,r){let t=0,i=0;for(let s of e){if(t===n)return i;if(t+=r==="UTF-8"?Buffer.byteLength(s,"utf8"):1,i+=s.length,t>n)return}return t===n?i:void 0}import{fromBinary as ft}from"@bufbuild/protobuf";import{DocumentSchema as dt,SymbolRole as oe}from"@c4312/scip";import{zstdDecompressSync as pt}from"zlib";var mt=ve("scip-chunk-occurrence-targets",{clearGroups:["whole-project","definition-catalog","source-file"],maxEntries:256}),gt=M("scip-chunk-occurrence-definitions",{clearGroups:["whole-project","definition-catalog"]}),yn=1,yt=M("scip-chunk-occurrence-data-present",{clearGroups:["whole-project"]});function Se(e){return yt.get(e,()=>{let n=e.get("SELECT length(occurrences) AS size FROM chunks LIMIT 1");return n!==void 0&&(n.size??0)>yn})}function G(e,n){return mt.get(e,n,()=>bt(e,n))}function xe(e,n){return`${e}\0${n}`}function bt(e,n){let r=e.get("SELECT id, position_encoding FROM documents WHERE relative_path = ?",n);if(!r)return{available:!1,reason:"no-document"};let t=e.all("SELECT occurrences FROM chunks WHERE document_id = ? ORDER BY chunk_index",r.id);if(t.length===0)return Se(e)?{available:!0,targets:[],externalLeafKeys:new Set,locals:[]}:{available:!1,reason:"no-occurrence-data"};let i={targets:[],externalLeafKeys:new Set,locals:[],externalRanges:[]},s=Q(e,n);for(let a of t){let o=St(a.occurrences);if(!o)return{available:!1,reason:"no-occurrence-data"};let l=xt(e,o);for(let f of o)ht(f,r.position_encoding,s,l,i)}return{available:!0,...i}}function St(e){if(!e||e.length<=yn)return null;try{return ft(dt,new Uint8Array(pt(e))).occurrences}catch{return null}}function xt(e,n){let r=gt.get(e,()=>new Map),t=new Set(n.filter(a=>a.symbol&&!a.symbol.startsWith("local ")&&!(a.symbolRoles&oe.Definition)).map(a=>a.symbol)),i=[...t].filter(a=>!r.has(a)),s=Ve(e,i);for(let a of i)r.set(a,null);for(let a of s)r.set(a.symbol,a);for(let a of t){let o=r.get(a);o&&Te(o.relativePath)}return r}function ht(e,n,r,t,i){if(!e.symbol)return;let s=e.range[0];if(!Number.isInteger(s))return;let a=H(e.range,n,r);if(e.symbol.startsWith("local ")){a&&i.externalRanges.push(a),a&&i.locals.push(Ct(e.symbol,a,e.symbolRoles));return}if((e.symbolRoles&oe.Definition)!==0)return;let o=t.get(e.symbol);if(o){i.targets.push({sourceLine:s,...a?{sourceRange:a}:{},definition:o});return}a&&i.externalRanges.push(a);let l=Et(e.symbol);l&&i.externalLeafKeys.add(xe(s,l))}function Ct(e,n,r){return{symbol:e,line:n.startLine,startChar:n.startColumn,endLine:n.endLine,endChar:n.endColumn,definition:(r&oe.Definition)!==0,write:(r&oe.WriteAccess)!==0}}function Et(e){if(e.startsWith("local "))return null;try{let n=k(e);return n.length>0?n:null}catch{return null}}function J(e,n){return!!(e&&n&&e.startLine===n.startLine&&e.startColumn===n.startColumn&&e.endLine===n.endLine&&e.endColumn===n.endColumn)}function bn(e,n,r){let t=A(e.file,e.root).importedValue(n),i=t?.member??r;if(!t||!i)return null;let s=t.member!==null?Rt(e,n):null;if(s)return s;let a=Ae(e.db,e.file,t.module),o=a?dn(e.db,a,i):[];return o.length===1?o[0]:null}function Rt(e,n){let r=P(n);if(r.type!=="identifier"||K(e.db,e.file)?.freshness.semantic.state==="stale")return null;let t={startLine:r.startPosition.row,startColumn:r.startPosition.column,endLine:r.endPosition.row,endColumn:r.endPosition.column},i=G(e.db,e.file);if(!i.available)return null;let s=i.targets.filter(o=>o.definition.relativePath!==e.file&&J(o.sourceRange,t)),a=new Map(s.map(o=>[o.definition.symbol,o.definition]));return a.size===1?[...a.values()][0]:null}function Sn(e,n){let r=O(e.db,n.relativePath)?.rootNode,t=r&&Nt(r,n);return r&&t?{context:{...e,file:n.relativePath,root:r},declaration:t}:null}function ii(e,n,r){let t=A(e.file,e.root);if(t.hasEscapedValue(n,r))return!0;let i=t.valueDeclaration(n);if(!i)return!1;let s=N(e.db,e.file).filter(l=>l.leaf===i.name&&l.startLine===i.startLine&&(l.startChar??0)<=i.startColumn&&l.endLine>=i.endLine);if(s.length!==1)return!1;let a=s[0].symbol,o=Lt(e.db,a);return Oe(a,o),o.some(l=>l!==e.file&&wt(e,l,a,r))}function Lt(e,n){return e.all(`SELECT DISTINCT d.relative_path FROM global_symbols gs
2
+ JOIN mentions m ON m.symbol_id = gs.id JOIN chunks c ON c.id = m.chunk_id
3
+ JOIN documents d ON d.id = c.document_id WHERE gs.symbol = ?`,n).map(r=>r.relative_path).sort()}function wt(e,n,r,t){let i=K(e.db,n),s=O(e.db,n)?.rootNode,a=G(e.db,n);if(!s||!i||i.freshness.semantic.state==="stale"||!a.available)return!0;let o=a.targets.filter(d=>d.definition.symbol===r),l=A(n,s);if(!l.available||o.length===0)return!0;let f=new Set(o),u=!1;return Y(s,d=>{if(u||!["identifier","property_identifier","shorthand_property_identifier","string","string_fragment","number"].includes(d.type))return;let x={startLine:d.startPosition.row,startColumn:d.startPosition.column,endLine:d.endPosition.row,endColumn:d.endPosition.column},b=o.filter(h=>J(h.sourceRange,x));if(b.length===0)return;for(let h of b)f.delete(h);let R=Dt(d);u=!R||l.hasObservedWrite(R,!0,t,!1,null)}),u||f.size>0}function Dt(e){let n=e.type==="string_fragment"?e.parent??e:e,r=n.parent&&(e.type==="property_identifier"||n.parent.type==="subscript_expression")?n.parent:n;return["identifier","shorthand_property_identifier","member_expression","subscript_expression"].includes(r.type)?r:null}function xn(e,n){let r=A(e.file,e.root).callableValue(n);if(r)return{context:e,callable:r};let t=bn(e,n),i=t&&Sn(e,t);if(!i)return null;let s=i.declaration,a=["function_declaration","function_expression","arrow_function","generator_function_declaration"].includes(s.type)?s:A(i.context.file,i.context.root).callableValue(s);return a?{context:i.context,callable:a}:null}function Nt(e,n){let r=[];for(let t of Me(e,["variable_declarator","function_declaration","generator_function_declaration","function_expression","arrow_function"])){let i=t.childForFieldName("name"),s=!i&&n.symbol.endsWith("/default().")&&vt(t);!s&&i?.text!==n.leaf||t.startPosition.row!==n.startLine||t.endPosition.row>n.endLine||t.startPosition.column<(n.startChar??0)||t.endPosition.row===n.endLine&&n.endChar&&t.endPosition.column>n.endChar||r.push(s?t:i)}return r.length===1?r[0]:null}function le(e,n,r=[],t=new Set,i={file:e.file,node:n}){let s=P(n),a=`${e.file}:${s.startIndex}:${s.endIndex}:${JSON.stringify(r)}`;if(t.has(a))return!1;let o=new Set(t).add(a),l=A(e.file,e.root);if(l.hasObservedCallableWrite(s,r,i.file===e.file?i.node:void 0))return!0;let f=hn(s),u=f?.base??s,d=[...f?.properties??[],...r],x=l.constantInitializer(u);if(x)return le(e,x,d,o,i);let b=l.importedValue(u);if(!b)return!1;let R=bn(e,u,d[0]),h=R&&Sn(e,R);if(!h)return!1;let w=b.member===null?d.slice(1):d;return le(h.context,h.declaration,w,o,i)}function hn(e){let n=P(e);if(!["member_expression","subscript_expression"].includes(n.type))return null;let r=n.childForFieldName("object"),t=n.type==="member_expression"?n.childForFieldName("property"):n.childForFieldName("index"),i=t?It(t):null;if(!r||i===null)return null;let s=hn(r);return s?{base:s.base,properties:[...s.properties,i]}:{base:P(r),properties:[i]}}function It(e){if(e.type==="property_identifier")return e.text;if(e.type==="number"){let r=Number(e.text.replaceAll("_",""));return Number.isFinite(r)?String(r):null}let n=mn(e);return n&&!n.interpolated?n.value:null}function vt(e){let n=e;for(;n.parent;){let r=P(n.parent);if(r.startIndex!==e.startIndex||r.endIndex!==e.endIndex)break;n=n.parent}return n.parent?.type==="export_statement"}import{existsSync as Ot}from"fs";import{SymbolRole as Tt}from"@c4312/scip";import{deserializeSCIP as At}from"@c4312/scip";function Cn(e,n){return At(Ie(e,{inputKind:n,maxBytes:Ne}))}var he=new WeakMap;function q(e,n){if(K(e,n)?.freshness.semantic.state==="stale")return null;let r=G(e,n);if(r.available)return{targets:r.targets,externalLeafKeys:r.externalLeafKeys,externalRanges:r.externalRanges,locals:r.locals};if(r.reason==="no-document")return null;if(Se(e))return{targets:[],externalLeafKeys:new Set,locals:[]};let t=_t(e);return t?{targets:t.byFile.get(n)??[],externalLeafKeys:new Set,externalRanges:t.externalByFile.get(n)??[],locals:[]}:null}function wi(e,n,r,t,i){let s=V(e,n)??X(e,n)?.callSites,a=(s??[]).filter(b=>b.line>=r&&b.line<=t);if(!s||a.length===0)return{available:!!s,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let o=q(e,n);if(!o)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:a.length};let l=[],f=[],u=0,d=0,x=0;for(let b of a){let R=o.targets.filter(p=>J(p.sourceRange,b.targetRange)),h=new Map(R.map(p=>[p.definition.symbol,p]));if(i&&![...h.keys()].some(p=>i.has(p))||(x++,f.push(...[...h.values()].map(p=>({...p,sourceLine:b.line,sourceOwner:b.owner,calleeLeaf:p.definition.leaf}))),Ee(e,n,b))||h.size!==1)continue;let w=[...h.values()][0],m=Ce(e,n,b,w.definition);m.implementationStatus==="established"&&d++,u++,l.push({...w,...m,sourceLine:b.line,sourceOwner:b.owner,calleeLeaf:w.definition.leaf})}return{available:!0,targets:l,resolvedCallsites:u,unresolvedCallsites:x-u,declarations:f,implementationUnresolvedCallsites:x-d}}function Ce(e,n,r,t){let i=Re(e,n,r);if(!i?.bindings.available){let a=X(e,n)?.language;return a==="typescript"||a==="javascript"?{implementationStatus:"unresolved",implementationReason:"source-binding-unavailable"}:{implementationStatus:"established"}}if(r.kind==="new"&&!r.memberAccess&&(t.isTypeLike||t.leaf==="<constructor>"))return Pt(e,t);let s=xn({db:e,file:n,root:i.root},i.target);return s&&s.context.file===t.relativePath&&Mt(t,s.callable)?{implementationStatus:"established"}:{implementationStatus:"unresolved",implementationReason:r.memberAccess?"member-value-and-runtime-dispatch-unproved":"indirect-callable-value-unproved"}}function Mt(e,n){let{startLine:r,startChar:t,endLine:i,endChar:s}=e;if(t===void 0||s===void 0||r===i&&t>=s)return!1;let a=n.startPosition,o=n.endPosition;return(a.row>r||a.row===r&&a.column>=t)&&(o.row<i||o.row===i&&o.column<=s)}function Pt(e,n){let r=O(e,n.relativePath)?.rootNode,t;return r&&Y(r,s=>{["class_declaration","abstract_class_declaration","class"].includes(s.type)&&kt(s,n)&&(!t||s.endIndex-s.startIndex<t.endIndex-t.startIndex)&&(t=s)}),t?t.namedChildren.some(s=>s.type==="decorator")||t.parent?.type==="export_statement"&&t.parent.namedChildren.some(s=>s.type==="decorator")?{implementationStatus:"unresolved",implementationReason:"class-decorator-runtime-constructor-unproved"}:{implementationStatus:"established"}:{implementationStatus:"unresolved",implementationReason:"constructor-source-unproved"}}function kt(e,n){let{startLine:r,startChar:t,endLine:i,endChar:s}=n;return t===void 0||s===void 0?!1:(e.startPosition.row<r||e.startPosition.row===r&&e.startPosition.column<=t)&&(e.endPosition.row>i||e.endPosition.row===i&&e.endPosition.column>=s)}function Ee(e,n,r){let t=Re(e,n,r);return t?le({db:e,file:n,root:t.root},t.target):!1}function Di(e,n,r){let t=Re(e,n,r);return t?.bindings.isParameterBinding(t.target)??!1}function Re(e,n,r){let t=r.targetExpressionRange??r.targetRange,i=O(e,n)?.rootNode;if(!t||!i)return null;let s=pe(i,t.startLine,t.endLine,de,t);return s?{root:i,target:s,bindings:A(n,i)}:null}function Ft(e,n,r,t){let i=q(e,n);return i?{available:!0,targets:i.targets.filter(s=>s.sourceLine>=r&&s.sourceLine<=t)}:{available:!1,targets:[]}}function Ni(e,n,r,t){let i=q(e,n);return i?{available:!0,targets:i.targets.filter(s=>s.sourceLine>=r&&s.sourceLine<=t&&Vt(e,s.definition)).map(s=>En(e,n,s))}:{available:!1,targets:[]}}function Ii(e,n,r,t){let i=Ft(e,n,r,t);return{available:i.available,targets:i.targets.filter(s=>s.definition.isTypeLike).map(s=>En(e,n,s))}}function En(e,n,r){let t=O(e,n),i=X(e,n)?.language,s=r.sourceRange,a=t&&s&&pe(t.rootNode,s.startLine,s.endLine,de,s),o=a&&i?Pe(a,i):void 0;if(o){let u=$(e,n,N(e,n)).get(F(o));return{...r,calleeLeaf:r.definition.leaf,sourceOwner:o,sourceDefinition:u??null}}let l=s?N(e,n).filter(u=>u.startLine<=s.startLine&&u.endLine>=s.endLine&&(u.startLine!==s.startLine||(u.startChar??0)<=s.startColumn)&&(u.endLine!==s.endLine||u.endChar===void 0||u.endChar>=s.endColumn)):[],f=l.filter(u=>!l.some(d=>d!==u&&d.startLine>=u.startLine&&d.endLine<=u.endLine&&(d.startLine!==u.startLine||(d.startChar??0)>=(u.startChar??0))&&(d.endLine!==u.endLine||(d.endChar??1/0)<=(u.endChar??1/0))));return{...r,calleeLeaf:r.definition.leaf,sourceOwner:o??void 0,sourceDefinition:f.length===1?f[0]:null}}function _t(e){if(De(),he.has(e))return he.get(e)??null;let n=Bt(e);return he.set(e,n),n}function Bt(e){if(!e.generation.indexPath||!Ot(e.generation.indexPath))return null;try{let n=Z(e),r=new Map(n.map(a=>[a.symbol,a])),t=Cn(e.generation.indexPath,"SCIP source-range call-target index"),i=new Map,s=new Map;for(let a of t.documents??[]){let o=a.relativePath;if(!o||e.isIgnored(o))continue;let{targets:l,externalRanges:f}=jt(e,o,a,r);i.set(o,l),s.set(o,f)}return{byFile:i,externalByFile:s}}catch{return null}}function jt(e,n,r,t){let i=[],s=[],a=Q(e,n),o={1:"UTF-8",2:"UTF-16",3:"UTF-32"}[r.positionEncoding];for(let l of r.occurrences??[]){if(!l.symbol||(l.symbolRoles&Tt.Definition)!==0)continue;let f=t.get(l.symbol),u=l.range?.[0];if(!Number.isInteger(u))continue;let d=H(l.range,o,a);if(!f){d&&s.push(d);continue}i.push({sourceLine:u,...d?{sourceRange:d}:{},definition:f})}return{targets:i,externalRanges:s}}function Vt(e,n){if(!n.isFunctionLike)return!1;let r=j(e,n.relativePath);return!r||r.some(t=>t.name===n.leaf&&t.startLine===n.startLine&&t.endLine===n.endLine)?!0:Kt(n)}function Kt(e){let n=e.documentation;if(!n)return!1;let r=e.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${r}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(n)||new RegExp(`\\b(?:const|let|var)\\s+${r}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(n)}function Wi(e,n,r={}){let t=Dn(e,[n],{additive:r.additive,semantic:r.semantic,semanticEvidence:r.semanticEvidence}),i=r.callableOnly?(t.get(n.symbolId)??[]).filter(s=>je(s.symbol)||s.source==="ast-callsite"||s.source==="scip-occurrence"||s.source==="scip-declaration"):t.get(n.symbolId)??[];return typeof r.limit=="number"?i.slice(0,r.limit):i}function Ui(e,n,r){return $t(e,[n],r).get(n.symbolId)??[]}function $t(e,n,r){let t=Ht(e)?Jt(e,n,{semantic:r.semantic!==!1,semanticEvidence:r.semanticEvidence}):Gt(e,r.semanticEvidence);return typeof r.limit!="number"?new Map(n.map(i=>[i.symbolId,t.get(i.symbolId)??[]])):new Map(n.map(i=>[i.symbolId,(t.get(i.symbolId)??[]).slice(0,r.limit)]))}var zt=M("caller-rows",{clearGroups:["whole-project"]}),Wt=M("targeted-caller-strategy",{clearGroups:["whole-project"]}),Ut=2e4;function Ht(e){return Wt.get(e,()=>(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Ut)}function Gt(e,n){return zt.get(e,()=>{let r=Z(e),t=Dn(e,r,{semanticEvidence:n}),i=new Map;for(let o of r)i.set(o.symbol,o.symbolId);let s=new Map,a=new Map;for(let o of r){let l=t.get(o.symbolId);!l||l.length===0||pr(o,l,i,s,a)}return s})}function Jt(e,n,r){let t=r.semantic&&r.semanticEvidence?n.flatMap(u=>{let d=Xt(e,u);return d?[d]:[]}):[],i=new Map(t.map(u=>[u.symbolId,u])),s=r.semanticEvidence?.referenceMap(e,t)??new Map,a=He(e,n),o=qt(e,n),l=new Map,f={astCallersByTarget:o,resolvedReferences:a,definitionBySymbolId:i,semanticReferences:s};for(let u of n)l.set(u.symbolId,Qt(e,u,f));return l}function qt(e,n){let r=new Set(n.map(o=>o.symbol)),i=[...new Set(n.flatMap(o=>Be(e,"reverse",[o.relativePath])))].flatMap(o=>N(e,o)),s=new Map,a=Nn(e,i);for(let o of i)for(let l of a.get(o.symbolId)??[]){if(!r.has(l.symbol))continue;let f=s.get(l.symbol)??[];f.push({symbol:o.symbol,file:o.relativePath,source:"caller-map-inversion",callEvidence:l.source}),s.set(l.symbol,f)}return s}function Qt(e,n,r){let t=[],i=new Set,s=a=>{if(a.symbol===n.symbol)return;let o=`${a.symbol}|${a.file}`;i.has(o)||(i.add(o),t.push(a))};for(let a of r.astCallersByTarget.get(n.symbol)??[])s(a);for(let a of r.resolvedReferences.get(n.symbolId)??[])a.file!==n.relativePath&&s({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});return Yt(e,n,r,s),t}function Yt(e,n,r,t){let i=r.definitionBySymbolId.get(n.symbolId);if(i)for(let s of r.semanticReferences.get(i.symbolId)??[]){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let a=$e(N(e,s.file),s.line);t({symbol:a?.symbol??s.file,file:s.file,source:"semantic-reference"})}}function Xt(e,n){let r=Ge().join(", "),t=Je().join(", ");return e.get(`SELECT
4
+ d.id AS documentId,
5
+ gs.id AS symbolId,
6
+ gs.symbol,
7
+ d.relative_path AS relativePath,
8
+ COALESCE(der.start_line, c.start_line) AS startLine,
9
+ COALESCE(der.end_line, c.end_line) AS endLine,
10
+ COALESCE(gs.display_name, '') AS leaf,
11
+ NULL AS parentTypeName,
12
+ CASE WHEN gs.kind IN (${r}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
13
+ CASE WHEN gs.kind IN (${t}) THEN 1 ELSE 0 END AS isTypeLike,
14
+ gs.kind AS kind,
15
+ gs.documentation AS documentation,
16
+ gs.enclosing_symbol AS enclosingSymbol
17
+ FROM global_symbols gs
18
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
19
+ LEFT JOIN chunks c ON c.document_id = der.document_id
20
+ JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
21
+ WHERE gs.id = ?
22
+ LIMIT 1`,n.symbolId)??null}function Dn(e,n,r={}){if(n.length===0)return new Map;let t=r.additive??!1,{astDefs:i,chunkOnlyDefs:s}=mr(e,n),a=new Map,o=new Map,l=u=>{for(let[d,x]of u){let b=a.get(d);b||(b=[],a.set(d,b));let R=o.get(d);R||(R=new Map,o.set(d,R));for(let h of x){let w=`${h.symbol}|${h.chunkId}`,m=R.get(w);if(m){Ln(m.source)==="candidate"&&Ln(h.source)==="exact"&&Object.assign(m,h);continue}let p={...h};R.set(w,p),b.push(p)}}};i.length>0&&l(Nn(e,i)),r.semantic!==!1&&r.semanticEvidence&&l(dr(r.semanticEvidence.calleeMap(e,n)));let f=t?n:s;return f.length>0&&l(sr(e,f)),a}function Nn(e,n){let r=new Map,t=tr(n,r),i=Ue(e);for(let[s,a]of t){let o=V(e,s);if(!o)continue;let l=Ke(a),f=$(e,s,a),u=er(q(e,s));for(let d of o){let x=d.owner===void 0?l.get(d.line):f.get(F(d.owner));if(!x)continue;let b=Zt(e,s,i,d,u);b&&r.get(x.symbolId).push(b)}}return r}function Zt(e,n,r,t,i){if(Ee(e,n,t))return null;let s=t.targetRange?we(t.targetRange):null;if(i&&s){let o=nr(i,s);if(o){let f=Ce(e,n,t,o.definition).implementationStatus==="unresolved"?"scip-declaration":t.owner!==void 0?"scip-occurrence":"ast-callsite";return Rn(o,t,f)}if(i.targetsByRange.has(s)||i.externalRanges.has(s))return null}if(i?.externalLeafKeys.has(xe(t.line,t.calleeLeaf)))return null;let a=rr(e,n,r,t);return a?Rn(a,t,"ast-callsite"):null}function Rn(e,n,r){return{symbol:e.symbol,file:e.file,chunkId:n.line,source:r,callsiteLine:n.line,...n.kind==="jsx-render"?{kind:"jsx-render"}:{}}}function we(e){return`${e.startLine}:${e.startColumn}:${e.endLine}:${e.endColumn}`}function er(e){if(!e)return null;let n=new Map;for(let r of e.targets){if(!r.sourceRange)continue;let t=we(r.sourceRange),i=n.get(t)??[];i.push(r.definition),n.set(t,i)}return{targetsByRange:n,externalLeafKeys:e.externalLeafKeys,externalRanges:new Set((e.externalRanges??[]).map(we))}}function nr(e,n){let r=e.targetsByRange.get(n);if(!r?.length)return null;let t=r[0];return r.some(i=>i.symbol!==t.symbol)?null:{symbol:t.symbol,file:t.relativePath,definition:t}}function Ln(e){return e==="scip-occurrence"||e==="semantic-callee"?"exact":"candidate"}function tr(e,n){let r=new Map;for(let t of e){let i=r.get(t.relativePath);i?i.push(t):r.set(t.relativePath,[t]),n.set(t.symbolId,[])}for(let t of r.values())t.sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine));return r}function rr(e,n,r,t){let i=_e(e,n,t.calleeLeaf);if(i){let o=me(n,r.get(i.importedName)??[]).filter(l=>ue(i.sourcePath,l.file));return o.length===1?o[0]:null}let s=me(n,r.get(t.calleeLeaf)??[]);if(s.length===0)return null;let a=ir(e,n,s,t.calleeQualifier);return a||We(e,n,s,t.memberAccess,t.calleeQualifier)}function ir(e,n,r,t){if(!t||fe(n)!=="clojure")return null;let s=Fe(e,n).filter(a=>a.kind==="namespace"&&a.localName===t&&a.sourcePath).map(a=>a.sourcePath);for(let a of s){let o=r.find(l=>ue(a,l.file));if(o)return o}return r.find(a=>/`([^`]+)`\//.exec(a.symbol)?.[1]===t)??null}function sr(e,n){if(n.length===0)return new Map;let r=ar(e,n),t=new Map;for(let[i,s]of fr(n)){let a=r.byDoc.get(i)??[];for(let[o,l]of or(e,s,a,r))t.set(o,l)}return t}function ar(e,n){let t=Le(n.map(u=>u.documentId)).flatMap(u=>e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
23
+ FROM mentions m
24
+ JOIN chunks c ON m.chunk_id = c.id
25
+ WHERE m.role != 1
26
+ AND c.document_id IN (${u.map(()=>"?").join(",")})`,...u)),i=new Map;for(let u of t)i.has(u.document_id)||i.set(u.document_id,[]),i.get(u.document_id).push(u);let a=Le(t.map(u=>u.symbol_id)).flatMap(u=>e.all(`SELECT gs.id AS symbol_id, gs.symbol,
27
+ COALESCE(der.document_id, def_chunk.document_id) AS document_id
28
+ FROM global_symbols gs
29
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
30
+ LEFT JOIN (
31
+ SELECT m.symbol_id, MIN(c.document_id) AS document_id
32
+ FROM mentions m
33
+ JOIN chunks c ON m.chunk_id = c.id
34
+ WHERE m.role = 1
35
+ AND m.symbol_id IN (${u.map(()=>"?").join(",")})
36
+ GROUP BY m.symbol_id
37
+ ) def_chunk ON def_chunk.symbol_id = gs.id
38
+ WHERE gs.id IN (${u.map(()=>"?").join(",")})`,...u,...u)),o=Le([...n.map(u=>u.documentId),...a.flatMap(u=>u.document_id===null?[]:[u.document_id])]),l=new Map(o.flatMap(u=>e.all(`SELECT id, relative_path FROM documents
39
+ WHERE id IN (${u.map(()=>"?").join(",")})`,...u).map(d=>[d.id,d.relative_path]))),f=new Map;for(let u of a)f.has(u.symbol_id)||f.set(u.symbol_id,{symbol:u.symbol,file:u.document_id!==null?l.get(u.document_id)??"":""});return{byDoc:i,docPaths:l,calleeInfo:f}}function or(e,n,r,t){let i=new Map,s=[...r].sort((f,u)=>f.start_line-u.start_line||f.end_line-u.end_line),a=[...n].sort((f,u)=>f.startLine-u.startLine||f.endLine-u.endLine),o=new Set,l=0;for(let f of a){for(;l<s.length&&s[l].start_line<=f.endLine;)o.add(s[l]),l+=1;for(let u of o)u.end_line<f.startLine&&o.delete(u);i.set(f.symbolId,ur(e,f,o,t))}return i}function lr(e,n,r){let t=new Set;if(!n)return t;let i=ze(e,n),s=Math.max(0,r.startLine),a=Math.min(i.length-1,r.endLine);for(let o=s;o<=a;o+=1)for(let l of i[o])t.add(l);return t}function cr(e,n,r,t){if(!(e.start_line>=n.startLine&&e.end_line<=n.endLine)){if(!(e.start_line<=n.endLine&&e.end_line>=n.startLine))return!1;let a=k(r);if(!a||!t().has(a))return!1}return!0}function ur(e,n,r,{docPaths:t,calleeInfo:i}){let s=new Set,a=[],o=null,l=()=>o??=lr(e,t.get(n.documentId)??"",n);for(let f of r){if(f.symbol_id===n.symbolId)continue;let u=i.get(f.symbol_id);if(!u||!cr(f,n,u.symbol,l))continue;let d=`${u.symbol}|${f.chunk_id}`;s.has(d)||(s.add(d),a.push({...u,chunkId:f.chunk_id,source:"scip-chunk"}))}return a}var wn=500;function Le(e){let n=[...new Set(e)],r=[];for(let t=0;t<n.length;t+=wn)r.push(n.slice(t,t+wn));return r}function fr(e){let n=new Map;for(let r of e){let t=n.get(r.documentId);t?t.push(r):n.set(r.documentId,[r])}return n}function dr(e){let n=new Map;for(let[r,t]of e){let i=[];for(let s of t)i.push({symbol:s.symbol,file:s.file,chunkId:-1,source:"semantic-callee",...s.callsiteLine===void 0?{}:{callsiteLine:s.callsiteLine},...s.kind==="jsx-render"?{kind:"jsx-render"}:{}});n.set(r,i)}return n}function pr(e,n,r,t,i){for(let s of n){let a=r.get(s.symbol);if(a===void 0||a===e.symbolId)continue;let o=t.get(a);o||(o=[],t.set(a,o),i.set(a,new Set));let l=`${e.symbol}|${e.relativePath}`;i.get(a).has(l)||(i.get(a).add(l),o.push({symbol:e.symbol,file:e.relativePath,source:"caller-map-inversion",callEvidence:s.source}))}}function mr(e,n){let r=[],t=[];for(let i of n)fe(i.relativePath)&&V(e,i.relativePath)!==null?r.push(i):t.push(i);return{astDefs:r,chunkOnlyDefs:t}}export{F as a,$ as b,Ye as c,A as d,dn as e,mn as f,H as g,J as h,bn as i,Sn as j,ii as k,Lt as l,xn as m,Nt as n,le as o,hn as p,q,wi as r,Di as s,Ft as t,Ni as u,Ii as v,En as w,Vt as x,Wi as y,Ui as z,$t as A,Dn as B,Ln as C};
40
+ //# sourceMappingURL=chunk-4WTUBQ36.js.map
@@ -0,0 +1,3 @@
1
+ import{a as H,b as U,c as ue,e as me,f as ye,g as B,h as _,l as he}from"./chunk-CN5EH7O3.js";import{Y as v,Z as Se,f as ce,g as le,h as fe,i as pe,j as J,q as de}from"./chunk-J5FJMODQ.js";import{e as se}from"./chunk-X6RMKHJQ.js";import{a as O}from"./chunk-QOIXNWQR.js";import{d as oe}from"./chunk-GZKFETP5.js";import{d as w,e as ge}from"./chunk-YULZRALL.js";import{a as A,e as x}from"./chunk-HGFDYOVB.js";import{q as ae,v as $}from"./chunk-TKD34PHN.js";import{i as ie}from"./chunk-62BDNPMI.js";import{existsSync as E}from"fs";import S from"path";var K=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(i,e){let t=e?S.dirname(S.join(i,e)):i,r=S.resolve(i);for(;t.startsWith(r);){for(let s of K){let a=S.join(t,s);if(E(a))return a}let o=S.dirname(t);if(o===t)break;t=o}for(let o of K){let s=S.join(i,o);if(E(s))return s}return null}function be(i){let e=i.config.projectRoot,n=new Set(Be(e,i.config.semantic?.typescript?.tsconfigs)),t=O(i,{includeIgnored:!1,extensions:H});for(let r of t){let o=z(e,r);o&&n.add(S.resolve(o))}if(n.size===0){let r=z(e);r&&n.add(S.resolve(r))}return[...n].filter(r=>!Me(e,r)).sort((r,o)=>r.localeCompare(o))}function Be(i,e=[]){let n=new Set;for(let t of e){let r=S.isAbsolute(t)?t:S.join(i,t);E(r)&&n.add(S.resolve(r))}for(let t of _e(i))for(let r of K){let o=S.join(t,r);E(o)&&n.add(S.resolve(o))}if(n.size===0){let t=z(i);t&&n.add(S.resolve(t))}return[...n].filter(t=>!Me(i,t)).sort((t,r)=>t.localeCompare(r))}function _e(i){let e=S.join(i,"package.json");if(!E(e))return[];let n;try{n=JSON.parse(ie(e,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>pe(i,r))}function Me(i,e){let n=S.relative(i,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function I(i,e,n){if(i.has(e))return i.get(e);let t=n();return i.set(e,t),t}import Fe from"path";import{realpathSync as Ie}from"fs";function We(i,e){return i.getReferences().map(n=>{let t=n.getNode();return W(t,e)})}function $e(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function De(i,e,n,t){let r=[];for(let o of $e(i))for(let s of We(o,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let o of n)r.push(o);return k(r)}function Te(i,e,n,t){let r=[],o=n?.getStart();for(let s of i.getReferences()){let a=s.getNode();N(t,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||r.push({location:W(a,t),node:a}))}return r}function W(i,e){let n=i.getSourceFile(),t=n.getLineAndColumnAtPos(i.getStart());return{file:N(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function Ce(i,e,n){let t=i.getSourceFile(),r=q(t,i),o=i.getText(),s=new RegExp(`\\b${de(o)}\\b`,"g"),a=t.getFullText().split(`
2
+ `),l=[];for(let f=0;f<a.length;f++){if(f===r)continue;let c=a[f]??"";s.lastIndex=0;let p;for(;(p=s.exec(c))!==null;)l.push({file:e,line:f,column:p.index})}return k(l.filter(f=>N(n,Fe.join(n,f.file))===e))}function V(i){for(let e=i;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function k(i){let e=new Set,n=[];for(let t of i){let r=`${t.file}:${t.line}:${t.column}`;e.has(r)||(e.add(r),n.push(t))}return n}function N(i,e){let n=i||process.cwd(),t=xe(n,e);if(t)return t;try{return xe(Ie(n),Ie(e))}catch{return null}}function xe(i,e){let n=Fe.relative(i,e).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function ve(i,e,n,t){let r=Je(e,t);return r.size===0?new Map:Ke(i,n,r)}function Je(i,e){let n=new Map;for(let t of v(i,e)){let r=w(t.symbol)??t.leaf;if(!r)continue;let o=n.get(r);o||(o=[],n.set(r,o)),o.push(t)}return n}function Ke(i,e,n){let t=new Map,r=new Map;return e.forEachDescendant(o=>{for(let s of ze(i,o)){let a=n.get(s);if(!a)continue;let l=q(e,o);for(let f of a){if(l<f.startLine-1||l>f.endLine+1)continue;let c=Math.abs(l-f.startLine),p=r.get(f.symbolId);p!==void 0&&p<=c||(r.set(f.symbolId,c),t.set(f.symbolId,o))}}}),t}function ze(i,e){let n=[],t=r=>{r&&!n.includes(r)&&n.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();t(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();t(r)}return i.Node.isIdentifier(e)&&t(e.getText()),n}function Y(i,e,n){let t=new Map,r=new Set,o=s=>{if(i.isFunctionLike(s)){let a=Ve(i,s),f=a.name?.getText(e)??(i.isConstructorDeclaration(s)?"constructor":void 0),c=e.getLineAndCharacterOfPosition(a.getStart(e)),p=n.filter(d=>!r.has(d.symbolId)&&d.leaf===f&&Ye(d,c));p.length===1&&(t.set(s,p[0]),r.add(p[0].symbolId))}i.forEachChild(s,o)};return o(e),s=>{for(let a=s.parent;a;a=a.parent)if(i.isFunctionLike(a))return t.get(a)}}function Ve(i,e){if(!i.isArrowFunction(e)&&!i.isFunctionExpression(e))return e;let n=e;for(;n.parent&&qe(i,n.parent);)n=n.parent;let t=n.parent;return t&&(i.isVariableDeclaration(t)||i.isPropertyDeclaration(t)||i.isPropertyAssignment(t))&&t.initializer===n?t:e}function qe(i,e){return i.isParenthesizedExpression(e)||i.isAsExpression(e)||i.isSatisfiesExpression(e)}function Ye(i,e){return e.line<i.startLine||e.line>i.endLine||e.line===i.startLine&&e.character<(i.startChar??0)?!1:e.line!==i.endLine||e.character<=(i.endChar??1/0)}var Ge=oe("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(i,e,n,t){let r=Z(i,e),o=G(r.get(t)??[],n);if(o)return o;let s=[];for(let a of r.values())for(let l of a)((l.leaf||w(l.symbol)||"").includes(t)||l.symbol.includes(t))&&s.push(l);return G(s,n)}function X(i,e,n,t){return G(Z(i,e).get(t)??[],n)}function Ne(i,e){let n=new Map;for(let[t,r]of Z(i,e)){let o=r[0];o&&n.set(t,o)}return n}function Z(i,e){return Ge.get(i,e,()=>{let n=new Map;for(let t of v(i,e)){let r=t.leaf||w(t.symbol);if(!r)continue;let o=n.get(r);o||(o=[],n.set(r,o)),o.push({...t,leaf:r})}for(let t of n.values())t.sort((r,o)=>r.startLine-o.startLine||r.endLine-o.endLine||r.symbolId-o.symbolId);return n})}function G(i,e){let n=null,t=Number.POSITIVE_INFINITY;for(let r of i){let o=Math.abs(r.startLine-e);(o<t||o===t&&n&&r.startLine<n.startLine)&&(n=r,t=o)}return n}import Xe from"path";import{realpathSync as Ze}from"fs";function Pe(i,e){let n=new Map,t=new Map,r=null,o=()=>(r??=O(i,{extensions:H}),r),s=f=>I(t,f,()=>x("typescript.source-file-index",()=>{let c=new Map;for(let p of f.project.getSourceFiles())Re(c,p);return{project:f.project,sourceFiles:c}},()=>({tsconfigPath:f.tsconfigPath,indexedDocuments:o().length}))),a=(f,c)=>{let p=s(f),d=p.sourceFiles.get(c)??null;return d||(d=f.project.addSourceFileAtPathIfExists(c)??null,d&&Re(p.sourceFiles,d)),d?{project:p.project,sourceFile:d}:null},l=f=>U(f)?I(n,f,()=>{let c=Qe(i.config.projectRoot,f);if(!c)return null;for(let u of e){if(!u.loaded)continue;let y=s(u).sourceFiles.get(c);if(y)return{project:u.project,sourceFile:y}}let p=e.find(u=>u.fileNames?.has(c));if(p)return a(p,c);for(let u of e){if(!u.loaded)continue;let y=a(u,c);if(y)return y}let d=e[0];return d?a(d,c):null}):null;return{sourceFile:f=>l(f)?.sourceFile??null,sourceFileMatch:l,indexedTypeScriptLikeDocuments:o}}function Re(i,e){let n=Q(e.getFilePath());i.set(n,e);try{i.set(Q(Ze(n)),e)}catch(t){if(!$(t))throw t}}function Qe(i,e){try{return Q(ae(i,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!$(n))throw n;return null}}function Q(i){return Xe.resolve(i)}function ee(i,e){for(let n of i)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function we(i){let e=`${i.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}var et=32;function gn(i,e){let n=x("typescript.provider.load",()=>ue());if(!n)return _("ts-morph is not installed");let t=x("typescript.provider.tsconfig-discovery",()=>be(i));if(t.length===0)return _("no tsconfig found");try{let r=x("typescript.provider.project-bundles",()=>me(n,t),()=>({tsconfigs:t.length}));return tt(i,n,r)}catch(r){return _(r instanceof Error?r.message:String(r),t[0],t)}}function tt(i,e,n,t={}){return x("typescript.provider.construct",()=>new te(i,e,n),()=>({tsconfigs:n.length,reusedProjects:t.reusedProjects===!0}))}var te=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=fe(e.config.projectRoot),this.sourceFiles=Pe(e,t)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){let e=B(this.projects);return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(n=>n.tsconfigPath),projectScope:e?"file-closure":"project",...e?{note:"compiler projects are file-scoped: callees, signatures, and import usage are served per file; references and hierarchies are unavailable"}:{}}}attachBatchFiles(e){if(B(this.projects))for(let n of new Set(e.map(t=>t.relativePath)))this.sourceFiles.sourceFile(n)}assertProjectWide(){if(B(this.projects))throw new Error(ye)}importUsage(e){return I(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=rt();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return I(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e,n={}){this.assertProjectWide();let t=new Map,r=A(),o=[];for(let c of e){let p=this.referencesCache.get(c.symbolId);p?t.set(c.symbolId,p):o.push(c)}if(o.length===0)return t;let s=o,a=n.exact?[]:o.filter(c=>!Le(c));if(a.length>=et){let c=this.referencesForDefinitionsBySymbolScan(a);if(this.cacheScannedReferenceResults(a,c,t),s=o.filter(p=>Le(p)),s.length===0)return t}let l=mt(s),f=[];for(let[c,p]of l){let d=je();x("typescript.references-map.file",()=>{let u=this.definitionNodesForFile(c);for(let y of p){r&&(d.cacheMisses+=1);let g=u.get(y.symbolId)??null;r&&(g?d.nodeHits+=1:d.nodeMisses+=1);try{let b=this.referencesForDefinitionNode(y,g,r?d:void 0);this.referencesCache.set(y.symbolId,b),t.set(y.symbolId,b)}catch{d.preciseSearchFailures+=1,f.push(y)}}},()=>({relativePath:c,definitions:p.length,...Oe(d)}))}if(f.length>0){let c=this.referencesForDefinitionsBySymbolScan(f);this.cacheScannedReferenceResults(f,c,t)}return t}cacheScannedReferenceResults(e,n,t){for(let r of e){let o=n.get(r.symbolId)??[];this.referencesCache.set(r.symbolId,o),t.set(r.symbolId,o)}}referenceFragmentsForFiles(e){this.assertProjectWide();let n=Se(this.db).filter(o=>U(o.relativePath)),t=e.filter(o=>this.sourceFiles.sourceFile(o)!==null),r=this.referencesForDefinitionsBySymbolScan(n,t);return he(n,r,t)}referencesForDefinitionsBySymbolScan(e,n){let t=A(),r=je(),o=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)o.set(c.symbolId,[]);let l=()=>{let c=t?m.now():0,p=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let d of e){let u=p.get(d.symbolId)??[];if(u.length>0){let y=o.get(d.symbolId)??[];y.push(...u),o.set(d.symbolId,y)}t&&(r.packageReferenceCount+=u.length)}t&&(r.packageRefsMs+=m.now()-c)},f=()=>{let c=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(e),u=new Set(e.map(g=>g.leaf).filter(Boolean)),y=t?m.now():0;for(let g of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(g))continue;let b=this.sourceFiles.sourceFile(g);b&&(t&&(r.scanFiles+=1),this.addReferencesFromSourceFileScan(b,g,s,a,d,u,c,p,o,t?r:void 0))}t&&(r.scanMs+=m.now()-y)};return x("typescript.references-map.inverted-scan",()=>{l(),f();let c=t?m.now():0;this.addHierarchyMemberReferences(e,o,t?r:void 0),t&&(r.hierarchyMs+=m.now()-c);for(let[p,d]of o){let u=k(d);o.set(p,u),t&&(r.referenceCount+=u.length)}},()=>({definitions:e.length,...Oe(r)})),o}addReferencesFromSourceFileScan(e,n,t,r,o,s,a,l,f,c){let p=this.compilerCheckerForSourceFile(e),d=e.compilerNode,u=st(e),y=h=>{let M;return a.has(h)?M=a.get(h)??null:(M=this.referenceDefinitionFromCompilerSymbol(h),a.set(h,M)),c&&(M?c.targetHits+=1:c.targetMisses+=1),M},g=h=>{if(c&&(c.identifiers+=1),!s.has(h.text)&&!u.has(h.text))return;let M=this.compilerReferenceSymbol(p,h,c);if(!M)return;let C=y(M),D=I(l,M,()=>this.compilerSymbolKeys(M)),L=null,R=null,P=F=>{if(L??=Ee(d,h),at(F,n,L))return;if(!R){let re=d.getLineAndCharacterOfPosition(h.getStart(d));R={file:n,line:re.line,column:re.character}}let T=f.get(F.symbolId)??[];T.push(R),f.set(F.symbolId,T),c&&(c.requestedHits+=1)},j=gt(C,t,r);j&&P(j);for(let F of D)for(let T of o.get(F)?.values()??[])P(T)},b=h=>{this.tsMorph.ts.isIdentifier(h)&&g(h),this.tsMorph.ts.forEachChild(h,b)};b(d)}hierarchyTargetsMemo=null;hierarchyTargetsForDefinitions(e){let n=pt(e);if(this.hierarchyTargetsMemo?.key===n)return this.hierarchyTargetsMemo.targets;let t=se(this.db),r=`definitions:${n}`,o=!1,s=x("typescript.references-map.hierarchy-targets",()=>{if(t){let l=Ae.read(this.db,r,t);if(l&&l.projectRoot===this.db.config.projectRoot)return o=!0,ft(l,e)}let a=this.computeHierarchyTargets(e);return t&&Ae.write(this.db,r,t,{version:Ue,projectRoot:this.db.config.projectRoot,entries:[...a].map(([l,f])=>[l,[...f.values()].map(c=>c.symbol)])}),a},()=>({definitions:e.length,hit:o}));return this.hierarchyTargetsMemo={key:n,targets:s},s}computeHierarchyTargets(e){let n=new Map;for(let t of e){let r=this.nodeForDefinition(t),o=r?.compilerNode;if(!o||!this.isHierarchyMethod(o))continue;let s=o.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(r.getSourceFile()),l=a.getSymbolAtLocation(o.name);if(l)for(let f of this.hierarchyMemberSymbols(a,s,l))for(let c of this.compilerSymbolKeys(f)){let p=n.get(c)??new Map;p.set(t.symbolId,t),n.set(c,p)}}return n}hierarchyMemberSymbols(e,n,t){let r=new Set,o=new Set,s=(a,l,f)=>{if(!o.has(a)){o.add(a),r.add(l);for(let c of f){let p=c.getProperty(t.name);p&&s(c,p,this.hierarchyAncestorTypesForType(e,c))}}};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}addHierarchyMemberReferences(e,n,t){let r=new Map,o=(l,f,c,p)=>{for(let d of this.hierarchyMemberSymbols(f,c,p))if(d!==p)for(let u of this.compilerSymbolLocations(d))l.push(u),t&&(t.hierarchyReferences+=1)},s=l=>{let f=this.nodeForDefinition(l),c=f?.compilerNode;if(!c||!this.isHierarchyMethod(c))return;let p=c.parent;if(!this.isHierarchyContainer(p))return;let d=this.compilerCheckerForSourceFile(f.getSourceFile()),u=d.getSymbolAtLocation(c.name);if(!u)return;let y=c.getSourceFile(),g=y.getLineAndCharacterOfPosition(c.name.getStart(y)),b={definition:l,location:{file:l.relativePath,line:g.line,column:g.character}},h=n.get(l.symbolId)??[];o(h,d,p,u),n.set(l.symbolId,h);let M=this.hierarchyRootMemberSymbols(d,p,u);for(let C of M){let D=r.get(C)??new Map;D.set(l.symbolId,b),r.set(C,D)}t&&(t.hierarchyDefinitions+=1)},a=l=>{for(let{definition:f}of l.values()){let c=n.get(f.symbolId)??[];for(let p of l.values())p.definition.symbolId!==f.symbolId&&(c.push(p.location),t&&(t.hierarchyReferences+=1));n.set(f.symbolId,c)}};for(let l of e)s(l);for(let l of r.values())l.size<2||(t&&(t.hierarchyFamilies+=1),a(l))}hierarchyRootMemberSymbols(e,n,t){let r=new Set,o=new Set,s=(a,l,f)=>{if(o.has(a))return;o.add(a);let c=!1;for(let p of f){let d=p.getProperty(t.name);d&&(c=!0,s(p,d,this.hierarchyAncestorTypesForType(e,p)))}if(!c)for(let p of this.compilerSymbolKeys(l))r.add(p)};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}compilerSymbolKeys(e){return(e.declarations??[]).map(n=>{let t=n.getSourceFile();return`${t.fileName}\0${n.getStart(t)}\0${e.name}`})}compilerSymbolLocations(e){let n=[];for(let t of e.declarations??[]){let r=t.getSourceFile(),o=N(this.db.config.projectRoot,r.fileName);if(!o)continue;let s=t.name,a=r.getLineAndCharacterOfPosition((s??t).getStart(r));n.push({file:o,line:a.line,column:a.character})}return n}baseTypes(e,n){try{return e.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(e,n){let t=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(n)));for(let r of n.heritageClauses??[])for(let o of r.types)t.add(e.getTypeAtLocation(o));return[...t]}hierarchyAncestorTypesForType(e,n){let t=new Set(this.baseTypes(e,n));for(let r of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(r))for(let o of r.heritageClauses??[])for(let s of o.types)t.add(e.getTypeAtLocation(s));return[...t]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let r=e.getSymbolAtLocation(n);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return I(this.calleesCache,e.symbolId,()=>I(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map;this.attachBatchFiles(e);let t=new Map;for(let r of e){let o=t.get(r.relativePath);o?o.push(r):t.set(r.relativePath,[r])}for(let[r,o]of t){let s=this.fileCalleesCache.get(r),a=new Set(o.map(f=>f.symbolId)),l=s??this.calleeMapForFile(r,a);for(let f of o){let c=l.get(f.symbolId)??[];this.calleesCache.set(f.symbolId,c),n.set(f.symbolId,c)}}return n}calleeCoverageForDefinitions(e){this.attachBatchFiles(e);let n=new Map,t=new Map;for(let r of e){let o=t.get(r.relativePath);o?o.push(r):t.set(r.relativePath,[r]),n.set(r.symbolId,{callSites:0,resolvedInRepository:0,resolvedExternal:0,unresolved:0})}for(let[r,o]of t){let s=this.sourceFiles.sourceFile(r);if(!s)continue;let a=this.compilerCheckerForSourceFile(s),l=s.compilerNode,f=new Map,c=Y(this.tsMorph.ts,l,o),p=d=>{if(this.tsMorph.ts.isCallExpression(d)||this.tsMorph.ts.isNewExpression(d)||He(this.tsMorph.ts,d)){let u=c(d),y=u?n.get(u.symbolId):void 0;y&&this.recordCallSiteCoverage(d,a,y,f)}this.tsMorph.ts.forEachChild(d,p)};p(l)}return n}callNodeExpression(e){return this.tsMorph.ts.isJsxOpeningElement(e)||this.tsMorph.ts.isJsxSelfClosingElement(e)?this.tsMorph.ts.isJsxNamespacedName(e.tagName)?null:e.tagName:e.expression}recordCallSiteCoverage(e,n,t,r){t.callSites+=1;let o=this.callNodeExpression(e),s=o?this.compilerSymbolForExpression(n,o):void 0;if(!s){t.unresolved+=1;return}let a=r.get(s);a===void 0&&(a=this.definitionFromCompilerSymbol(s),r.set(s,a)),a?t.resolvedInRepository+=1:t.resolvedExternal+=1}referencesForDefinitionNode(e,n,t){let r=t?m.now():0,o=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-r,t.packageReferenceCount+=o.length),!n)return o;let s=t?m.now():0,a=De(n,e,o,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return I(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let t=n.getType().getCallSignatures()[0];if(!t)return null;let r=t.getParameters().map(s=>{let a=s.getDeclarations()[0];return(a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown").trim()}),o=t.getReturnType().getText(n);return`(${r.join(",")})=>${o.trim()}`})}importUsageForSourceFile(e,n,t){let r=[],o=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=J(this.db,e,s.getModuleSpecifierValue()),l=s.getImportClause()?.isTypeOnly()??!1;for(let f of ne(s)){let c=yt(a,f,l,t),{bindingSymbol:p}=c;if(r.push(c),l||!f.localName||!p)continue;let d=o.get(f.localName);d?d.push(c):o.set(f.localName,[c])}}return o.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||it(s))return;t.scannedIdentifiers+=1;let l=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!l){for(let f of a)if(f.bindingSymbol===l){f.references.push({location:W(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),r.map(s=>s.typeOnlyDeclaration?nt(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let r=t.identifier?t.identifier.findReferences():[],o=[];for(let s of r)for(let a of Te(s,e,t.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(e,n,t,o)}valueImportUsageFromLocations(e,n,t,r){let o=r.some(l=>!V(l.node)),s=r.some(l=>V(l.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||r.length>0,isTypeUsed:a||s,isValueUsed:o,references:r.map(l=>l.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let n=new Map,t=new Set;for(let o of e){let s=this.sourceFiles.sourceFile(o);if(s)for(let a of s.getImportDeclarations()){let l=ee(this.workspacePackages,a.getModuleSpecifierValue());l&&t.add(l)}}if(t.size===0)return n;let r=this.packageExportsForNames(t);for(let o of e)this.addPackageImportReferencesForDocument(n,r,o);for(let[o,s]of n)n.set(o,k(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,r]of e)e.set(t,k(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let r=this.sourceFiles.sourceFileMatch(t);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,o)}addPackageImportReferencesForDeclaration(e,n,t,r){let o=ee(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let s=n.get(o);if(s)for(let a of ne(r)){if(a.kind!=="named"||!a.identifier)continue;let l=s.get(a.importedName);if(!l||l.size===0)continue;let f=Ce(a.identifier,t,this.db.config.projectRoot);f.length>0&&dt(e,l,f)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let n=new Map;for(let t of this.workspacePackages){if(!e.has(t.name))continue;let r=new Map;for(let o of we(t))this.collectPackageExports(t,o,r,new Set);r.size>0&&n.set(t.name,r)}return n}collectPackageExports(e,n,t,r){if(r.has(n))return;r.add(n);let o=this.sourceFiles.sourceFile(n);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),l=a?J(this.db,n,a):n;if(!l||!l.startsWith(`${e.relativeDir}/src/`))continue;let f=s.getNamedExports();if(f.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,l,t,r);continue}ht(f,t,c=>this.indexedDefinitionByLeaf(l,c))}}indexedDefinitionByLeaf(e,n){return I(this.indexedDefinitionLeafCache,e,()=>Ne(this.db,e)).get(n)??null}nodeForDefinition(e){return I(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return I(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?ve(this.tsMorph,this.db,n,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,n,t=!1){let r=e.name,o=n?m.now():0,s=e.declarations??[];n&&(n.declarationsMs+=m.now()-o,n.declarationChecks+=s.length);for(let a of s){let l=n?m.now():0,f=a.getSourceFile(),c=N(this.db.config.projectRoot,f.fileName),p=f.getLineAndCharacterOfPosition(a.getStart(f)).line;if(n&&(n.declarationLocationMs+=m.now()-l),!c||this.db.isIgnored(c))continue;let d=this.indexedMatchForCompilerDeclaration(a,c,p,r,n,t);if(d)return{symbolId:d.symbolId,symbol:d.symbol,file:d.relativePath,line:d.startLine}}return null}indexedMatchForCompilerDeclaration(e,n,t,r,o,s){let a=o?m.now():0,l=this.compilerDeclarationName(e),f=s?X(this.db,n,t,r)??(l&&l!==r?X(this.db,n,t,l):null):ke(this.db,n,t,r);return o&&(o.indexedLookupMs+=m.now()-a),f}compilerDeclarationName(e){let n=e.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(e,n){let t=A(),r=0,o=0,s=0,a=0,l=0,f=0,c=0,p=0,d=t?ct():void 0;return x("typescript.callee-map.file",()=>{let u=t?m.now():0,y=this.sourceFiles.sourceFile(e);if(t&&(l=Math.round(m.now()-u)),!y)return new Map;let g=bt(this.db,e,t),b=g.definitions;if(t&&(f=g.durationMs),r=b.length,b.length===0)return new Map;let h=new Map,M=t?m.now():0,C=this.compilerCheckerForSourceFile(y),D=y.compilerNode,L=Y(this.tsMorph.ts,D,b);t&&(c=Math.round(m.now()-M));let R=new Map,P=F=>{if(this.tsMorph.ts.isCallExpression(F)||this.tsMorph.ts.isNewExpression(F)||He(this.tsMorph.ts,F)){t&&(o+=1);let T=this.semanticCalleeForCallNode(C,D,L,F,R,n,d);T&&(t&&(s+=1),ot(h,T.callerId,T.target))}this.tsMorph.ts.forEachChild(F,P)},j=t?m.now():0;return P(D),t&&(p=Math.round(m.now()-j)),Mt(h),a=h.size,h},()=>({relativePath:e,definitions:r,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??r,sourceFileLookupMs:l,definitionsLoadMs:f,checkerLookupMs:c,traversalMs:p,...d?lt(d):{}}))}semanticCalleeForCallNode(e,n,t,r,o,s,a){let l=this.requestedCallSiteOwner(t,r,s,a);if(!l)return null;let f=this.tsMorph.ts.isJsxOpeningElement(r)||this.tsMorph.ts.isJsxSelfClosingElement(r);if(f&&this.tsMorph.ts.isJsxNamespacedName(r.tagName))return null;let c=f?r.tagName:r.expression,p=this.compilerSymbolForExpression(e,c,a),d=this.profiledCalleeTarget(p,o,a);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:Ee(n,r),...f?{kind:"jsx-render"}:{}}}:null}requestedCallSiteOwner(e,n,t,r){let o=r?m.now():0,s=e(n);return r&&(r.callerLookupMs+=m.now()-o),s?t&&!t.has(s.symbolId)?(r&&(r.skippedUnrequestedCallers+=1),null):s:null}profiledCalleeTarget(e,n,t){if(!e)return t&&(t.targetMisses+=1),null;if(t&&(t.targetSymbolHits+=1),n.has(e))return t&&(t.compilerSymbolCacheHits+=1),n.get(e)??null;t&&(t.compilerSymbolCacheMisses+=1);let r=t?m.now():0,o=this.definitionFromCompilerSymbol(e,t);return t&&(t.targetLookupMs+=m.now()-r),n.set(e,o),o}compilerSymbolForExpression(e,n,t){let r=t?m.now():0,o=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-r),o){if((o.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return o;try{return e.getAliasedSymbol(o)}catch{return o}}t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){return e.getProject().getTypeChecker().compilerObject}};function ne(i){let e=[],n=i.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let t=i.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports())e.push(St(r,i));return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function nt(i,e,n){return{importer:i,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function rt(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function it(i){for(let e=i;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function ot(i,e,n){let t=i.get(e);t||(t=[],i.set(e,t)),t.push(n)}function st(i){let e=new Set;for(let n of i.getImportDeclarations())for(let t of ne(n))t.localName&&e.add(t.localName);return e}function Ee(i,e){return i.getLineAndCharacterOfPosition(e.getStart(i)).line}function at(i,e,n){return e===i.relativePath&&n>=i.startLine&&n<=i.endLine}function Le(i){return i.symbol.includes("#")?ge(i.symbol)==="type"&&i.relativePath.endsWith(".d.ts"):!1}function ct(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function lt(i){return{...i,callerLookupMs:Math.round(i.callerLookupMs),expressionSymbolMs:Math.round(i.expressionSymbolMs),typeSymbolMs:Math.round(i.typeSymbolMs),targetLookupMs:Math.round(i.targetLookupMs),declarationsMs:Math.round(i.declarationsMs),declarationLocationMs:Math.round(i.declarationLocationMs),indexedLookupMs:Math.round(i.indexedLookupMs)}}function je(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}var Ue=1,Ae=ce({kind:"typescript-hierarchy-targets",invalidation:le("typescript-hierarchy-targets"),serialize:i=>JSON.stringify(i),deserialize:i=>{try{let e=JSON.parse(i);return e.version!==Ue||typeof e.projectRoot!="string"||!Array.isArray(e.entries)?null:e}catch{return null}}});function ft(i,e){let n=new Map(e.map(r=>[r.symbol,r])),t=new Map;for(let[r,o]of i.entries){let s=new Map;for(let a of o){let l=n.get(a);l&&s.set(l.symbolId,l)}s.size>0&&t.set(r,s)}return t}function pt(i){let e=2166136261;for(let n of i)e^=n.symbolId,e=Math.imul(e,16777619)>>>0;return`${i.length}:${e.toString(16)}`}function Oe(i){return{...i,scanMs:Math.round(i.scanMs),packageRefsMs:Math.round(i.packageRefsMs),semanticRefsMs:Math.round(i.semanticRefsMs),hierarchyMs:Math.round(i.hierarchyMs)}}function dt(i,e,n){for(let t of e){let r=i.get(t)??[];r.push(...n),i.set(t,r)}}function He(i,e){if(!i.isJsxOpeningElement(e)&&!i.isJsxSelfClosingElement(e))return!1;let n=e.tagName;return i.isPropertyAccessExpression(n)?!0:i.isIdentifier(n)?/^[A-Z]/.test(n.text):!1}function ut(i){let e=new Set,n=[];for(let t of i){let r=`${t.symbol}|${t.file}|${t.line}|${t.callsiteLine??""}`;e.has(r)||(e.add(r),n.push(t))}return n}function mt(i){let e=new Map;for(let n of i){let t=e.get(n.relativePath);t?t.push(n):e.set(n.relativePath,[n])}return e}function yt(i,e,n,t){t.entries+=1;let r=n?null:e.identifier?.getSymbol()?.compilerSymbol??null;return!n&&e.identifier&&(r?t.bindingSymbols+=1:t.missingBindingSymbols+=1),{sourcePath:i,entry:e,typeOnlyDeclaration:n,bindingSymbol:r,references:[]}}function ht(i,e,n){for(let t of i){let r=t.getNameNode().getText(),o=t.getAliasNode()?.getText()??r,s=n(r);if(!s)continue;let a=e.get(o);a||(a=new Set,e.set(o,a)),a.add(s.symbolId)}}function gt(i,e,n){return i&&e.has(i.symbolId)?n.get(i.symbolId):void 0}function St(i,e){let n=i.getNameNode(),r=i.getAliasNode()??(n.getKindName()==="Identifier"?n:null);return{identifier:r,importedName:n.getText(),localName:r?.getText()??n.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(e.getImportClause()?.isTypeOnly()??!1)}}function bt(i,e,n){let t=n?m.now():0,r=v(i,e).sort((s,a)=>s.startLine-a.startLine||a.endLine-s.endLine),o=n?Math.round(m.now()-t):0;return{definitions:r,durationMs:o}}function Mt(i){for(let[e,n]of i)i.set(e,ut(n))}export{be as a,gn as b,tt as c};
3
+ //# sourceMappingURL=chunk-4XQ4O6IM.js.map
@@ -0,0 +1,4 @@
1
+ import{a as h}from"./chunk-VTY3VK6E.js";import{b as y}from"./chunk-MOQQBQRD.js";import{a as S}from"./chunk-36SGVCGX.js";import{q as b}from"./chunk-NZAXKGRL.js";import{b as v}from"./chunk-YNQCGEQE.js";import{b as g}from"./chunk-FMRN2TRL.js";import{d as u,e as d,j as m,s as f,t as p}from"./chunk-5D2LVK7O.js";function I(e,t,i={}){let o=x(e,t,i);return{definitions:o.definitions,referencedBy:o.referencedBy}}function x(e,t,i={}){let o=g(e,t);if(o.total>1)throw new Error(`Ambiguous symbol: ${t}. Use an exact symbol.`);let n=o.match;if(!n)return{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null};let a=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),l=p(a?.documentation??null),E=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:w(l,a?.display_name??null,n.symbol),source:B(e,n.relativePath,n.startLine,n.endLine)}],T=i.referenceContext??2,s=b(e,n,{semantic:i.semantic,semanticEvidence:S}).map(r=>{let c=y(e,r.file,r.line,T,d(n.symbol));return{relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?u(r.enclosingSymbol):"(top-level)",provenance:r.provenance,sourceStartLine:c?.startLine??null,sourceEndLine:c?.endLine??null,source:c?.source??null,sourceKind:c?.kind??"unavailable"}}),R=s.map(L);return{definitions:E,referencedBy:R,referenceEvidence:s.map(r=>({relativePath:r.relativePath,line:r.line,provenance:r.provenance,sourceKind:r.sourceKind})),claimSupport:P(s)}}function L(e){return{relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort,sourceStartLine:e.sourceStartLine,sourceEndLine:e.sourceEndLine,source:e.source}}function P(e){return{referenceAbsence:{status:"ineligible",scope:"observed reference sites",reason:"This source bundle does not establish complete compiler-binding or freshness coverage.",followup:null},callsitePredicates:{status:"ineligible",scope:"source windows around observed references",reason:"Line and name matching does not establish the referenced callee binding for every invocation.",followup:C(e)}}}function C(e){let t=[...new Set(e.map(i=>`${i.relativePath}:${i.line+1}`))];return t.length===0||t.length>24?null:`scip-query inspect ${t.map(i=>`--at ${h(i)}`).join(" ")} --view behavior`}function B(e,t,i,o){let n=v(e,t);if(!n||n.freshness.semantic.state==="stale")return null;let l=n.text.split(`
2
+ `).slice(i,o+1).join(`
3
+ `);return l.length>0?l:null}function w(e,t,i){let o=f(e);if(o&&!A(o))return o;let n=(t??"").trim();return n?m(i)&&!n.endsWith("()")?`${n}()`:n:u(i)}function A(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{I as a,x as b};
4
+ //# sourceMappingURL=chunk-55UQAMZO.js.map
@@ -0,0 +1,125 @@
1
+ import{a as k,h as J,k as W,l as z,r as H,s as G}from"./chunk-7WTPQ4NX.js";import{A as j,O as S,a as y}from"./chunk-FVULPZDF.js";import{e as E,g as $,i as P}from"./chunk-D3FDISIC.js";import{a as Q,d as B}from"./chunk-A2IIGFMJ.js";import{d as F}from"./chunk-PH52RA7D.js";import{d as R,e as L}from"./chunk-GVWX5T43.js";import{Ba as _,Ca as I,Da as A}from"./chunk-5TNQJUR2.js";var fe={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function d(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),o;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(o=r.slice(1),r=""):(o=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(o=r,r=""):(o=r.slice(0,l),r=r.slice(l+1))}let s,a=r.indexOf(" ");a===-1?(s=r,r=""):(s=r.slice(0,a),r=r.slice(a+1));let c=me(r);return{scheme:t,manager:i,packageName:o,version:s,descriptors:c,raw:e}}function f(e){let n=d(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function me(e){let n=[],t=0;for(;t<e.length;){let i=pe(e,t,n.length===0)??ge(e,t);i.descriptor&&n.push(i.descriptor),t=i.next}return n}function pe(e,n,t){if(e[n]==="["){let r=e.indexOf("]",n+1);return{descriptor:{name:e.slice(n+1,r===-1?void 0:r),suffix:"type-param"},next:r===-1?e.length:r+1}}if(e[n]!=="("||!(t||n===0||q(e[n-1])))return;let i=e.indexOf(")",n+1);if(!(i===-1||e[i+1]==="."))return{descriptor:{name:e.slice(n+1,i),suffix:"parameter"},next:i+1}}function ge(e,n){if(e[n]==="`"){let i=e.indexOf("`",n+1);return i===-1?{descriptor:{name:e.slice(n+1),suffix:"term"},next:e.length}:U(e,e.slice(n+1,i),i+1)}let t=n;for(;n<e.length&&!q(e[n]);)n++;return U(e,e.slice(t,n),n)}function U(e,n,t){if(t>=e.length)return{descriptor:n?{name:n,suffix:"term"}:void 0,next:t};if(e[t]==="("){let r=e.indexOf(")",t+1);return r===-1?{descriptor:{name:n,suffix:"term"},next:t+1}:{descriptor:{name:n,suffix:"method"},next:r+(e[r+1]==="."?2:1)}}let i=fe[e[t]];return{descriptor:i?{name:n,suffix:i}:void 0,next:t+1}}function q(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function Y(e){let n=d(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let o=be(r);o&&i.push(o)}return i.join(":")}function be(e){let n=e.suffix==="namespace"?ye(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function ye(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function K(e){let n=d(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function gn(e){let n=d(e);if("kind"in n&&n.kind==="local")return n.id;let t=n.descriptors,i=t[t.length-1];if(!i)return"";let r=t[t.length-2];return r&&r.suffix==="type"?`${r.name} ${i.name}`:i.name}function bn(e){let n=d(e);if("kind"in n&&n.kind==="local")return null;let t=n.descriptors,i=t[t.length-2];return i&&i.suffix==="type"?i.name:null}function p(e){let n=d(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function yn(e){return e.endsWith("().")||p(e)==="method"}function N(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function Sn(e){return p(e)==="namespace"}var Se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function hn(e){return Se.test(e)}var he=new Set(["test","tests","_tests"]);function Dn(e){let n=d(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&he.has(i.name))return!0}return!1}function xn(e,n){let t=d(e),i=d(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,o=i.descriptors;if(o.length!==r.length+1)return!1;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function _n(e,n){let t=d(e),i=d(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,o=i.descriptors;if(o.length<=r.length)return!1;for(let s=0;s<r.length;s++){let a=r[s],c=o[s];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}import{fromBinary as Z}from"@bufbuild/protobuf";import{DocumentSchema as V,SymbolRole as ee}from"@c4312/scip";import{zstdDecompressSync as ne}from"zlib";var De=_("definition-occurrence-ranges",{clearGroups:["whole-project","definition-catalog"],maxEntries:64});function xe(e,n){return De.get(e,n,()=>{let t=new Map;for(let i of e.all("SELECT c.occurrences FROM chunks c JOIN documents d ON d.id = c.document_id WHERE d.relative_path = ? ORDER BY c.chunk_index",n))for(let[r,o]of _e(i.occurrences))t.has(r)||t.set(r,o);return t})}function _e(e){let n=new Map;if(!e||e.length<=1)return n;try{for(let t of Z(V,ne(e)).occurrences){let i=Ie(t);i&&t.symbol&&!n.has(t.symbol)&&n.set(t.symbol,i)}}catch{}return n}function Ie(e){let n=e.range;if(!(!(e.symbolRoles&ee.Definition)||n.length<3))return{start_line:n[0],start_char:n[1],end_line:n.length===4?n[2]:n[0],end_char:n.length===4?n[3]:n[2]}}function kn(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
+ JOIN documents d ON der.document_id = d.id
5
+ WHERE ${n.where}
6
+ ${e.pathExclusionsFor("d")}
7
+ ${te(n.orderBy)}
8
+ ${ie(n.limit)}`,...n.params??[])}function Nn(e,n){return e.all(`SELECT
9
+ gs.id,
10
+ gs.symbol,
11
+ c.document_id,
12
+ MIN(c.start_line) AS start_line,
13
+ 0 AS start_char,
14
+ MAX(c.end_line) AS end_line,
15
+ 0 AS end_char,
16
+ d.relative_path,
17
+ gs.display_name,
18
+ gs.documentation
19
+ FROM global_symbols gs
20
+ JOIN mentions m ON m.symbol_id = gs.id
21
+ JOIN chunks c ON m.chunk_id = c.id
22
+ JOIN documents d ON c.document_id = d.id
23
+ WHERE m.role = 1
24
+ AND ${n.where}
25
+ ${e.pathExclusionsFor("d")}
26
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
27
+ ${te(n.orderBy)}
28
+ ${ie(n.limit)}`,...n.params??[]).map(t=>({...t,...xe(e,t.relative_path).get(t.symbol)}))}function te(e){return e?`ORDER BY ${e}`:""}function ie(e){return typeof e=="number"?`LIMIT ${e}`:""}function re(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function oe(e){if(!e)return null;let n=X(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(X(i)??i).replace(/\n/g," ")}function X(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}var Re=_("reference-occurrence-lines",{clearGroups:["whole-project","source-file"],maxEntries:64});function On(e,n,t){let i=Re.get(e,n,()=>{let r=e.all("SELECT c.occurrences FROM chunks c JOIN documents d ON d.id = c.document_id WHERE d.relative_path = ? ORDER BY c.chunk_index",n);if(r.length===0)return null;let o=new Map;try{for(let s of r){if(!s.occurrences||s.occurrences.length<=1)return null;let{occurrences:a}=Z(V,ne(s.occurrences));Le(a,o)}}catch{return null}return new Map([...o].map(([s,a])=>[s,[...a].sort((c,l)=>c-l)]))});return i===null?null:i.get(t)??[]}function Le(e,n){for(let t of e){if(!t.symbol||(t.symbolRoles&ee.Definition)!==0)continue;let i=t.range[0];if(i===void 0||!Number.isSafeInteger(i)||i<0)continue;let r=n.get(t.symbol)??new Set;r.add(i),n.set(t.symbol,r)}}function h(e){return{forFile(n,t){return se(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,se(e,r,t));return i}}}function se(e,n,t){let i={file:n},r=t.facts||t.identifiers;return t.text&&(i.text=Q(e,n)),t.lines&&(i.lines=B(e,n)),t.ast&&(i.ast=S(e,n)),t.imports&&(i.imports=G(e,n)),t.reexports&&(i.reexports=H(e,n)),r&&Ee(e,n,t,i),i}function Ee(e,n,t,i){let r=J(e,n),o=r.facts;t.facts&&(i.facts=o),r.unavailable&&(i.sourceFactsUnavailable=r.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}function Fe(e,n={}){if(f(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function O(e,n,t={}){let i=new Map;for(let o of n)e.length>0&&!Fe(o,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(o.id,o);for(let o of e)i.set(o.id,o);let r=[...i.values()];return t.sort?r.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):r}function Xn(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}var ke=I("file-definitions",{clearGroups:["definition-catalog"]}),Ne=A("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),Oe=I("file-function-like-definitions",{clearGroups:["definition-catalog"]}),ae=new WeakMap;function D(e,n,t={},i){return F(n),t.includeClassMemberFallbacks?C(e,n,void 0,{includeClassMemberFallbacks:!0},i):ke.get(e,n,()=>{let r=u(i,"evidence-read",()=>de(e,n));if(r)return r;let o=C(e,n,void 0,t,i);return u(i,"evidence-write",()=>{let s=L(e),a=h(e).forFile(n,{text:!0}).text;s&&a&&le.write(e,n,R(e,n,a),{projectFingerprint:s,definitions:o.map(c=>({...c}))})}),o})}function Me(e,n){return F(n),Oe.get(e,n,()=>{let t=de(e,n);return t?t.filter(i=>i.isFunctionLike):C(e,n,i=>i.isFunctionLike)})}var le=$({kind:"file-definitions",invalidation:P("file-definitions"),serialize:Ce,deserialize:we});function de(e,n){let t=L(e);if(!t)return null;let i=h(e).forFile(n,{text:!0}).text;if(!i)return null;let r=le.read(e,n,R(e,n,i));return r?Te(r,t,n):null}function Ce(e){return JSON.stringify(e)}function we(e){try{let n=JSON.parse(e);return!E(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function Te(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let o=ve(r,t);if(!o)return null;i.push(o)}return i}function ve(e,n){return!E(e)||!Ae(e)||!$e(e,n)||!Pe(e)||!Qe(e)?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function Ae(e){return typeof e.symbolId=="number"&&typeof e.symbol=="string"&&typeof e.documentId=="number"}function $e(e,n){return typeof e.startLine=="number"&&(typeof e.startChar=="number"||e.startChar===void 0)&&typeof e.endLine=="number"&&(typeof e.endChar=="number"||e.endChar===void 0)&&e.relativePath===n}function Pe(e){return typeof e.leaf=="string"&&(typeof e.parentTypeName=="string"||e.parentTypeName===null)&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(typeof e.kind=="number"||e.kind===null)}function Qe(e){return(typeof e.documentation=="string"||e.documentation===null)&&(typeof e.enclosingSymbol=="string"||e.enclosingSymbol===null)}function C(e,n,t,i={},r){let o=u(r,"primary-rows",()=>Be(e,n)),s=u(r,"fallback-rows",()=>je(e,n)),a=u(r,"merge-rows",()=>O(o,s,{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(w));return t&&(a=a.filter(t)),u(r,"range-correction",()=>T(e,n,a,r,i.rangeCorrectionEvidence))}function u(e,n,t){return e?e(n,t):t()}function Be(e,n){return e.all(`SELECT
29
+ gs.id,
30
+ gs.symbol,
31
+ der.document_id,
32
+ der.start_line,
33
+ der.start_char,
34
+ der.end_line,
35
+ der.end_char,
36
+ d.relative_path,
37
+ gs.display_name,
38
+ gs.kind,
39
+ gs.documentation,
40
+ gs.enclosing_symbol
41
+ FROM global_symbols gs
42
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
43
+ JOIN documents d ON der.document_id = d.id
44
+ WHERE d.relative_path = ?
45
+ ${e.symbolNoiseFor("gs")}
46
+ ORDER BY der.start_line, der.end_line`,n)}function je(e,n){return e.all(`SELECT
47
+ gs.id,
48
+ gs.symbol,
49
+ c.document_id,
50
+ MIN(c.start_line) AS start_line,
51
+ 0 AS start_char,
52
+ MAX(c.end_line) AS end_line,
53
+ 0 AS end_char,
54
+ d.relative_path,
55
+ gs.display_name,
56
+ gs.kind,
57
+ gs.documentation,
58
+ gs.enclosing_symbol
59
+ FROM global_symbols gs
60
+ JOIN mentions m ON m.symbol_id = gs.id
61
+ JOIN chunks c ON m.chunk_id = c.id
62
+ JOIN documents d ON c.document_id = d.id
63
+ WHERE d.relative_path = ?
64
+ AND m.role = 1
65
+ ${e.symbolNoiseFor("gs")}
66
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
67
+ ORDER BY start_line, end_line`,n)}function w(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:K(e.symbol),parentTypeName:f(e.symbol),isFunctionLike:N(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Zn(e,n={}){return We(e,n.scope)}function Vn(e,n){let t=new Set(n);if(t.size===0)return[];let i=Je(e,[...t]);return y(e,{includeIgnored:!1}).filter(r=>i.has(r)).flatMap(r=>D(e,r)).filter(r=>t.has(r.symbol))}function Je(e,n){let t=new Set;for(let i=0;i<n.length;i+=400){let r=n.slice(i,i+400),o=e.all(`WITH requested AS (SELECT id FROM global_symbols WHERE symbol IN (${r.map(()=>"?").join(",")}))
68
+ SELECT d.relative_path FROM requested r
69
+ JOIN defn_enclosing_ranges der ON der.symbol_id = r.id
70
+ JOIN documents d ON d.id = der.document_id
71
+ UNION
72
+ SELECT d.relative_path FROM requested r
73
+ JOIN mentions m ON m.symbol_id = r.id AND m.role = 1
74
+ JOIN chunks c ON c.id = m.chunk_id
75
+ JOIN documents d ON d.id = c.document_id`,...r);for(let s of o)t.add(s.relative_path)}return t}function We(e,n){return y(e,{scope:n,includeIgnored:!1}).flatMap(t=>D(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function et(e,n){return y(e,{scope:n,includeIgnored:!1}).flatMap(t=>Me(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function nt(e,n){let t=Ne.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),o=i.get(r);if(o)return[...o];let s=ce(ze(e,n.scope,n.sqlPrefilter)),a=ce(He(e,n.scope,n.sqlPrefilter)),c=new Set([...s.keys(),...a.keys()]),l=[];for(let m of[...c].sort()){if(e.isIgnored(m))continue;let g=O(s.get(m)??[],a.get(m)??[],{sort:!0}).filter(b=>n.symbolMatches(b.symbol));g.length!==0&&l.push(...T(e,m,g.map(w)))}return i.set(r,l),[...l]}function ze(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ue("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
76
+ gs.id,
77
+ gs.symbol,
78
+ der.document_id,
79
+ der.start_line,
80
+ der.start_char,
81
+ der.end_line,
82
+ der.end_char,
83
+ d.relative_path,
84
+ gs.display_name,
85
+ gs.kind,
86
+ gs.documentation,
87
+ gs.enclosing_symbol
88
+ FROM global_symbols gs
89
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
90
+ JOIN documents d ON der.document_id = d.id
91
+ WHERE 1 = 1
92
+ ${e.pathExclusionsFor("d")}
93
+ ${i}
94
+ ${r}
95
+ ${e.symbolNoiseFor("gs")}
96
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function He(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${ue("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
97
+ gs.id,
98
+ gs.symbol,
99
+ c.document_id,
100
+ MIN(c.start_line) AS start_line,
101
+ 0 AS start_char,
102
+ MAX(c.end_line) AS end_line,
103
+ 0 AS end_char,
104
+ d.relative_path,
105
+ gs.display_name,
106
+ gs.kind,
107
+ gs.documentation,
108
+ gs.enclosing_symbol
109
+ FROM global_symbols gs
110
+ JOIN mentions m ON m.symbol_id = gs.id
111
+ JOIN chunks c ON m.chunk_id = c.id
112
+ JOIN documents d ON c.document_id = d.id
113
+ WHERE m.role = 1
114
+ AND NOT EXISTS (
115
+ SELECT 1
116
+ FROM defn_enclosing_ranges existing_der
117
+ WHERE existing_der.symbol_id = gs.id
118
+ )
119
+ ${e.pathExclusionsFor("d")}
120
+ ${i}
121
+ ${r}
122
+ ${e.symbolNoiseFor("gs")}
123
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
124
+ ORDER BY d.relative_path, start_line, end_line`,...o)}function Ge(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function ue(e,n){return n==="callable"?Ge(e):Ue(e)}function Ue(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function ce(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function tt(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>D(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,o)=>r.relativePath.localeCompare(o.relativePath)||r.startLine-o.startLine||r.endLine-o.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:Y(r.symbol),signature:re(oe(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function qe(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function it(e,n){let t=ae.get(e);return t||(t=qe(e),ae.set(e,t)),t.get(n)??null}function rt(e,n){let t=D(e,n.relative_path).find(i=>i.symbolId===n.id)??(f(n.symbol)===null||!N(n.symbol)?void 0:T(e,n.relative_path,[w(n)])[0]);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function T(e,n,t,i,r){let o=u(i,"range-correction.source-text",()=>r?r.source:h(e).forFile(n,{text:!0}).text),s=u(i,"range-correction.callable-sites",()=>r?r.callables:Ye(e,n));return s?u(i,"range-correction.ast-correction",()=>nn(t,s,o)):o?u(i,"range-correction.regex-fallback",()=>Ke(t,o)):t}function Ye(e,n){let t=j(n),i=t&&S(e,n)?.rootNode;return(t&&i&&z(i,t))??W(e,n)}function Ke(e,n){let t=n.split(/\r?\n/),i=Xe(e,t),r=Ze(e,i),o=Ve(r,t);return en(e,o)}function Xe(e,n){let t=e.some(r=>x(r.symbol))?dn(n):null,i=new Map;for(let r of e)i.set(r.symbolId,ln(n,t,r));return i}function Ze(e,n){return e.filter(t=>x(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ve(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],o=e[i+1],s=o?Math.max(r.startLine,o.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:un(n,r.definition,r.startLine,s)})}return t}function en(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function nn(e,n,t=null){let i,r=s=>cn(s,t?i??=t.split(/\r?\n/):null),o=new Map;for(let s of n){let a=o.get(s.name);a?a.push(s):o.set(s.name,[s])}return e.map(s=>{if(!an(s)||!s.leaf)return r(s);let a=o.get(s.leaf);if(!a||a.length===0)return r(s);let c=t?tn(s,a,t):null;if(c)return{...s,startLine:c.startLine,endLine:c.endLine};let l=a[0],m=Math.abs(l.startLine-s.startLine);for(let g=1;g<a.length;g+=1){let b=a[g],v=Math.abs(b.startLine-s.startLine);v<m&&(l=b,m=v)}return{...s,startLine:l.startLine,endLine:l.endLine}})}function tn(e,n,t){let i=rn(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),o=new RegExp(`\\b${k(i)}\\b`);for(let s of n){let a=on(r,s.startLine);if(a&&o.test(a))return s}return null}function rn(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function on(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return sn(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function sn(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let o=e[r]??"";if(i.push(o),o.includes("{"))break}return i.join(" ")}function an(e){return x(e.symbol)?!0:p(e.symbol)==="term"&&f(e.symbol)===null}function cn(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||f(e.symbol)!==null)return e;let t=k(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),r=n.findIndex(o=>i.test(o));return r>=0?{...e,startLine:r,endLine:r}:e}function ln(e,n,t){if(!x(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let o=null;for(let s of r){let a=Math.abs(s-t.startLine);(!o||a<o.distance)&&(o={line:s,distance:a})}return o?.line??i}function dn(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(a,c)=>{let l=o.get(a);if(!l){o.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";M(c,n,a,s),M(c,t,a,s);let l=c.match(i);l?.[1]&&s(l[1],a),M(c,r,a,s)}return o}function un(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),o=Math.max(t,Math.min(r,n.endLine)),s={braceDepth:0,parenDepth:0,sawOpeningBrace:!1};for(let a=t;a<=r;a+=1){let c=fn(e[a]??"");if(mn(c,s),s.sawOpeningBrace&&s.braceDepth===0||!s.sawOpeningBrace&&s.parenDepth===0&&a>=o)return a}return o}function fn(e){let n="",t={quote:null,escaping:!1};for(let i=0;i<e.length;i+=1){let r=e[i],o=e[i+1];if(!t.quote&&r==="/"&&o==="/"){n+=" ".repeat(e.length-i);break}if(t.quote){pn(t,r),n+=" ";continue}if(r==='"'||r==="'"||r==="`"){t.quote=r,n+=" ";continue}n+=r}return n}function x(e){return e.includes("().")}function ot(e){let n=d(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}function M(e,n,t,i){for(let r of e.matchAll(n))r[1]&&i(r[1],t)}function mn(e,n){for(let t of e)t==="{"?(n.braceDepth+=1,n.sawOpeningBrace=!0):t==="}"?n.braceDepth=Math.max(0,n.braceDepth-1):t==="("?n.parenDepth+=1:t===")"&&(n.parenDepth=Math.max(0,n.parenDepth-1))}function pn(e,n){if(e.escaping){e.escaping=!1;return}if(n==="\\"){e.escaping=!0;return}n===e.quote&&(e.quote=null)}export{h as a,d as b,f as c,Y as d,K as e,gn as f,bn as g,p as h,yn as i,N as j,Sn as k,hn as l,Dn as m,xn as n,_n as o,xe as p,kn as q,Nn as r,re as s,oe as t,On as u,O as v,Xn as w,D as x,Zn as y,Vn as z,We as A,et as B,nt as C,tt as D,qe as E,it as F,rt as G,ot as H};
125
+ //# sourceMappingURL=chunk-5D2LVK7O.js.map