scip-query 0.19.6 → 0.19.10

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 (377) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/README.md +156 -44
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/chunk-26QA6FAI.js +8 -0
  5. package/dist/{chunk-J7VT2CRB.js → chunk-2HPVVXM5.js} +2 -2
  6. package/dist/chunk-2KAZEZ6M.js +2 -0
  7. package/dist/chunk-32LVLCLN.js +40 -0
  8. package/dist/{chunk-2CVXCGL4.js → chunk-3CLX5EOX.js} +2 -2
  9. package/dist/{chunk-5OC3HWP5.js → chunk-3G66UZBH.js} +2 -2
  10. package/dist/{chunk-S2GP3CU3.js → chunk-3ORVDL3H.js} +2 -2
  11. package/dist/chunk-46XGSFNI.js +2 -0
  12. package/dist/chunk-4MAK2HOY.js +6 -0
  13. package/dist/chunk-4TURLRL5.js +16 -0
  14. package/dist/chunk-4UQVNCQE.js +2 -0
  15. package/dist/chunk-55Q3WLZX.js +2 -0
  16. package/dist/{chunk-OQ2A4G2G.js → chunk-5E4WNAVD.js} +2 -2
  17. package/dist/{chunk-YGQN3XGZ.js → chunk-5I5G2QOX.js} +2 -2
  18. package/dist/chunk-6LDJQXAH.js +2 -0
  19. package/dist/{chunk-WXAAURU7.js → chunk-6O5TICIZ.js} +2 -2
  20. package/dist/{chunk-OBKDTVZ3.js → chunk-6SHPK5ZE.js} +2 -2
  21. package/dist/chunk-7BAVHKMJ.js +49 -0
  22. package/dist/chunk-7O5IKBTZ.js +16 -0
  23. package/dist/chunk-7PIO7NKH.js +60 -0
  24. package/dist/chunk-7S5E7KWT.js +2 -0
  25. package/dist/{chunk-GK3GRUJX.js → chunk-7SQQWSY3.js} +2 -2
  26. package/dist/chunk-7WPLAODU.js +5 -0
  27. package/dist/chunk-A73XVBCR.js +20 -0
  28. package/dist/chunk-AFHORGLH.js +42 -0
  29. package/dist/chunk-AIE7TFJW.js +9 -0
  30. package/dist/chunk-AQOFWNQJ.js +1 -0
  31. package/dist/{chunk-MGBJHRFB.js → chunk-AZJQQKDD.js} +2 -2
  32. package/dist/{chunk-IYAOX36F.js → chunk-B2PX5I6M.js} +2 -2
  33. package/dist/{chunk-EVOC5I5I.js → chunk-B7PBSLZN.js} +2 -2
  34. package/dist/{chunk-ZLJLE6LK.js → chunk-BBW6JFHN.js} +2 -2
  35. package/dist/{chunk-NBRUH7OE.js → chunk-BDCC2NPY.js} +2 -2
  36. package/dist/{chunk-DD5BOU5I.js → chunk-BNXCIFVY.js} +2 -2
  37. package/dist/{chunk-FHCTEANE.js → chunk-BPAPWKP6.js} +2 -2
  38. package/dist/chunk-BS2NMXQZ.js +4 -0
  39. package/dist/chunk-C3KV2II6.js +2 -0
  40. package/dist/chunk-C43RDDP4.js +20 -0
  41. package/dist/{chunk-QBYYWGAT.js → chunk-CJST5ETY.js} +2 -2
  42. package/dist/chunk-DAFAHMNB.js +42 -0
  43. package/dist/chunk-DHEQMPLW.js +2 -0
  44. package/dist/{chunk-336DC5NJ.js → chunk-DQGFVPUV.js} +2 -2
  45. package/dist/chunk-DQLPXMH6.js +8 -0
  46. package/dist/chunk-EKZTZXHZ.js +117 -0
  47. package/dist/{chunk-KLVJABXA.js → chunk-EN3O7VJA.js} +2 -2
  48. package/dist/{chunk-U5CNPPTZ.js → chunk-EW2NTSFA.js} +2 -2
  49. package/dist/chunk-F3Z4OUDS.js +8 -0
  50. package/dist/chunk-FJH2NW7J.js +66 -0
  51. package/dist/{chunk-3OIKRYU5.js → chunk-FKSELJQF.js} +2 -2
  52. package/dist/chunk-FTFP6O3L.js +11 -0
  53. package/dist/chunk-FYLK2DEJ.js +2 -0
  54. package/dist/chunk-GH74ASD6.js +11 -0
  55. package/dist/{chunk-NQLSSVOB.js → chunk-GMXWZP2B.js} +2 -2
  56. package/dist/chunk-GOUBFH5O.js +3 -0
  57. package/dist/{chunk-RJHCPSZ7.js → chunk-HLF2TX6R.js} +2 -2
  58. package/dist/{chunk-PC44K7RF.js → chunk-HX4GQPZP.js} +2 -2
  59. package/dist/chunk-HX7M4BDI.js +30 -0
  60. package/dist/chunk-HZ72SESS.js +128 -0
  61. package/dist/{chunk-YTUD45PU.js → chunk-IB2N4FIY.js} +2 -2
  62. package/dist/chunk-ILMHV3KM.js +2 -0
  63. package/dist/chunk-IZYYAFN5.js +2 -0
  64. package/dist/{chunk-A43URCQ3.js → chunk-JAYYFEQY.js} +2 -2
  65. package/dist/{chunk-RWRLUZ6U.js → chunk-JDOEX4E6.js} +2 -2
  66. package/dist/chunk-JFGGXWQF.js +947 -0
  67. package/dist/chunk-JN4NMBEX.js +8 -0
  68. package/dist/{chunk-JELJLXEE.js → chunk-JVYA47YU.js} +2 -2
  69. package/dist/{chunk-F42A3AKG.js → chunk-JW56N3KI.js} +2 -2
  70. package/dist/{chunk-FQTPPXNA.js → chunk-JZ2OXNWB.js} +2 -2
  71. package/dist/chunk-KFZNKUNT.js +2 -0
  72. package/dist/chunk-KMKTIO2G.js +8 -0
  73. package/dist/chunk-L5GJNV2T.js +8 -0
  74. package/dist/{chunk-RBFFD4V2.js → chunk-L7AW2QB5.js} +2 -2
  75. package/dist/chunk-L7JDSCDF.js +4 -0
  76. package/dist/chunk-LU47HG23.js +14 -0
  77. package/dist/chunk-LVY7NPF7.js +2 -0
  78. package/dist/chunk-LY4WC4AD.js +74 -0
  79. package/dist/{chunk-MLGTCX56.js → chunk-MKCDWWGV.js} +2 -2
  80. package/dist/chunk-MNE7YG56.js +2 -0
  81. package/dist/{chunk-YWB2EBNB.js → chunk-MRXBEXSY.js} +2 -2
  82. package/dist/chunk-MV7OWDUX.js +2 -0
  83. package/dist/{chunk-2GSQR6YA.js → chunk-N5W4YZMK.js} +2 -2
  84. package/dist/chunk-NGEXCJJW.js +11 -0
  85. package/dist/{chunk-CYJM7CYF.js → chunk-NIW6JDC5.js} +2 -2
  86. package/dist/{chunk-YHXBD52M.js → chunk-O64IZ6UX.js} +2 -2
  87. package/dist/chunk-PBUQFCNB.js +16 -0
  88. package/dist/{chunk-UQK5CRUK.js → chunk-POAVPHH7.js} +2 -2
  89. package/dist/{chunk-TYQ76QHQ.js → chunk-PQCI4SQX.js} +2 -2
  90. package/dist/chunk-PXY7F6Y4.js +5 -0
  91. package/dist/chunk-RDO52JGY.js +2 -0
  92. package/dist/chunk-RJT3TUUZ.js +2 -0
  93. package/dist/{chunk-OHWZKLVA.js → chunk-RUJURYSV.js} +2 -2
  94. package/dist/{chunk-CSTYYXKC.js → chunk-RVLDN63O.js} +2 -2
  95. package/dist/chunk-RXOXSKY3.js +2 -0
  96. package/dist/chunk-S7OYBOCK.js +2 -0
  97. package/dist/chunk-SMNXQT5Z.js +3 -0
  98. package/dist/{chunk-QQWOFXNW.js → chunk-SRAFT254.js} +2 -2
  99. package/dist/{chunk-6XHTISLI.js → chunk-SXP2MBJH.js} +2 -2
  100. package/dist/chunk-T7YQSHPQ.js +3 -0
  101. package/dist/{chunk-2EZSOTSY.js → chunk-TFRAYKN6.js} +2 -2
  102. package/dist/{chunk-XVJ3V7LM.js → chunk-UJCOIXDY.js} +2 -2
  103. package/dist/{chunk-7LABSJSR.js → chunk-UJPRPGCO.js} +5 -5
  104. package/dist/chunk-W4ETQAXM.js +2 -0
  105. package/dist/chunk-WCCFZ7V7.js +113 -0
  106. package/dist/chunk-WUPW3UN3.js +3 -0
  107. package/dist/{chunk-VP542C25.js → chunk-WXZLAAWK.js} +2 -2
  108. package/dist/{chunk-LMFVTUW2.js → chunk-X54AGLVX.js} +2 -2
  109. package/dist/chunk-XKWKXZKW.js +20 -0
  110. package/dist/{chunk-OP3MTFJR.js → chunk-XSRF6Q77.js} +2 -2
  111. package/dist/chunk-Y2MVPNKY.js +5 -0
  112. package/dist/{chunk-6XFC7PQ5.js → chunk-YKUU5AIC.js} +2 -2
  113. package/dist/chunk-YLCJLTPL.js +2 -0
  114. package/dist/{chunk-47X75ZKH.js → chunk-YTQVETEO.js} +2 -2
  115. package/dist/chunk-Z4N3MZYA.js +38 -0
  116. package/dist/chunk-ZHXX42OH.js +18 -0
  117. package/dist/chunk-ZJOOT3BG.js +2 -0
  118. package/dist/chunk-ZK26BAQL.js +2 -0
  119. package/dist/{chunk-UUJBLG6J.js → chunk-ZTETIQ35.js} +2 -2
  120. package/dist/cli.js +3 -3
  121. package/dist/command-descriptors-4A4HWV4F.js +642 -0
  122. package/dist/{config-types-BWQ5xPGI.d.ts → config-types-jVM3D7MA.d.ts} +72 -2
  123. package/dist/{db-B0r1o7Vt.d.ts → db-B5PM5yNk.d.ts} +20 -2
  124. package/dist/{diff-gate-types-C9BoYwYD.d.ts → diff-gate-types-B0QYpDv1.d.ts} +2 -1
  125. package/dist/direct-navigation-6YHV6IB5.js +3 -0
  126. package/dist/{health-CFnlCiTz.d.ts → health-Do5TKSJI.d.ts} +1 -1
  127. package/dist/index.d.ts +3 -3
  128. package/dist/index.js +1 -1
  129. package/dist/postinstall.js +1 -1
  130. package/dist/queries/affected.d.ts +2 -2
  131. package/dist/queries/affected.js +1 -1
  132. package/dist/queries/architecture.d.ts +2 -2
  133. package/dist/queries/architecture.js +1 -1
  134. package/dist/queries/bottlenecks.d.ts +2 -2
  135. package/dist/queries/bottlenecks.js +1 -1
  136. package/dist/queries/by-kind.d.ts +2 -2
  137. package/dist/queries/by-kind.js +1 -1
  138. package/dist/queries/call-graph.d.ts +2 -2
  139. package/dist/queries/call-graph.js +1 -1
  140. package/dist/queries/change-surface.d.ts +22 -3
  141. package/dist/queries/change-surface.js +1 -1
  142. package/dist/queries/cleanup-plan.d.ts +2 -2
  143. package/dist/queries/cleanup-plan.js +1 -1
  144. package/dist/queries/co-change.d.ts +2 -2
  145. package/dist/queries/co-change.js +1 -1
  146. package/dist/queries/code.d.ts +2 -2
  147. package/dist/queries/code.js +1 -1
  148. package/dist/queries/complexity-hotspots.d.ts +3 -3
  149. package/dist/queries/complexity-hotspots.js +1 -1
  150. package/dist/queries/complexity.d.ts +3 -3
  151. package/dist/queries/complexity.js +1 -1
  152. package/dist/queries/convergence.d.ts +2 -2
  153. package/dist/queries/convergence.js +1 -1
  154. package/dist/queries/coupling.d.ts +2 -2
  155. package/dist/queries/coupling.js +1 -1
  156. package/dist/queries/cycles.d.ts +2 -2
  157. package/dist/queries/cycles.js +1 -1
  158. package/dist/queries/dataflow.d.ts +2 -2
  159. package/dist/queries/dataflow.js +1 -1
  160. package/dist/queries/dead.d.ts +2 -2
  161. package/dist/queries/dead.js +1 -1
  162. package/dist/queries/decorative-checkers.d.ts +2 -2
  163. package/dist/queries/decorative-checkers.js +1 -1
  164. package/dist/queries/deep-chains.d.ts +2 -2
  165. package/dist/queries/deep-chains.js +1 -1
  166. package/dist/queries/deps.d.ts +2 -2
  167. package/dist/queries/deps.js +1 -1
  168. package/dist/queries/diff-gate.d.ts +40 -7
  169. package/dist/queries/diff-gate.js +1 -1
  170. package/dist/queries/diff-impact.d.ts +84 -6
  171. package/dist/queries/diff-impact.js +1 -1
  172. package/dist/queries/doc-drift.d.ts +3 -3
  173. package/dist/queries/doc-drift.js +1 -1
  174. package/dist/queries/drift.d.ts +2 -2
  175. package/dist/queries/drift.js +1 -1
  176. package/dist/queries/duplicate-bodies.d.ts +3 -3
  177. package/dist/queries/duplicate-bodies.js +1 -1
  178. package/dist/queries/extract-candidates.d.ts +2 -2
  179. package/dist/queries/extract-candidates.js +1 -1
  180. package/dist/queries/fan.d.ts +2 -2
  181. package/dist/queries/fan.js +1 -1
  182. package/dist/queries/files.d.ts +12 -3
  183. package/dist/queries/files.js +1 -1
  184. package/dist/queries/health.d.ts +3 -3
  185. package/dist/queries/health.js +1 -1
  186. package/dist/queries/hierarchy.d.ts +2 -2
  187. package/dist/queries/hierarchy.js +1 -1
  188. package/dist/queries/hotspots.d.ts +2 -2
  189. package/dist/queries/hotspots.js +1 -1
  190. package/dist/queries/imports.d.ts +2 -2
  191. package/dist/queries/imports.js +1 -1
  192. package/dist/queries/incomplete-migration.d.ts +8 -6
  193. package/dist/queries/incomplete-migration.js +1 -1
  194. package/dist/queries/index.d.ts +141 -10
  195. package/dist/queries/index.js +1 -1
  196. package/dist/queries/isolated.d.ts +2 -2
  197. package/dist/queries/isolated.js +1 -1
  198. package/dist/queries/locality-candidates.d.ts +2 -2
  199. package/dist/queries/locality-candidates.js +1 -1
  200. package/dist/queries/members.d.ts +2 -2
  201. package/dist/queries/members.js +1 -1
  202. package/dist/queries/methods.d.ts +34 -3
  203. package/dist/queries/methods.js +1 -1
  204. package/dist/queries/not-implemented.d.ts +2 -2
  205. package/dist/queries/not-implemented.js +1 -1
  206. package/dist/queries/outline.d.ts +2 -2
  207. package/dist/queries/outline.js +1 -1
  208. package/dist/queries/passthrough-candidates.d.ts +3 -3
  209. package/dist/queries/passthrough-candidates.js +1 -1
  210. package/dist/queries/plan-context.d.ts +3 -3
  211. package/dist/queries/plan-context.js +1 -1
  212. package/dist/queries/react-component-duplicates.d.ts +2 -2
  213. package/dist/queries/react-component-duplicates.js +1 -1
  214. package/dist/queries/react-hook-candidates.d.ts +2 -2
  215. package/dist/queries/react-hook-candidates.js +1 -1
  216. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  217. package/dist/queries/react-large-component-pressure.js +1 -1
  218. package/dist/queries/recent-duplicates.d.ts +2 -2
  219. package/dist/queries/recent-duplicates.js +1 -1
  220. package/dist/queries/redundant-reexports.d.ts +2 -2
  221. package/dist/queries/redundant-reexports.js +1 -1
  222. package/dist/queries/refs.d.ts +2 -2
  223. package/dist/queries/refs.js +1 -1
  224. package/dist/queries/self-audit.d.ts +2 -2
  225. package/dist/queries/self-audit.js +1 -1
  226. package/dist/queries/similar-chains.d.ts +2 -2
  227. package/dist/queries/similar-chains.js +1 -1
  228. package/dist/queries/similar-files.d.ts +2 -2
  229. package/dist/queries/similar-files.js +1 -1
  230. package/dist/queries/similar-signatures.d.ts +2 -2
  231. package/dist/queries/similar-signatures.js +1 -1
  232. package/dist/queries/similar.d.ts +2 -2
  233. package/dist/queries/similar.js +1 -1
  234. package/dist/queries/slice.d.ts +2 -2
  235. package/dist/queries/slice.js +1 -1
  236. package/dist/queries/stale-abstractions.d.ts +2 -2
  237. package/dist/queries/stale-abstractions.js +1 -1
  238. package/dist/queries/stats.d.ts +2 -2
  239. package/dist/queries/surface.d.ts +2 -2
  240. package/dist/queries/surface.js +1 -1
  241. package/dist/queries/symbols.d.ts +2 -2
  242. package/dist/queries/symbols.js +1 -1
  243. package/dist/queries/system.d.ts +2 -2
  244. package/dist/queries/system.js +1 -1
  245. package/dist/queries/test-quality.d.ts +2 -2
  246. package/dist/queries/test-quality.js +1 -1
  247. package/dist/queries/trace.d.ts +2 -2
  248. package/dist/queries/trace.js +1 -1
  249. package/dist/queries/twin-ab.d.ts +14 -3
  250. package/dist/queries/twin-ab.js +1 -1
  251. package/dist/queries/twin-drift.d.ts +2 -2
  252. package/dist/queries/twin-drift.js +1 -1
  253. package/dist/queries/unused-imports.d.ts +2 -2
  254. package/dist/queries/unused-imports.js +1 -1
  255. package/dist/queries/unused-params.d.ts +2 -2
  256. package/dist/queries/unused-params.js +1 -1
  257. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  258. package/dist/queries/vue-component-duplicates.js +1 -1
  259. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  260. package/dist/queries/vue-composable-candidates.js +1 -1
  261. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  262. package/dist/queries/vue-large-view-pressure.js +1 -1
  263. package/dist/queries/wrapper-candidates.d.ts +2 -2
  264. package/dist/queries/wrapper-candidates.js +1 -1
  265. package/dist/reindex-worker.js +26 -25
  266. package/dist/reindex.d.ts +7 -3
  267. package/dist/reindex.js +34 -33
  268. package/dist/runtime.d.ts +5 -10
  269. package/dist/runtime.js +3 -3
  270. package/dist/rust-semantic-session-server.js +1 -1
  271. package/dist/rust-semantic-session-worker.js +1 -1
  272. package/dist/rust-semantic-worker.js +1 -1
  273. package/dist/{scip-cli-DCvnlZCu.d.ts → scip-cli-BnEwZRLJ.d.ts} +2 -2
  274. package/dist/{symbol-types-BgWU6lhL.d.ts → symbol-types-BIQwfoAx.d.ts} +7 -1
  275. package/dist/typescript-mailbox-worker.js +2 -0
  276. package/dist/watch-server.js +2 -42
  277. package/docs/AGENT_GUIDE.md +28 -5
  278. package/docs/CLI_JSON_OUTPUT.md +176 -3
  279. package/docs/COMMAND_REFERENCE.md +89 -87
  280. package/docs/COMMITTED_RECORD_COMPATIBILITY.md +55 -18
  281. package/docs/DURABILITY.md +88 -38
  282. package/docs/INDEX_GENERATIONS.md +65 -19
  283. package/docs/MAILBOX_LIFECYCLE.md +28 -1
  284. package/docs/REINDEX_METADATA_COMPATIBILITY.md +18 -8
  285. package/docs/SECURITY_MODEL.md +146 -0
  286. package/docs/TELEMETRY_RETENTION.md +16 -4
  287. package/docs/WATCH_REFRESH_REQUESTS.md +34 -21
  288. package/docs/WINDOWS_SIDECAR_RELEASE.md +9 -4
  289. package/docs/analyzer-inventory.md +31 -22
  290. package/docs/analyzer-validation-ledger.md +8 -0
  291. package/docs/schemas/cli-output-page.schema.json +104 -0
  292. package/docs/schemas/outcome-event-record.schema.json +57 -1
  293. package/docs/schemas/project-config.schema.json +82 -1
  294. package/docs/schemas/suppression-record.schema.json +84 -3
  295. package/package.json +9 -8
  296. package/skills/_shared/SKILL.md +5 -3
  297. package/skills/_shared/references/agent-contract-catalog.md +1 -1
  298. package/skills/_shared/references/detector-precision-and-diffgate.md +1 -1
  299. package/skills/scip-audit/SKILL.md +9 -8
  300. package/skills/scip-audit/references/claims.md +1 -1
  301. package/skills/scip-audit/references/cleanup.md +19 -20
  302. package/skills/scip-audit/references/directory.md +4 -4
  303. package/skills/scip-audit/references/frontend.md +10 -10
  304. package/skills/scip-audit/references/twin-drift.md +2 -2
  305. package/skills/scip-diagnose/references/debug.md +8 -8
  306. package/skills/scip-diagnose/references/root-cause.md +3 -3
  307. package/skills/scip-diagnose/references/triage.md +10 -10
  308. package/skills/scip-explore/SKILL.md +4 -4
  309. package/skills/scip-improve/SKILL.md +10 -10
  310. package/skills/scip-improve/references/cleanup-batches.md +3 -3
  311. package/skills/scip-improve/references/directory-moves.md +3 -3
  312. package/skills/scip-improve/references/doc-reconcile.md +1 -1
  313. package/skills/scip-improve/references/frontend-extraction.md +2 -2
  314. package/skills/scip-improve/references/twin-drift.md +3 -3
  315. package/skills/scip-plan/SKILL.md +3 -3
  316. package/skills/scip-plan/references/api-impact.md +5 -5
  317. package/skills/scip-plan/references/conductor.md +2 -2
  318. package/skills/scip-plan/references/hyper-optimization.md +1 -1
  319. package/skills/scip-query/SKILL.md +15 -5
  320. package/skills/scip-setup/references/bootstrap-workflow.md +7 -8
  321. package/skills/scip-setup/references/language-verification.md +2 -2
  322. package/skills/scip-setup/references/per-repo-triage.md +1 -1
  323. package/skills/scip-verify/SKILL.md +16 -11
  324. package/skills/scip-verify/references/calibrate-detectors.md +7 -7
  325. package/dist/chunk-24QNP7MN.js +0 -2
  326. package/dist/chunk-26X7KCJR.js +0 -5
  327. package/dist/chunk-273W2U4Y.js +0 -40
  328. package/dist/chunk-2OXVAGGT.js +0 -3
  329. package/dist/chunk-2ZOCHAL2.js +0 -8
  330. package/dist/chunk-35SQLYCQ.js +0 -2
  331. package/dist/chunk-4CGVLUDP.js +0 -18
  332. package/dist/chunk-4RI4BJGT.js +0 -8
  333. package/dist/chunk-52HQTTPB.js +0 -2
  334. package/dist/chunk-64MNV6AB.js +0 -8
  335. package/dist/chunk-7E3TH5ZN.js +0 -33
  336. package/dist/chunk-7Q6VYYCH.js +0 -2
  337. package/dist/chunk-A63U2W3P.js +0 -3
  338. package/dist/chunk-ADFSIJP2.js +0 -16
  339. package/dist/chunk-AOLE4DYM.js +0 -6
  340. package/dist/chunk-APMMR5Y2.js +0 -2
  341. package/dist/chunk-B5MHCHP3.js +0 -107
  342. package/dist/chunk-DGAGY7RJ.js +0 -60
  343. package/dist/chunk-DGMCFMPG.js +0 -11
  344. package/dist/chunk-E2ZXPB7J.js +0 -38
  345. package/dist/chunk-FKGN4A4E.js +0 -61
  346. package/dist/chunk-G4UQL4CP.js +0 -2
  347. package/dist/chunk-GA64UPMI.js +0 -6
  348. package/dist/chunk-HEBAY673.js +0 -2
  349. package/dist/chunk-HELS7KFF.js +0 -2
  350. package/dist/chunk-IPDCSB6N.js +0 -6
  351. package/dist/chunk-JERWGHQT.js +0 -16
  352. package/dist/chunk-JJJCO4QC.js +0 -945
  353. package/dist/chunk-JZNLMHWY.js +0 -56
  354. package/dist/chunk-K42M2KWT.js +0 -2
  355. package/dist/chunk-KP4KBDVF.js +0 -3
  356. package/dist/chunk-LRTP3DKL.js +0 -3
  357. package/dist/chunk-N3SE646F.js +0 -2
  358. package/dist/chunk-NN4ZIRPK.js +0 -8
  359. package/dist/chunk-P6HBYNBE.js +0 -5
  360. package/dist/chunk-QHKUY4FW.js +0 -2
  361. package/dist/chunk-QHRL4LKM.js +0 -2
  362. package/dist/chunk-SHKZ7OVJ.js +0 -35
  363. package/dist/chunk-TFUU5MQQ.js +0 -2
  364. package/dist/chunk-UXP636P5.js +0 -144
  365. package/dist/chunk-VEVBIAOJ.js +0 -16
  366. package/dist/chunk-VKRQDBW5.js +0 -9
  367. package/dist/chunk-VOQFGC2W.js +0 -67
  368. package/dist/chunk-WMXRRBII.js +0 -8
  369. package/dist/chunk-X3NLZHPA.js +0 -20
  370. package/dist/chunk-XF3KLXN3.js +0 -11
  371. package/dist/chunk-YCPASUCX.js +0 -2
  372. package/dist/chunk-YLVE3SXZ.js +0 -20
  373. package/dist/chunk-Z2LHPIOM.js +0 -2
  374. package/dist/chunk-Z5QQPJ3U.js +0 -30
  375. package/dist/chunk-ZTTISZ7J.js +0 -112
  376. package/dist/command-descriptors-SJDZ7QGR.js +0 -617
  377. package/dist/direct-navigation-HTKOZEOM.js +0 -3
@@ -1,11 +0,0 @@
1
- import{E as Fe,G as Pe,H as g,I as Ee,l as B,m as M,n as L,o as ke,p as Te,q as _e,x as Le,y}from"./chunk-B5MHCHP3.js";import{a as q}from"./chunk-64MNV6AB.js";import{isAbsolute as jt,relative as Vt}from"path";function we(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function v(e){return e.replace(/\\/g,"/")}function Io(e,t){return we(e)===we(t)}function Bo(e,t){let n=Vt(e,t);return n===""||!n.startsWith("..")&&!jt(n)}import{existsSync as ce,readFileSync as le,readdirSync as It,statSync as Bt}from"fs";import{join as w,relative as $t}from"path";function Ae(e){let t=Ot(e)??zt(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Mt(e,o)){if(r.has(s))continue;r.add(s);let i=qt(e,s);i&&n.push(i)}return n}function Ot(e){let t=w(e,"pnpm-workspace.yaml");if(!ce(t))return null;try{return Dt(le(t,"utf8"))}catch{return null}}function Dt(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Wt(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Ut(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Wt(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Ut(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function zt(e){let t=w(e,"package.json");if(!ce(t))return null;try{let n=JSON.parse(le(t,"utf8"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Mt(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=w(e,t);return ae(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=w(e,r||".");return ae(s)?It(s).map(i=>w(s,i,o)).filter(ae):[]}function ae(e){try{return Bt(e).isDirectory()}catch{return!1}}function qt(e,t){let n=w(t,"package.json");if(!ce(n))return null;try{let r=JSON.parse(le(n,"utf8"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:$t(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}import{extname as Re}from"path";var Xt={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function X(e){return Xt[Re(e).toLowerCase()]??null}function je(e){return Re(e).toLowerCase()===".vue"}import{createRequire as Ht}from"module";var d=Ht(import.meta.url),H=null,Ve=!1;function Jt(){if(Ve)return null;if(H)return H;try{return H=d("tree-sitter"),H}catch{return Ve=!0,null}}var Ie=new Map,J=new Set;function Zt(e){if(J.has(e))return null;let t=Ie.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return J.add(e),null}}catch{return J.add(e),null}return Ie.set(e,n),n}var Be=new Map;function Gt(e){let t=Be.get(e);if(t)return t;let n=Zt(e);if(!n)return null;let r=Jt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return J.add(e),null}return Be.set(e,o),o}function Kt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function $(e,t){let n=Gt(e);if(!n)return null;try{return Kt(n,t)}catch{return null}}import{posix as ue}from"path";import{parse as Qt}from"@vue/compiler-sfc";var Yt=L("vue-sfc-units");function A(e,t){let n=De(t),r=g(e,n);return Yt.get(e,n,r,()=>pe(e,n,r))}function De(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function en(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function F(e){return!e||e.body.length===0?0:e.body.split(`
2
- `).length}function pe(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Qt(n,{filename:t})}catch(i){return r.errors.push(Oe(i)),r}r.errors.push(...o.errors.map(Oe));let{descriptor:s}=o;return s.template&&(r.template=Z(e,t,"template",s.template)),s.script&&r.scripts.push($e(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push($e(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>Z(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>Z(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function $e(e,t,n,r){let o=Z(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:en(o.lang)}}function Z(e,t,n,r){let o=nn(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=tn(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),f=l?Math.max(0,l.split(`
3
- `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:f,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function tn(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=De(ue.normalize(ue.join(ue.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function nn(e){return{...e}}function Oe(e){return e instanceof Error?e.message:String(e)}function We(e,t,n){let o=pe(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
4
- `.repeat(i.startLine)}${i.body}`).join(`
5
- `),startLine:0,language:s}:null}var Ue=ke("ast-trees",{clearGroups:["whole-project","source-file"]});function ze(e,t){if(je(t))return rn(e,t);let n=X(t);if(!n)return null;let r=g(e,t);return r?Ue.get(e,t,r,()=>$(n,r)):null}function rn(e,t){let n=g(e,t);return n?Ue.get(e,t,n,()=>{let r=We(e,t,n);if(!r)return null;let o=`
6
- `.repeat(r.startLine)+r.body;return $(r.language,o)}):null}import{readdirSync as on}from"fs";import{execFileSync as sn}from"child_process";import{extname as G,join as an}from"path";var cn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],us=[".vue"],Me=[".tsx",".jsx"],qe=[".vue"],ln=[...Me,...qe],un=new Set(Me),pn=new Set(qe),Xe=new Set(cn.map(e=>e.toLowerCase())),fn=[...Xe].sort().join(","),He=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function O(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):Xe,i=o?[...s].sort().join(","):fn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return mn.get(e,a,()=>{let c=new Set;if(n)for(let l of q(e,{includeIgnored:!1}))s.has(G(l).toLowerCase())&&c.add(l);if(r)for(let l of dn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function ps(e,t={}){let n=!1,r=!1;for(let o of O(e,{extensions:ln})){if(t.scope&&!o.includes(t.scope))continue;let s=G(o).toLowerCase();if(n||=un.has(s),r||=pn.has(s),n&&r)break}return{react:n,vue:r}}var mn=B("source-files",{clearGroups:[]});function dn(e,t){return gn(e,t)??Sn(e,t)}function gn(e,t){try{let n=sn("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"]}),r=new Set;for(let o of n.split(`
7
- `)){let s=o.trim();s&&(hn(s)||t.has(G(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function hn(e){return e.split("/").some(t=>He.has(t))}function Sn(e,t){let n=new Set,r=o=>{let s=o?an(e,o):e,i;try{i=on(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!He.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(G(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as Nn}from"path";function Q(e,t){let n=yn(e,t);if(!n)return null;let r=K(n);return r?{calleeLeaf:r,memberAccess:xn(n),line:e.startPosition.row}:null}function yn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function xn(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function K(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?K(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?K(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?K(t):null}case"super":case"self":case"this":return null;default:return null}}var vn=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function Y(e){return e.length<=2||vn.has(e)}var bn=[".tsx",".jsx"],Je=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),Cn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),kn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),Tn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),_n=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Ln=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),Fn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),Pn=L("react-component-behavior-profiles"),Ze=Fe({kind:"react-component-behavior-profiles",invalidation:Pe("react-component-behavior-profiles"),serialize:Rn,deserialize:jn});function Ye(e,t={}){let n=O(e,{extensions:bn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>me(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function me(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Pn.get(e,n,r,()=>En(e,n,r)).map(An)}function En(e,t,n){let r=_e(e,t,n),o=Ze.read(e,t,r);if(o)return o;let s=wn(e,t);return Ze.write(e,t,r,s),s}function wn(e,t){let n=In(t);if(!n)return[];let r=ze(e,t);if(!r)return[];let o=Ee(e,t).length;return Bn(r.rootNode,n).filter(i=>i.kind==="hook"||de(i.bodyNode)).map(i=>{let a=Mn(i.bodyNode),c=Zn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:C(a.componentNames),nativeTags:C(a.nativeTags),propNames:C(a.propNames),eventNames:C(a.eventNames),hookNames:C(c.hookNames),requestNames:C(c.requestNames),stateNames:C(c.stateNames),effectNames:C(c.effectNames),handlerNames:C(c.handlerNames)}})}function An(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Rn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function jn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Vn(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Vn(e){if(!Le(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:f,nativeTags:u,propNames:N,eventNames:V,hookNames:se,requestNames:ie,stateNames:m,effectNames:b,handlerNames:I}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!ee(o)||!ee(s)||!ee(i)||!ee(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(f),nativeTags:y(u),propNames:y(N),eventNames:y(V),hookNames:y(se),requestNames:y(ie),stateNames:y(m),effectNames:y(b),handlerNames:y(I)};return Object.values(S).some(Rt=>Rt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function ee(e){return typeof e=="number"&&Number.isFinite(e)}function In(e){let t=Nn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:X(e)}function Bn(e,t){let n=[],r=new Set,o=s=>{let i=$n(s);if(i&&(!Un(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function $n(e){if(e.type==="class_declaration"){let s=fe(e);if(!s||!/^[A-Z]/.test(s))return null;let i=On(e);return!i||!Dn(e)&&!de(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=fe(e);return!s||!Ge(s)?null:{name:s,kind:Ke(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=D(t);if(!r||!n||!Ge(r))return null;let o=Wn(n);return o?{name:r,kind:Ke(r),node:e,bodyNode:o}:null}function On(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Dn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Ge(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function Ke(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Wn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=zn(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Un(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function fe(e){return D(e.childForFieldName("name")??e.namedChild(0))}function zn(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function de(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(de)}function Mn(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?qn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Xn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function qn(e,t){let n=Hn(e),r=!1;if(n){let o=Qe(n),s=o==="Fragment"||o==="React.Fragment";r=er(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=Jn(o);if(!s)continue;let i=Qe(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else Fn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(et(o))}function Xn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(et(e)),tt(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of tr(n))Y(r)||t.tokens.add(`binding:${r}`)}function et(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function tt(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(tt)}function Hn(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function Jn(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Zn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=Q(o,t);s&&Gn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")Qn(o,n);else if(o.type==="function_declaration"){let s=fe(o);s&&nt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function Gn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Je.has(e)&&!Tn.has(e)&&t.tokens.add(`hook:${e}`)),Je.has(e)&&t.tokens.add(`react-hook:${e}`),Cn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),kn.has(e)&&t.tokens.add(`state-hook:${e}`),Kn(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function Kn(e){if(_n.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Qn(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>D(a)),i=D(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=D(n);o&&nt(o,t)}function nt(e,t){let n=Yn(e);!n||!Ln.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Yn(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function er(e){return/^[A-Z]/.test(e)||e.includes(".")}function Qe(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function D(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function tr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function C(e){return[...e].sort()}function W(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var nr=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function at(e,t){let n=or(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:st(n.functionNode),params:rt(n.functionNode),paramsEndLine:ot(n.functionNode),isLiteralPassthrough:it(n.functionNode,t)};if(!rr(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:st(e),params:rt(e),paramsEndLine:ot(e),isLiteralPassthrough:it(e,t)}:null}function ct(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function rt(e){let t=ct(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(W(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function ot(e){let t=ct(e);return t?t.endPosition.row:e.startPosition.row}function rr(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?nr.has(e):!1}function or(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}return null}function st(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)W(r)||(n+=1);return n}function it(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!W(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!W(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let f=[];for(let u of l.namedChildren){if(u.type==="identifier"){f.push(u.text);continue}let N=u.namedChildren.find(V=>V.type==="identifier");N&&f.push(N.text)}if(c.length!==f.length)return!1;for(let u=0;u<f.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==f[u])return!1}return!0}var sr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),ir=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),ar=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),cr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),lr=new Set(["catch","for","function","if","return","switch","while"]);function ne(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=F(n),n.external&&(t.externalLineCount+=F(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...mr(n));let r=$(n.astLanguage,n.body);r?pr(n,r.rootNode,t):fr(n,t)}return ur(t),t.externalScriptPaths=ut(t.externalScriptPaths),t}function ur(e){e.composables=R(e,"composable"),e.stores=R(e,"store"),e.reactivity=R(e,"reactivity"),e.lifecycle=R(e,"lifecycle"),e.requests=R(e,"request"),e.macros=R(e,"macro")}function R(e,t){return ut(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function pr(e,t,n){let r=new Set,o=new Set,s=i=>{let a=at(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Q(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:lt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function fr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||lr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+te(e.body,n.index??0),categories:lt(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+te(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+te(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function mr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+te(e.body,n.index??0);for(let i of dr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function dr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function lt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),sr.has(e)&&t.push("reactivity"),ir.has(e)&&t.push("lifecycle"),ar.has(e)&&t.push("request"),cr.has(e)&&t.push("macro"),t}function te(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function ut(e){return[...new Set(e)].sort()}import{ElementTypes as gr,NodeTypes as ge,parse as hr}from"@vue/compiler-dom";import{parse as $s}from"@vue/compiler-sfc";function pt(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Sr=L("vue-template-facts"),yr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),xr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),vr=new Set(["div","span","template"]),Nr=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function re(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Sr.get(e,n,r,()=>br(n,A(e,n).template))}function br(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=hr(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return mt(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function mt(e,t,n,r){for(let o of e)if(o.type===ge.ELEMENT)Cr(o,t,n,r),mt(o.children,t,n,r);else if(o.type===ge.INTERPOLATION){r("interpolation");let s=he(o.content);s&&dt(s,t,o.loc.start.line,n,r)}}function Cr(e,t,n,r){let o=Er(e.tag),s={tag:e.tag,normalized:o,kind:Pr(e),startLine:j(t,e.loc.start.line),endLine:j(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),vr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)kr(i,t,n,r)}function kr(e,t,n,r){if(e.type===ge.ATTRIBUTE){let a=e.value?.content??null,c=ft("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=_r(e),s=he(e.exp),i=ft(Tr(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&dt(s,t,e.loc.start.line,n,r)}function ft(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:j(r,o),endLine:j(r,s)}}function Tr(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function _r(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function dt(e,t,n,r,o){for(let s of Lr(e)){let i={name:s,startLine:j(t,n),endLine:j(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function Lr(e){let t=new Set,n=Fr(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];Nr.has(s)||Y(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Fr(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Pr(e){let t=e.tag;return e.tagType===gr.COMPONENT?"component":yr.has(t)?"builtin":xr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Er(e){return pt(e,/[-_:]/)}function j(e,t){return e+Math.max(0,t-1)}import{createRequire as wr}from"module";import{existsSync as E}from"fs";import{basename as gt,dirname as h,extname as k,join as x,relative as P,resolve as p,sep as Ar}from"path";var Rr=M("indexed-paths",{clearGroups:[]}),jr=M("indexed-path-digest",{clearGroups:[]}),Vr=B("tsconfig-alias-config",{clearGroups:["whole-project"]}),Ir=B("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Br=wr(import.meta.url),U;function $r(){if(U!==void 0)return U;try{U=Br("typescript")}catch{U=null}return U}var Or=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Dr=M("workspace-packages",{clearGroups:["whole-project"]}),z=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ht=[".py",".pyi"],St=[".java",".scala",".kt",".kts"],yt=[".rs"],xt=[".rb"],vt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Nt=[".cs",".vb"],bt=[".dart"],Ct=[".php"],oe=[".clj",".cljs",".cljc"],Wr=new Set(z),Se=new Set(ht),kt=new Set(St),ye=new Set(yt),xe=new Set(xt),Tt=new Set(vt),_t=new Set(Nt),ve=new Set(bt),Lt=new Set(Ct),Ft=new Set(oe),Ur=[{extensions:z,lookup:Wr},{extensions:ht,lookup:Se},{extensions:St,lookup:kt},{extensions:yt,lookup:ye},{extensions:xt,lookup:xe},{extensions:vt,lookup:Tt},{extensions:Nt,lookup:_t},{extensions:bt,lookup:ve},{extensions:Ct,lookup:Lt},{extensions:oe,lookup:Ft}];function T(e,t){return t.has(k(e).toLowerCase())}function zr(e){return T(e,Se)}function Mr(e){return T(e,kt)}function qr(e){return T(e,ye)}function Xr(e){return T(e,xe)}function Hr(e){return T(e,Tt)}function Jr(e){return T(e,_t)}function Ys(e){return k(e).toLowerCase()===".vb"}function Zr(e){return T(e,ve)}function Gr(e){return T(e,Lt)}function Kr(e){return T(e,Ft)}function Qr(e){let t=k(e).toLowerCase();for(let n of Ur)if(n.lookup.has(t))return n.extensions;return z}function Yr(e){return Mr(e)||Jr(e)||Gr(e)}function Pt(e,t,n){return zr(t)?fo(e,t,n):qr(t)?mo(e,t,n):Xr(t)?go(e,t,n):Hr(t)?ho(e,t,n):Yr(t)?So(e,n.replace(/\\/g,"."),Qr(t)):Zr(t)?yo(e,t,n):Kr(t)?xo(e,n):eo(e,t,n)}function eo(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return to(e,t,n)??ro(e,n);let r=h(x(e.config.projectRoot,t)),o=p(r,n),s=_(e);for(let i of be(o)){let a=v(P(e.config.projectRoot,i));if(s.has(a)||E(i))return a}return v(P(e.config.projectRoot,o))}function to(e,t,n){let r=lo(e,t);if(!r)return null;let o=_(e);for(let s of no(r,n)){let i=p(r.baseUrl,s);for(let a of be(i)){let c=v(P(e.config.projectRoot,a));if(o.has(c)||E(a))return c}}return null}function no(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function ro(e,t){let n=so(oo(e),t);if(!n)return null;let r=_(e);for(let o of io(n)){let s=p(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of be(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||E(i))return a}}return null}function oo(e){return Dr.get(e,()=>Ae(e.config.projectRoot))}function so(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function io(e){let t=[],n=ao(e.pkg.exports,e.subpath);if(n){let r=co(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function ao(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Et(e[n])}function Et(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=Et(t[n]);if(r)return r}return null}function co(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function lo(e,t){let n=v(h(t));return Ir.get(e,n,()=>uo(e,n))}function uo(e,t){let n=$r();if(!n)return null;let r=p(e.config.projectRoot),o=p(r,t);for(;o===r||o.startsWith(r+Ar);){for(let i of Or){let a=x(o,i);if(!E(a))continue;let c=Vr.get(e,a,()=>po(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function po(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?p(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function fo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?p(c,a.replace(/\./g,"/")):c}else o=p(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of vo(o)){let i=v(P(e.config.projectRoot,s));if(r.has(i)||E(s))return i}return null}function mo(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=p(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=p(o,r.slice(6).replace(/::/g,"/")):s=p(h(o),r.slice(7).replace(/::/g,"/")),Ne(e,No(s))}function go(e,t,n){let r=h(x(e.config.projectRoot,t)),o=p(r,n);return Ne(e,bo(o))}function ho(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[p(r,n),p(e.config.projectRoot,n),p(e.config.projectRoot,"include",n),p(e.config.projectRoot,"src",n)];return Ne(e,o)}function So(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,f=[...r].find(u=>u.endsWith(l));if(f)return f}for(let c of n){let l=[...r].find(f=>gt(f)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function yo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=p(o,n);for(let i of Co(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||E(i))return a}return null}function xo(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of oe){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of oe){let s=[...r].find(i=>gt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function vo(e){let t=k(e);return Se.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function Ne(e,t){let n=_(e);for(let r of t){let o=v(P(e.config.projectRoot,r));if(n.has(o)||E(r))return o}return null}function No(e){let t=k(e);return ye.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function bo(e){let t=k(e);return xe.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Co(e){let t=k(e);return ve.has(t)?[e]:[`${e}.dart`,e]}function be(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of z)n.add(e.slice(0,-t.length)+r)}else for(let r of z)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return Rr.get(e,()=>new Set(q(e,{includeIgnored:!1}).map(v)))}function ei(e){return jr.get(e,()=>Te([..._(e)].sort().join(`
8
- `)))}var ko=new Set(["in","key","of"]),To=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),_o=L("vue-component-behavior-profiles");function wt(e,t={}){let n=O(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Ce(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Ce(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=_o.get(e,n,r,()=>Lo(e,n,r));return Po(o)}function Lo(e,t,n){let r=A(e,t),o=re(e,t),s=ne(r),i=Ao(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,b,I)=>I.indexOf(m)===b).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,b,I)=>I.indexOf(m)===b).sort(),l=n?n.split(`
9
- `).length:0,f=F(r.template),u=s.lineCount,N=r.styles.reduce((m,b)=>m+F(b),0),V=r.customBlocks.reduce((m,b)=>m+F(b),0),{lines:se,paths:ie}=Fo(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:wo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:f,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:V,delegatedComposableLines:se,delegatedComposablePaths:ie}}function Fo(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Pt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
10
- `).length:0)},0),paths:o}}function Po(e){let t=Eo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function Eo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function wo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(To.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Ao(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Ro(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of At(n.value))t.add(r);return[...t].sort()}function Ro(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?At(t[1]??""):[]}function At(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];ko.has(r)||t.push(r)}return t}function gi(e){return{capability:(t,n)=>jo(t,n),reactProfiles:(t={})=>Ye(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>wt(e,t),vueProfileForFile:t=>Ce(e,t),vueTemplateFacts:t=>re(e,t),vueScriptFacts:t=>ne(A(e,t))}}function jo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{we as a,v as b,Io as c,Bo as d,Ae as e,Mt as f,z as g,ht as h,St as i,yt as j,xt as k,vt as l,Nt as m,bt as n,Ct as o,oe as p,Ys as q,Qr as r,Pt as s,fo as t,mo as u,go as v,ho as w,So as x,yo as y,xo as z,ei as A,X as B,je as C,We as D,ze as E,Q as F,K as G,at as H,pt as I,us as J,He as K,O as L,ps as M,gi as N};
11
- //# sourceMappingURL=chunk-DGMCFMPG.js.map
@@ -1,38 +0,0 @@
1
- import{b as B,c as W,d as G,e as J,l as K}from"./chunk-JERWGHQT.js";import{d as Q,e as U}from"./chunk-MTDBHTSF.js";import{e as T,g as x,s as F,t as j,y as $,z as H}from"./chunk-ZTTISZ7J.js";import{k as v,p as P}from"./chunk-7LABSJSR.js";import{B as L,c as O}from"./chunk-DGMCFMPG.js";import{m as N}from"./chunk-B5MHCHP3.js";function Me(t,n,e={}){let o=Y(t,[n],{additive:e.additive,semantic:e.semantic,semanticEvidence:e.semanticEvidence}),l=e.callableOnly?(o.get(n.symbolId)??[]).filter(a=>x(a.symbol)||a.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof e.limit=="number"?l.slice(0,e.limit):l}function Ie(t,n,e){return X(t,[n],e).get(n.symbolId)??[]}function X(t,n,e){let o=te(t)?ie(t,n,{semantic:e.semantic!==!1,semanticEvidence:e.semanticEvidence}):oe(t,e.semanticEvidence);return typeof e.limit!="number"?new Map(n.map(l=>[l.symbolId,o.get(l.symbolId)??[]])):new Map(n.map(l=>[l.symbolId,(o.get(l.symbolId)??[]).slice(0,e.limit)]))}var ee=N("caller-rows",{clearGroups:["whole-project"]}),ne=2e4;function te(t){return(t.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ne}function oe(t,n){return ee.get(t,()=>{let e=j(t),o=Y(t,e,{semanticEvidence:n}),l=new Map;for(let s of e)l.set(s.symbol,s.symbolId);let a=new Map,c=new Map;for(let s of e){let d=o.get(s.symbolId);if(!(!d||d.length===0))for(let b of d){let r=l.get(b.symbol);if(r===void 0||r===s.symbolId)continue;let u=a.get(r);u||(u=[],a.set(r,u),c.set(r,new Set));let m=`${s.symbol}|${s.relativePath}`;c.get(r).has(m)||(c.get(r).add(m),u.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion"}))}}return a})}function ie(t,n,e){let o=e.semantic&&e.semanticEvidence?n.flatMap(s=>{let d=le(t,s);return d?[d]:[]}):[],l=new Map(o.map(s=>[s.symbolId,s])),a=e.semanticEvidence?.referenceMap(t,o)??new Map,c=new Map;for(let s of n){let d=[],b=new Set,r=m=>{if(m.symbol===s.symbol)return;let i=`${m.symbol}|${m.file}`;b.has(i)||(b.add(i),d.push(m))};for(let m of K(t,s))m.file!==s.relativePath&&r({symbol:m.enclosingSymbol??m.file,file:m.file,source:"resolved-reference"});let u=l.get(s.symbolId);if(u)for(let m of a.get(u.symbolId)??[]){if(m.file===s.relativePath||t.isIgnored(m.file))continue;let i=H(F(t,m.file),m.line);r({symbol:i?.symbol??m.file,file:m.file,source:"semantic-reference"})}c.set(s.symbolId,d)}return c}function le(t,n){let e=Q().join(", "),o=U().join(", ");return t.get(`SELECT
2
- d.id AS documentId,
3
- gs.id AS symbolId,
4
- gs.symbol,
5
- d.relative_path AS relativePath,
6
- COALESCE(der.start_line, c.start_line) AS startLine,
7
- COALESCE(der.end_line, c.end_line) AS endLine,
8
- COALESCE(gs.display_name, '') AS leaf,
9
- NULL AS parentTypeName,
10
- CASE WHEN gs.kind IN (${e}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
11
- CASE WHEN gs.kind IN (${o}) THEN 1 ELSE 0 END AS isTypeLike,
12
- gs.kind AS kind,
13
- gs.documentation AS documentation,
14
- gs.enclosing_symbol AS enclosingSymbol
15
- FROM global_symbols gs
16
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
17
- LEFT JOIN chunks c ON c.document_id = der.document_id
18
- JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
19
- WHERE gs.id = ?
20
- LIMIT 1`,n.symbolId)??null}function Y(t,n,e={}){if(n.length===0)return new Map;let o=e.additive??!1,l=[],a=[];for(let r of n)L(r.relativePath)&&v(t,r.relativePath)!==null?l.push(r):a.push(r);let c=new Map,s=new Map,d=r=>{for(let[u,m]of r){let i=c.get(u);i||(i=[],c.set(u,i));let p=s.get(u);p||(p=new Set,s.set(u,p));for(let _ of m){let h=`${_.symbol}|${_.chunkId}`;p.has(h)||(p.add(h),i.push(_))}}};l.length>0&&d(se(t,l)),e.semantic!==!1&&e.semanticEvidence&&d(ue(e.semanticEvidence.calleeMap(t,n)));let b=o?n:a;return b.length>0&&d(me(t,b)),c}function se(t,n){let e=new Map,o=ae(n,e),l=J(t);for(let[a,c]of o){let s=v(t,a);if(!s)continue;let d=$(c);for(let b of s){let r=d.get(b.line);if(!r)continue;let u=ce(t,a,l,b);u&&u.symbol!==r.symbol&&e.get(r.symbolId).push({symbol:u.symbol,file:u.file,chunkId:b.line,source:"ast-callsite"})}}return e}function ae(t,n){let e=new Map;for(let o of t){let l=e.get(o.relativePath);l?l.push(o):e.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of e.values())o.sort((l,a)=>l.endLine-l.startLine-(a.endLine-a.startLine));return e}function ce(t,n,e,o){let l=W(n,e.get(o.calleeLeaf)??[]);if(l.length===0)return null;let a=re(t,n,l,o.calleeQualifier);return a||G(t,n,l,o.memberAccess)}function re(t,n,e,o){if(!o||L(n)!=="clojure")return null;let a=P(t,n).filter(c=>c.kind==="namespace"&&c.localName===o&&c.sourcePath).map(c=>c.sourcePath);for(let c of a){let s=e.find(d=>O(c,d.file));if(s)return s}return e.find(c=>/`([^`]+)`\//.exec(c.symbol)?.[1]===o)??null}function me(t,n){if(n.length===0)return new Map;let o=k(n.map(i=>i.documentId)).flatMap(i=>t.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
21
- FROM mentions m
22
- JOIN chunks c ON m.chunk_id = c.id
23
- WHERE m.role != 1
24
- AND c.document_id IN (${i.map(()=>"?").join(",")})`,...i)),l=new Map;for(let i of o)l.has(i.document_id)||l.set(i.document_id,[]),l.get(i.document_id).push(i);let c=k(o.map(i=>i.symbol_id)).flatMap(i=>t.all(`SELECT gs.id AS symbol_id, gs.symbol,
25
- COALESCE(der.document_id, def_chunk.document_id) AS document_id
26
- FROM global_symbols gs
27
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
28
- LEFT JOIN (
29
- SELECT m.symbol_id, MIN(c.document_id) AS document_id
30
- FROM mentions m
31
- JOIN chunks c ON m.chunk_id = c.id
32
- WHERE m.role = 1
33
- AND m.symbol_id IN (${i.map(()=>"?").join(",")})
34
- GROUP BY m.symbol_id
35
- ) def_chunk ON def_chunk.symbol_id = gs.id
36
- WHERE gs.id IN (${i.map(()=>"?").join(",")})`,...i,...i)),s=k([...n.map(i=>i.documentId),...c.flatMap(i=>i.document_id===null?[]:[i.document_id])]),d=new Map(s.flatMap(i=>t.all(`SELECT id, relative_path FROM documents
37
- WHERE id IN (${i.map(()=>"?").join(",")})`,...i).map(p=>[p.id,p.relative_path]))),b=new Map;for(let i of c)b.has(i.symbol_id)||b.set(i.symbol_id,{symbol:i.symbol,file:i.document_id!==null?d.get(i.document_id)??"":""});let r=new Map,u=d,m=de(n);for(let[i,p]of m){let h=[...l.get(i)??[]].sort((f,g)=>f.start_line-g.start_line||f.end_line-g.end_line),Z=[...p].sort((f,g)=>f.startLine-g.startLine||f.endLine-g.endLine),C=new Set,M=0;for(let f of Z){for(;M<h.length&&h[M].start_line<=f.endLine;)C.add(h[M]),M+=1;for(let y of C)y.end_line<f.startLine&&C.delete(y);let g=new Set,A=[],R=null,q=()=>{if(R)return R;let y=u.get(f.documentId)??"",S=new Set;if(y){let w=B(t,y),I=Math.max(0,f.startLine),D=Math.min(w.length-1,f.endLine);for(let E=I;E<=D;E+=1)for(let z of w[E])S.add(z)}return R=S,S};for(let y of C){if(y.symbol_id===f.symbolId)continue;let S=b.get(y.symbol_id);if(!S)continue;if(!(y.start_line>=f.startLine&&y.end_line<=f.endLine)){if(!(y.start_line<=f.endLine&&y.end_line>=f.startLine))continue;let E=T(S.symbol);if(!E||!q().has(E))continue}let I=`${S.symbol}|${y.chunk_id}`;g.has(I)||(g.add(I),A.push({...S,chunkId:y.chunk_id,source:"scip-chunk"}))}r.set(f.symbolId,A)}}return r}var V=500;function k(t){let n=[...new Set(t)],e=[];for(let o=0;o<n.length;o+=V)e.push(n.slice(o,o+V));return e}function de(t){let n=new Map;for(let e of t){let o=n.get(e.documentId);o?o.push(e):n.set(e.documentId,[e])}return n}function ue(t){let n=new Map;for(let[e,o]of t){let l=[];for(let a of o)l.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(e,l)}return n}export{Me as a,Ie as b,X as c,Y as d};
38
- //# sourceMappingURL=chunk-E2ZXPB7J.js.map
@@ -1,61 +0,0 @@
1
- import{c as R}from"./chunk-XVJ3V7LM.js";import{a as _,d as f}from"./chunk-WMXRRBII.js";import{d as l}from"./chunk-ZTTISZ7J.js";import{o as u,p,q as a}from"./chunk-7LABSJSR.js";import{H as m}from"./chunk-B5MHCHP3.js";import{a as d}from"./chunk-64MNV6AB.js";function $(e,o={}){let{scope:n,limit:r}=o,i=new R(e),t=D([...x(e,n),...O(e,i,n)]);return y(t),r?t.slice(0,r):t}function x(e,o){let n=[];for(let r of S(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||m(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=N(e,r),t=i?.barrel_consumers??0,s=i?.direct_consumers??0;t!==0||s!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:l(r.symbol),originalFile:r.original_path,barrelConsumers:t,directConsumers:s,...b(e,r.barrel_path)})}return n}function S(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
2
- barrel_d.id AS barrel_doc_id,
3
- barrel_d.relative_path AS barrel_path,
4
- gs.id AS symbol_id,
5
- gs.symbol AS symbol,
6
- orig_d.id AS original_doc_id,
7
- orig_d.relative_path AS original_path
8
- FROM mentions m
9
- JOIN chunks c ON m.chunk_id = c.id
10
- JOIN documents barrel_d ON c.document_id = barrel_d.id
11
- JOIN global_symbols gs ON m.symbol_id = gs.id
12
- JOIN (
13
- SELECT m2.symbol_id, c2.document_id
14
- FROM mentions m2
15
- JOIN chunks c2 ON m2.chunk_id = c2.id
16
- WHERE m2.role = 1
17
- GROUP BY m2.symbol_id
18
- ) sym_def ON sym_def.symbol_id = gs.id
19
- JOIN documents orig_d ON sym_def.document_id = orig_d.id
20
- WHERE m.role != 1
21
- AND (barrel_d.relative_path LIKE '%/index.ts'
22
- OR barrel_d.relative_path LIKE '%/index.js'
23
- OR barrel_d.relative_path = 'index.ts'
24
- OR barrel_d.relative_path = 'index.js')
25
- AND orig_d.id != barrel_d.id
26
- ${e.pathExclusionsFor("barrel_d","orig_d")}
27
- ${e.symbolNoiseFor("gs")}
28
- -- Only function-level symbols (ending with ().), not module-level
29
- AND gs.symbol LIKE '%().'
30
- ${n}
31
- ORDER BY barrel_d.relative_path, gs.symbol`,...r)}function N(e,o){return e.get(`SELECT
32
- SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
33
- SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
34
- FROM (
35
- SELECT
36
- consumer_d.id AS consumer_doc_id,
37
- MAX(CASE WHEN EXISTS (
38
- SELECT 1
39
- FROM mentions barrel_m
40
- JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
41
- WHERE barrel_c.document_id = consumer_d.id
42
- AND barrel_m.role != 1
43
- AND barrel_m.symbol_id IN (
44
- SELECT m2.symbol_id
45
- FROM mentions m2
46
- JOIN chunks c2 ON m2.chunk_id = c2.id
47
- WHERE c2.document_id = ?
48
- AND m2.role != 1
49
- )
50
- ) THEN 1 ELSE 0 END) AS uses_barrel
51
- FROM mentions ref_m
52
- JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
53
- JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
54
- WHERE ref_m.symbol_id = ?
55
- AND ref_m.role != 1
56
- AND consumer_d.id != ?
57
- AND consumer_d.id != ?
58
- ${e.pathExclusionsFor("consumer_d")}
59
- GROUP BY consumer_d.id
60
- )`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function O(e,o,n){let r=[];for(let i of C(e,n))h(e,i,i)>0||r.push(...I(e,o,i));return r}function C(e,o){return d(e,{scope:o,includeIgnored:!1}).filter(n=>a(e,n).length>0||u(e,n).length>0)}function I(e,o,n){let r=a(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,[A(t.specifier)])),i=u(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,t.kind==="named"&&t.names.length>0?t.names:[t.kind==="star"?`* from ${t.sourcePath}`:`* namespace from ${t.sourcePath}`]));return[...r,...i]}function g(e,o,n,r,i){let t=o.definitionsForFile(r);return i.map(s=>{let c=t.find(E=>E.leaf===s);return{barrelFile:n,symbol:c?.symbol??`source-reexport:${n}:${s}`,shortName:c?l(c.symbol):s,originalFile:r,barrelConsumers:0,directConsumers:h(e,r,n),...b(e,n)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function b(e,o){return _(e,o)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function h(e,o,n){let r=new Set;for(let i of d(e,{includeIgnored:!1}))if(i!==n)for(let t of p(e,i))t.sourcePath===o&&r.add(i);return r.size}function D(e){let o=new Set,n=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(i)||(o.add(i),n.push(r))}return n}function y(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{$ as a};
61
- //# sourceMappingURL=chunk-FKGN4A4E.js.map
@@ -1,2 +0,0 @@
1
- import{L as c}from"./chunk-DGMCFMPG.js";import{H as p,J as u,m as a}from"./chunk-B5MHCHP3.js";var l=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return l.get(e,()=>f(e))}function f(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},t=new Map,s=0;for(let o of c(e)){let n=p(e,o);if(!(!n||!n.includes("scip-query")))for(let g of n.split(/\r?\n/)){let i=u(g);if(i===null)continue;s+=1,t.set(o,(t.get(o)??0)+1);let y=d(i);r[y]+=1}}return{total:s,byCategory:r,byFile:t}}function d(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
2
- //# sourceMappingURL=chunk-G4UQL4CP.js.map
@@ -1,6 +0,0 @@
1
- import{a as Z,c as ve,e as L,f as Ae,h as Te,k as ee,l as te,m as F}from"./chunk-A63U2W3P.js";import{a as N}from"./chunk-YLVE3SXZ.js";import{B as Y,E as Pe,G as Fe,a as he,b as Se,c as xe,f as k,h as Ie,m as Re,p as X}from"./chunk-B5MHCHP3.js";import{a as we}from"./chunk-64MNV6AB.js";import{b as Me,c as p}from"./chunk-35SQLYCQ.js";import{execFileSync as Ee}from"child_process";import{existsSync as ne,readFileSync as ot}from"fs";import{createRequire as st}from"module";import{platform as je}from"os";import{dirname as Be,join as C}from"path";var at=st(import.meta.url),Un={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function re(t){return[t.indexerBinary,...t.binaryAliases??[]]}function ct(t){let e=re(t);return e.length===1?e[0]:e.join(" or ")}function ie(t){for(let e of re(t))if(je()==="win32"){let n=ve(e);if(n)return n}else if(Z(e))return e;return lt(t)}function Kn(t){return ie(t)!==null||dt(t)}function dt(t){return De(t)!==null}function lt(t){let e=De(t);if(!e)return null;let r=JSON.parse(ot(e,"utf8")).bin;if(!r)return null;if(typeof r=="string")return C(Be(e),r);for(let i of re(t)){let o=r[i];if(o)return C(Be(e),o)}return null}function De(t){if(!t.bundledNpmPackage)return null;try{return at.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function ut(t,e){for(let n of t.projectLocalBinaries??[]){let r=C(e,n);if(ne(r))return r}return null}function pt(t,e){return ut(t,e)??ie(t)}function Qn(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||oe(n,e))return e;let r=ke(n,e);return r?{...e,DOTNET_ROOT:r}:e}function Xn(t,e){let n=ct(t),r=e?pt(t,e):ie(t);if(!r)return{language:t.language,binaryLabel:n,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:n,installed:!0,runnable:!0,resolvedBinary:r};let i=ft(r);return{language:t.language,binaryLabel:n,installed:!0,runnable:i.runnable,resolvedBinary:r,installUrl:t.installUrl,note:i.note}}function ft(t){if(oe(t,process.env))return{runnable:!0};let e=ke(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=Ne(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function ke(t,e){for(let n of Ne(e))if(oe(t,{...e,DOTNET_ROOT:n}))return n;return null}function Ne(t){let e=[],n=t.DOTNET_ROOT;if(n&&ne(n)&&e.push(n),je()==="darwin"&&Z("brew"))try{let r=Ee("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=C(r,"libexec");ne(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function oe(t,e){try{return Ee(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}function er(t,e,n={}){ee(t,Le(e,n),{durability:"visibility",runtime:n.runtime})}function tr(t,e,n={}){return ee(t,Le(e,n),{durability:"durable",runtime:n.runtime})}function Le(t,e){let n=JSON.stringify(t,null,e.spacing);return e.trailingNewline?`${n}
2
- `:n}import{execFileSync as mt}from"child_process";import{createHash as Ce}from"crypto";import{lstatSync as gt,readdirSync as yt,readFileSync as bt,readlinkSync as ht,realpathSync as Oe}from"fs";import{isAbsolute as St,join as qe,relative as xt,sep as Mt}from"path";function It(t){return[...new Set((t??[]).map(e=>e.trim()).filter(Boolean))].sort((e,n)=>e.localeCompare(n))}function Rt(t){return(Ft(t)??vt(t)).filter(e=>e&&!_e(e)).sort()}function wt(t,e={}){let n=Rt(t).filter(i=>!e.language||Se(i,e.language,e.markerFiles)).filter(i=>!e.includePath||e.includePath(i)),r=Oe(t);return n.map(i=>{let o=qe(t,i);try{if(gt(o).isSymbolicLink()){let a=Oe(o),d=xt(r,a);if(d===".."||d.startsWith(`..${Mt}`)||St(d))throw new Error("external symlink");let u=ht(o);return{path:i,size:Buffer.byteLength(u),hash:Ce("sha256").update("symlink\0").update(u).digest("hex")}}let s=bt(o);return{path:i,size:s.byteLength,hash:Ce("sha256").update(s).digest("hex")}}catch{return{path:i,size:-1,hash:"unreadable"}}})}function cr(t,e,n){return{version:2,languages:[...e].sort(),pnpmWorkspaces:n.typescriptProjectMode!=="workspace"&&n.pnpmWorkspaces===!0,typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:It(n.typescriptProjects),clojureConfigPath:Pt(n.clojureConfigPath),files:wt(t)}}function Pt(t){return t?.trim()||void 0}function Ft(t){try{return mt("git",["-C",t,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
3
- `).filter(Boolean)}catch{return null}}function vt(t){let e=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?qe(t,r):t,o;try{o=yt(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){_e(a)||n.push(a);continue}e.push(a)}}return e}function _e(t){let e=t.split("/");return t==="meta.json"||e.some(n=>At.has(n))||t.endsWith(".db")||t.endsWith(".db-wal")||t.endsWith(".db-shm")||t.endsWith(".scip")}var At=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);var Tt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return Tt.some(n=>e.endsWith(n))}function _(t){let e=q(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(c=>[c.path,c])),i=t.snapshot.files.filter(c=>{let g=he(c.path,["typescript"]);return g==="config"||g==="ambient"}).map(c=>c.path),o=q([...e,...i]),s=o.find(c=>!r.has(c)),a=new Set(t.snapshot.files.map(c=>c.path)).size!==t.snapshot.files.length,d=!s&&o.some(c=>$e(r.get(c))),u=X(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:q(t.snapshot.typescriptProjects),membership:e})),l=new Map;return{identityFor(c,g){if(!n.has(c))return I("target-outside-project");if(a)return I("duplicate-input-path");if(s)return I("missing-input-fingerprint");if(d)return I("unreadable-input");let h=[],f,S;if(t.graph===null)h.push("dependency-graph-unavailable"),S="whole-project",f=o;else{let D=Et(c,t.graph,l);if(D.find(Q=>!r.has(Q)))return I("missing-input-fingerprint");if(f=q([...D,...i]),f.some(Q=>$e(r.get(Q))))return I("unreadable-input");S="dependency-closure"}let j=f.map(D=>jt(r.get(D)));return{version:1,key:X(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:g,projectIdentity:u,inputs:j})),mode:S,inputFiles:f,reasons:h}}}}function Bt(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function Et(t,e,n){let r=n.get(t);if(r)return r;let i=Bt(t,e);return n.set(t,i),i}function jt(t){return{path:t.path,size:t.size,hash:t.hash}}function $e(t){return t.size<0||t.hash==="unreadable"}function I(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function q(t){return[...new Set(t)].sort()}import{createRequire as Dt}from"module";var Ge=Dt(import.meta.url),v,$;function kt(){if(v!==void 0)return v;try{v=Ge("ts-morph")}catch{v=null}return v}function G(){if($)return $;let t=kt();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=Ge("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function gr(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function yr(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var Nt=Re("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function se(t,e,n){let r=Nt.get(t,()=>Lt(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function A(t){return we(t,{includeIgnored:!1}).filter(O).sort()}function Lt(t){try{if(!t.generation.metadataRaw)return null;let e=k(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=xe(e.metadata.fingerprint);return n?{builder:_({projectFiles:A(t),snapshot:n,graph:N(t),engineIdentity:G()}),identities:new Map}:null}catch{return null}}function W(t,e){let n=new Map(t.map(i=>[i.symbol,i])),r=new Map(t.map(i=>[i.symbolId,[]]));for(let i of e.values())for(let o of i){let s=n.get(o.targetSymbol);s&&r.get(s.symbolId).push(o.location)}for(let[i,o]of r)r.set(i,Ct(o));return r}function ze(t,e,n){let r=Je(t,e),i=Je(t,n),o=[...r].filter(c=>!i.has(c)).sort(),s=[...i].filter(c=>!r.has(c)).sort(),a=We(t,e),d=We(t,n),u=[...a].filter(c=>!d.has(c)).sort(),l=[...d].filter(c=>!a.has(c)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:u.length===0&&l.length===0,expectedCount:a.size,actualCount:d.size,missing:u,extra:l}}}function We(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function vr(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,Ot(s));return i}function Je(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function Ct(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(He)}function Ot(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||He(n.location,r.location))}function He(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var ae="typescript-reference-fragment-v2",z=Pe({kind:"typescript-reference-fragments",invalidation:Fe("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:_t});function Cr(t,e,n,r=t){let i=A(t),o=_({projectFiles:i,snapshot:e,graph:N(t),engineIdentity:G()}),s=[...n].map(([a,d])=>({relativePath:a,contentHash:o.identityFor(a,ae).key,value:[...d]}));if(s.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return z.writeBatch(r,s.map(a=>({...a,contentHash:a.contentHash}))),s.length}function Or(t,e,n,r){let i=e.filter(s=>O(s.relativePath));if(i.length===0)return J("no TypeScript definitions");let o=J("shadow did not run");return Y("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=J("TypeScript reference fragment provider is unavailable"),o;let a=A(t),d=new Set(a),u=s.referenceFragmentsForFiles(a),l=W(i,u),c=ze(i,qt(n,d),l);if(!c.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...c},o;let g=[];for(let h of a){let f=se(t,h,ae);f?.key&&g.push({relativePath:h,contentHash:f.key,value:u.get(h)??[]})}return z.writeBatch(t,g),o={state:"passing",files:a.length,keyedFiles:g.length,writtenFiles:g.length,...c},o}catch(s){return o=J(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function qt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function qr(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return Y("typescript.reference-fragments.materialize",()=>{try{let d=A(t);i=d.length;let u=new Map,l=new Map,c=[];for(let f of d){let S=se(t,f,ae);if(!S?.key)return null;u.set(f,S.key);let j=z.read(t,f,S.key);j===null?(s+=1,c.push(f)):(o+=1,l.set(f,j))}if(s===0)return r="hit",{references:W(e,l),files:i,cacheHits:o,cacheMisses:s,computedFiles:a};let g=n(e[0].relativePath);if(!g.availability().available||!g.referenceFragmentsForFiles)return null;let h=g.referenceFragmentsForFiles(c);if(c.some(f=>!h.has(f)))return null;a=h.size,z.writeBatch(t,c.map(f=>({relativePath:f,contentHash:u.get(f),value:h.get(f)??[]})));for(let[f,S]of h)l.set(f,S);return r="computed",{references:W(e,l),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function J(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function _t(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every($t)?null:e}catch{return null}}function $t(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as Gt}from"crypto";import{existsSync as H,readFileSync as V,statSync as ue}from"fs";import{basename as Wt,dirname as pe,join as M}from"path";var Jt=1,zt=1,Ht=".scipquery-generations",Vt="manifest.json";function fe(t){return M(pe(t),Ht)}function Ut(t){try{let e=JSON.parse(V(M(fe(t),"state.json"),"utf8"));return nn(e)?e:null}catch{return null}}function Kt(t,e){return Qt(fe(t),e)}function Qt(t,e){try{let n=JSON.parse(V(M(t,e,Vt),"utf8"));return tn(n,e)?n:null}catch{return null}}function zr(t){let e=Ut(t.dbPath);if(e){let n=Yt(t,e.currentGeneration);if(n)return n;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(H(M(pe(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return Zt(t,e?.currentGeneration)}function Xt(t){return Ie(k(t))??t}function Yt(t,e){try{let n=M(fe(t.dbPath),e),r=Kt(t.dbPath,e);if(!r)return null;let i=ce(n,r.database),o=r.index?ce(n,r.index):void 0,s=r.metadata?ce(n,r.metadata):void 0;return!de(i,r.database)||r.index&&(!o||!de(o,r.index))||r.metadata&&(!s||!de(s,r.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:V(s,"utf8")}:{},source:"immutable"}}catch{return null}}function Zt(t,e){let n=Ve(t.dbPath),r=M(pe(t.dbPath),"meta.json"),i=H(r)?V(r,"utf8"):void 0,o=H(t.indexPath)?t.indexPath:void 0;return{identity:e??en(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:r,metadataRaw:i},source:"legacy",databaseFileIdentity:n}}function en(t,e){let n=Gt("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&n.update(Xt(e)),n.update(`\0${Ve(t)}`),n.digest("hex")}function Ve(t){let e=ue(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function ce(t,e){if(Wt(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return M(t,e.file)}function de(t,e){return H(t)&&ue(t).isFile()&&ue(t).size===e.size}function tn(t,e){return t.version===zt&&t.identity===e&&le(t.database)&&(t.index===void 0||le(t.index))&&(t.metadata===void 0||le(t.metadata))}function le(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function nn(t){return t.version===Jt&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&rn(t.stableMirrors)&&on(t.previousGeneration)&&sn(t.publication)}function rn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function on(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function sn(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,n=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(r=>r!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&n.every(r=>typeof r=="number"&&Number.isFinite(r)&&r>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}import{createHash as an,randomUUID as Ye}from"crypto";import{existsSync as P,lstatSync as E,mkdirSync as cn,readFileSync as B,readdirSync as w,renameSync as Ze,rmSync as x}from"fs";import{basename as me,dirname as dn,join as m}from"path";function U(t){return Array.isArray(t)?`[${t.map(U).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${JSON.stringify(e)}:${U(n)}`).join(",")}}`:JSON.stringify(t)}var ln=1,un=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),R=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},pn=".owner.json",fn={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function ti(t){return{rootDir:t,pendingDir:m(t,"pending"),inflightDir:m(t,"inflight"),responseDir:m(t,"responses"),deadLetterDir:m(t,"dead-letter"),legacyRequestDir:m(t,"requests")}}function mn(t={}){let e={...un,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function et(t){for(let e of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir])cn(e,{recursive:!0})}function ni(t,e){return an("sha256").update(U({namespace:t,payload:e})).digest("hex")}function gn(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function ri(t,e,n={}){let r=mn(n.limits),i=n.nowMs??Date.now();return et(t),Rn(e),bn(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??Te,()=>{yn(t,i,r);let o=m(t.pendingDir,`${e.id}.json`),s=m(t.responseDir,`${e.id}.json`),a=Ue(t,e.id);if(a){let c=Ke(a,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:s,authoritativeDeadlineAtMs:c.deadlineAtMs??e.deadlineAtMs}}let d=`${JSON.stringify(e)}
4
- `,u=Buffer.byteLength(d),l=tt(t);if(u>r.maxItemBytes)throw new R("item-too-large",l,r,u);if(l.totalItems+1>r.maxItems)throw new R("item-capacity",l,r,u);if(l.totalBytes+u>r.maxBytes)throw new R("byte-capacity",l,r,u);n.onBeforePublish?.();try{return te(o,d,{durability:"durable"}),{disposition:"accepted",requestId:e.id,responsePath:s,authoritativeDeadlineAtMs:e.deadlineAtMs}}catch(c){if(c.code!=="EEXIST")throw c;let g=Ue(t,e.id);if(!g)throw c;let h=Ke(g,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:s,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function yn(t,e,n,r=fn){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of ye(t.inflightDir)){if(o<=0)break;let a=m(t.responseDir,`${s.requestId}.json`);if(P(a)){x(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||Mn(t,s.ownerId,r)!=="dead")continue;let d=m(t.pendingDir,s.originalFile);try{Ze(s.path,d),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;x(s.path,{force:!0})}F(dn(s.path)),F(t.pendingDir),o--}o=Qe(t.responseDir,o,(s,a)=>wn(s)??a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Qe(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of nt(s)){if(o<=0)break;me(a).includes(".tmp-")&&(E(a).mtimeMs+n.temporaryRetentionMs>e||(x(a,{force:!0}),i.temporaryFilesRemoved++,o--))}}return Pn(t.inflightDir),i}function tt(t){et(t);let e=[...T(t.pendingDir).map(d=>({path:d,pending:!0})),...T(t.legacyRequestDir).map(d=>({path:d,pending:!0}))],n=ye(t.inflightDir).map(d=>({path:d.path,pending:!1})),r=T(t.responseDir).map(d=>({path:d,pending:!1})),i=T(t.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let d of e){let u=be(d.path);if(!u){s++;continue}let l=u.enqueuedAtMs??E(d.path).mtimeMs;a=a===void 0?l:Math.min(a,l)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((d,u)=>d+Fn(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function bn(t,e,n,r,i){let o=m(t.rootDir,".admission.lock"),s=`${process.pid}-${Ye()}`,a=r()+Math.max(0,n);for(;!hn(t.rootDir,o,s);){if(Sn(o),r()>=a)throw new R("admission-busy",tt(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return i()}finally{try{ge(o).ownerToken===s&&(x(o,{recursive:!0,force:!0}),F(t.rootDir))}catch{}}}function hn(t,e,n){let r=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
5
- `;try{return te(e,r,{durability:"durable"}),!0}catch(i){if(i.code==="EEXIST")return!1;try{ge(e).ownerToken===n&&(x(e,{force:!0}),F(t))}catch{}throw i}}function Sn(t){let e=null;try{let r=ge(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||xn(e))return;let n=`${t}.stale-${Ye()}`;try{Ze(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}x(n,{recursive:!0,force:!0})}function ge(t){try{return JSON.parse(B(t,"utf8"))}catch(e){if(e.code!=="EISDIR")throw e;return JSON.parse(B(m(t,"owner.json"),"utf8"))}}function xn(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function Mn(t,e,n){let r=In(m(t.inflightDir,rt(e),pn));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?Ae(r.processIdentity,i)?"live":"dead":"unknown"}function In(t){try{let e=JSON.parse(B(t,"utf8"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:L(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function Ue(t,e){for(let n of[m(t.pendingDir,`${e}.json`),m(t.legacyRequestDir,`${e}.json`),m(t.responseDir,`${e}.json`)])if(P(n))return n;for(let n of ye(t.inflightDir))if(n.requestId===e)return n.path;return null}function Ke(t,e,n){let r=be(t);if(!r||r.operationKey!==e)throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`);return r}function Rn(t){if(t.mailboxVersion!==ln||t.id!==gn(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function ye(t){if(!P(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=Xe(n.name);if(r===null)continue;let i=m(t,n.name);for(let o of w(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=Xe(s[1]),d=Number(s[2]);if(a===null||me(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(d))continue;let u=m(i,o.name),l=be(u)??{id:me(a,".json")},c=E(u);e.push({requestId:l.id,ownerId:r,path:u,originalFile:a,claimedAtMs:c.mtimeMs,claimExpiresAtMs:d,byteLength:c.size,...l.operationKey?{operationKey:l.operationKey}:{},...l.clientId?{clientId:l.clientId}:{},...l.enqueuedAtMs===void 0?{}:{enqueuedAtMs:l.enqueuedAtMs},...l.deadlineAtMs===void 0?{}:{deadlineAtMs:l.deadlineAtMs},legacy:l.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function be(t){try{let e=JSON.parse(B(t,"utf8"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function wn(t){try{let e=JSON.parse(B(t,"utf8"));return typeof e.expiresAtMs=="number"&&Number.isFinite(e.expiresAtMs)?e.expiresAtMs:null}catch{return null}}function Qe(t,e,n,r,i){for(let o of T(t)){if(e<=0)break;let s=E(o);n(o,s.mtimeMs)>r||(x(o,{force:!0}),i(),e--)}return e}function T(t){return P(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>m(t,e.name)).sort():[]}function nt(t){if(!P(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){let r=m(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...nt(r))}return e.sort()}function Pn(t){if(P(t))for(let e of w(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=m(t,e.name);w(n).some(r=>r.endsWith(".claim"))||x(n,{recursive:!0,force:!0})}}function Fn(t){try{return E(t).size}catch{return 0}}function rt(t){return Buffer.from(t,"utf8").toString("base64url")}function Xe(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return rt(e)===t?e:null}catch{return null}}import{readFileSync as vn}from"fs";import{join as K}from"path";var An="watch.lock",Tn="watch-state.json",Bn="watch-activity.json",En="watch-refresh-requests";function di(t){return{lockPath:K(t,An),statePath:K(t,Tn),activityPath:K(t,Bn),refreshRequestsPath:K(t,En)}}function li(t){try{return jn(JSON.parse(vn(t,"utf8")))}catch{return null}}function jn(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!b(e.startedAt)||!b(e.heartbeatAt)||!b(e.lastActivityAt)||!Dn(e.watcher)||e.idleDeadlineAt!==void 0&&!b(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=L(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!kn(e.lastError)||e.lastRefresh!==void 0&&!Nn(e.lastRefresh)||e.reindexActivity!==void 0&&!Ln(e.reindexActivity)||e.refreshRequests!==void 0&&!Cn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!On(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!qn(e.typescriptIndex)?null:e}function b(t){return Me(t)}function Dn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return y(e.changedFiles)&&y(e.reindexAt);case"indexing":return y(e.startedAt);case"cooldown":return y(e.until)&&typeof e.dirty=="boolean";case"draining":return y(e.startedAt)&&typeof e.reason=="string";default:return!1}}function kn(t){if(!t||typeof t!="object")return!1;let e=t;return b(e.at)&&typeof e.message=="string"}function Nn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&b(e.startedAt)&&b(e.completedAt)&&y(e.durationMs)}function Ln(t){if(!t||typeof t!="object")return!1;let e=t;return!b(e.windowStartedAt)||!b(e.windowEndedAt)||!p(e.runs)||!p(e.rebuilt)||!p(e.reused)||!p(e.failed)||!p(e.suppressed)||!y(e.estimatedLogicalOutputBytes)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"?!1:Object.values(e.byTrigger).every(n=>n===void 0||p(n))}function Cn(t){if(!t||typeof t!="object")return!1;let e=t;return p(e.pending)&&p(e.claimed)&&p(e.completed)&&p(e.expired)&&p(e.invalid)&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function On(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&y(e.requests)&&y(e.sessionsCreated)&&y(e.sessionsReused)&&y(e.sessionsRefreshed)&&y(e.sessionsReplaced)&&y(e.projectsCreated)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||it(e.mailbox))}function qn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&p(e.requests)&&p(e.sessionsCreated)&&p(e.sessionsReplaced)&&p(e.initializations)&&p(e.programUpdates)&&p(e.documentsEmitted)&&p(e.documentsRemoved)&&(e.lastRequestAt===void 0||b(e.lastRequestAt))&&(e.lastDurationMs===void 0||y(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||b(e.busyUntil))&&(e.mailbox===void 0||it(e.mailbox))}function it(t){if(!t||typeof t!="object")return!1;let e=t;return p(e.pending)&&p(e.inflight)&&p(e.responses)&&p(e.deadLetters)&&p(e.invalid)&&p(e.totalItems)&&y(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||b(e.oldestPendingAt))}function y(t){return typeof t=="number"&&Number.isFinite(t)}export{Jt as a,zt as b,Ht as c,Vt as d,fe as e,Ut as f,Kt as g,Qt as h,zr as i,Xt as j,Ve as k,Un as l,ct as m,ie as n,Kn as o,ut as p,Qn as q,Xn as r,U as s,er as t,tr as u,ln as v,ti as w,ni as x,gn as y,ri as z,It as A,wt as B,cr as C,di as D,li as E,Tt as F,O as G,kt as H,gr as I,yr as J,vr as K,_ as L,se as M,Cr as N,Or as O,qr as P};
6
- //# sourceMappingURL=chunk-GA64UPMI.js.map
@@ -1,2 +0,0 @@
1
- import{a as Ne}from"./chunk-3OIKRYU5.js";import{a as Ge}from"./chunk-NN4ZIRPK.js";import{a as pe,b as D,e as he}from"./chunk-P6HBYNBE.js";import{a as be,c as Se,d as Ce,e as F}from"./chunk-24QNP7MN.js";import{a as Ee}from"./chunk-PC44K7RF.js";import{a as Te}from"./chunk-MLGTCX56.js";import{a as Ie}from"./chunk-6YTSKJJ3.js";import{a as ve}from"./chunk-WXAAURU7.js";import{a as De}from"./chunk-KLVJABXA.js";import{a as Fe}from"./chunk-U5CNPPTZ.js";import{a as Re}from"./chunk-GK3GRUJX.js";import{a as we}from"./chunk-TFUU5MQQ.js";import{b as ye}from"./chunk-IYAOX36F.js";import{a as me,b as ge}from"./chunk-JELJLXEE.js";import{a as de,b as fe,c as ue,g as z,h as V}from"./chunk-4CGVLUDP.js";import{b as ke}from"./chunk-LRTP3DKL.js";import{a as H,c as ae,d as ce,e as le}from"./chunk-QHKUY4FW.js";import{a as se}from"./chunk-OHWZKLVA.js";import{a as Ae,e as xe}from"./chunk-26X7KCJR.js";import{a as N,c as j,d as B,e as $e}from"./chunk-47X75ZKH.js";import{c as oe}from"./chunk-XVJ3V7LM.js";import{f as I,g as E}from"./chunk-WMXRRBII.js";import{e as ne}from"./chunk-JERWGHQT.js";import{u as re}from"./chunk-GA64UPMI.js";import{d as _,e as v,f as ie,g as O}from"./chunk-ZTTISZ7J.js";import{a as te}from"./chunk-7LABSJSR.js";import{e as Q}from"./chunk-DGMCFMPG.js";import{B as ee}from"./chunk-B5MHCHP3.js";import{createHash as St}from"crypto";import{existsSync as L}from"fs";function U(e){let[i,t]=A(e,":"),r=i||"unknown",n=(s={})=>{let a=s.actionTier??Ze(r);return{sourceAnalyzer:r,actionTier:a,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${r} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??Qe(a,r),file:s.file}};if(!t)return n({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[s,a]=A(t,":");return n({file:s,relatedFiles:s?[s]:[],rootCauseKey:a?`${s}:${a}`:t,label:`${r} finding`,why:a?[`Baseline subject: ${a}.`]:[]})}if(r==="cycle"){let s=t.split(">").filter(Boolean);return n({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(r==="similar"){let s=t.split("|").filter(Boolean);return n({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(r==="architecture"){let[s,a]=A(t,":");if(s==="forbidden-edge"){let[c,l]=A(a,":"),o=P(c),f=P(l);return n({actionTier:"direct",rootCauseKey:t,label:"architecture boundary violation",why:[`Declared boundary rule rejects ${o} -> ${f}.`],remediation:`Move the dependency behind an allowed boundary, or deliberately update the ${o} dependency rule and baseline.`})}if(s==="cycle"){let c=a.split("|").filter(Boolean).map(P);return n({actionTier:"direct",rootCauseKey:t,label:"forbidden architecture cycle",why:[`requireAcyclic rejects the connected boundary group: ${c.join(", ")}.`],remediation:"Break the boundary cycle, or deliberately revise the acyclicity rule and baseline."})}if(s==="missing-policy-row"){let c=P(a);return n({actionTier:"direct",rootCauseKey:t,label:"incomplete architecture policy",why:[`requireCompletePolicy rejects the missing outgoing dependency row for ${c}.`],remediation:`Declare the allowed outgoing dependencies for ${c}, including an empty row when it must depend on nothing.`})}}if(r==="drift"){let[s,a]=A(t,":"),[c,l]=A(a,":");return n({actionTier:s==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,l].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...l?[`Related dependency: ${l}.`]:[]]})}return n({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function Ze(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":case"architecture":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function Qe(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function A(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}function P(e){try{return decodeURIComponent(e)}catch{return e}}import{existsSync as et,readFileSync as tt}from"fs";import{isAbsolute as it,join as nt}from"path";var rt=".scipquery-baseline.json";function q(e){if(e.startsWith("similar:")){let i=e.slice(8).split("|");return i.length!==2?e:`similar:${i.map(_).sort().join("|")}`}if(e.startsWith("duplicate-bodies:")){let i=e.slice(17),t=i.indexOf(":");if(t<0)return e;let r=i.slice(0,t),n=i.slice(t+1).split("|");return n.length<2?e:`duplicate-bodies:${r}:${n.map(_).sort().join("|")}`}return e}function x(e,i){return i&&it(i)?i:nt(e.config.projectRoot,i??rt)}function K(e,i,t={}){let r=x(e,t.path);if(!et(r))throw new Error(`No baseline found at ${r}. Create one with: scip-query health --write-baseline`);let s=(JSON.parse(tt(r,"utf-8")).findings??[]).map(q),a=new Set(t.accept?s.filter(t.accept):s),c=new Set(i);return{baselinePath:r,baselineCount:a.size,current:[...i],newFindings:i.filter(l=>!a.has(l)),fixedFindings:[...a].filter(l=>!c.has(l))}}var ot=25e3,st=2500,at=2500;function ct(e){let i=Ie(e);return i.symbols>=ot||i.documents>=st?at:void 0}function je(e,i={}){let{scope:t}=i,r=ct(e),n=[],s=ke(e,{scope:t,...F.dead,scanLimit:r});for(let a of s.symbols)I(e,a.relativePath)||E(e,a.symbol,a.relativePath)||a.kind==="dead-code"&&n.push(`dead:${a.relativePath}:${a.shortName}`);for(let a of De(e,{scope:t,...F.isolated,scanLimit:r}))I(e,a.relativePath)||E(e,a.symbol,a.relativePath)||n.push(`isolated:${a.relativePath}:${a.shortName}`);for(let a of we(e,{scope:t}))a.kind==="real"&&n.push(`cycle:${lt(a.path)}`);for(let a of xe(e,{scope:t,...F.similar,scanLimit:r}))n.push(`similar:${[a.symbolA,a.symbolB].sort().join("|")}`);for(let a of me(e,{scope:t,...F.duplicateBodies,scanLimit:r}))n.push(`duplicate-bodies:${a.hash}:${a.functions.map(c=>c.symbol).sort().join("|")}`);for(let a of Re(e,{scope:t,...F.extract,scanLimit:r}))n.push(`extract:${a.relativePath}:${a.shortName}`);for(let a of Ee(e,{scope:t,...F.wrappers,scanLimit:r}))n.push(`wrapper:${a.file}:${a.shortName}`);for(let a of ve(e,{scope:t,...F.passthroughs,scanLimit:r}))n.push(`passthrough:${a.file}:${a.shortName}`);for(let a of Te(e,{scope:t,...F.stale,scanLimit:r}))n.push(`stale:${a.file}:${a.shortName}`);for(let a of Fe(e,{scope:t,...F.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY}).results)a.kind!=="architecture-violation"&&n.push(`drift:${a.kind}:${a.file}:${a.dep}`);return n.push(...B(j(e,{scope:t}))),[...new Set(n.map(q))].sort()}function lt(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function yi(e,i={}){let t=je(e,{scope:i.scope}),r=x(e,i.path);return re(r,{version:1,findings:t},{spacing:2,trailingNewline:!0}),{path:r,findingCount:t.length}}function Be(e,i={}){return K(e,je(e,{scope:i.scope}),{path:i.path})}function Pe(e,i={}){let t=B(j(e,{scope:i.scope}));return K(e,t,{path:i.path,accept:r=>r.startsWith(N)})}import{existsSync as dt,readdirSync as ft,readFileSync as ut}from"fs";import{createHash as pt}from"crypto";import{join as X}from"path";function J(e){let i=0,t=0,r=0,n=0,s=0,a=[];for(let o of e)switch(o.state){case"legacy":i+=1;break;case"current":t+=1;break;case"unsupported-older":r+=1,a.push(W(o));break;case"unsupported-future":n+=1,a.push(W(o));break;case"malformed":s+=1,a.push(W(o));break}let c=i+t,l=r+n+s;return{complete:l===0,total:e.length,accepted:c,legacy:i,current:t,unsupportedOlder:r,unsupportedFuture:n,malformed:s,omitted:l,issues:a}}function W(e){if(e.state==="legacy"||e.state==="current")throw new Error(`accepted record ${e.path} cannot become a compatibility issue`);return{path:e.path,state:e.state,reason:e.reason??e.state}}var Me=X(".scipquery","suppressions"),Ke="scip-query-suppression",Y=1;function ht(e){return X(e,Me)}function mt(e){if(e.id&&e.id.trim()!=="")return`${e.id.trim()}.json`;let i=`${e.check??""}\0${e.file??""}`;return`CHECK-${pt("sha256").update(i).digest("hex").slice(0,12).toUpperCase()}.json`}function gt(e){return mt(e).slice(0,-5)}function yt(e,i){if(typeof e!="object"||e===null||Array.isArray(e))return{state:"malformed",error:"not a suppression object"};let t=e;if(t.schemaVersion===void 0&&(t.kind!==void 0||t.suppressionIdentity!==void 0||t.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(t.schemaVersion!==void 0){if(!Number.isSafeInteger(t.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(t.schemaVersion!==Y)return{state:t.schemaVersion>Y?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(t.schemaVersion)}`};if(t.kind!==void 0&&t.kind!==Ke)return{state:"malformed",error:`kind must be ${Ke}`}}if(typeof t.reason!="string"||t.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!t.id&&!t.check)return{state:"malformed",error:"needs an id or a check"};let r=bt(t);if(t.schemaVersion===void 0)return{state:"legacy",suppression:r,record:t,schemaVersion:0};let n=gt(r);return t.suppressionIdentity!==n||i!==void 0&&t.suppressionIdentity!==i?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!t.writer||t.writer.tool!=="scip-query"||typeof t.writer.version!="string"||t.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:t.updatedAt!==void 0&&(typeof t.updatedAt!="string"||!Number.isFinite(Date.parse(t.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:"current",suppression:r,record:t,schemaVersion:Y}}function Le(e){let i=ht(e);if(!dt(i))return{suppressions:[],compatibility:J([]),warnings:[]};let t=[],r=[];for(let s of ft(i).sort()){if(!s.endsWith(".json"))continue;let a=X(i,s),c=`${Me}/${s}`,l;try{l=JSON.parse(ut(a,"utf-8"))}catch{r.push({path:c,state:"malformed",reason:"malformed JSON"});continue}let o=yt(l,s.slice(0,-5));if("error"in o){r.push({path:c,state:o.state,reason:o.error});continue}r.push({path:c,state:o.state}),t.push(o.suppression)}let n=J(r);return{suppressions:t,compatibility:n,warnings:n.issues.map(s=>`${s.path}: ${s.reason} \u2014 ignored`)}}function bt(e){return{...typeof e.id=="string"?{id:e.id}:{},...typeof e.check=="string"?{check:e.check}:{},...typeof e.file=="string"?{file:e.file}:{},reason:e.reason,...typeof e.expiresAt=="string"?{expiresAt:e.expiresAt}:{},...typeof e.createdAt=="string"?{createdAt:e.createdAt}:{}}}var en=["echo","incomplete-migration","co-change-partner","twin-partner","coverage-contract","architecture","doc-reference","unused-params","new-dead","baseline"];function tn(e,i={}){let t=i.base??"HEAD",{minTogether:r=6,minConfidence:n=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:a=Number.POSITIVE_INFINITY,minSimilarity:c=.8,includeBaseline:l=!1,scanLimit:o}=i,f=i.semantic!==!1,h=i.historyMode??"bounded",u=new Set(i.skip??[]),p=Le(e.config.projectRoot),m=ue(e,{base:t}),y=fe(e,{base:t,plan:m}),S=y.changedFiles,d=new Set(S),w=new Set(m.changedFileLines),$=new Set([...d,...w]),C=z(e.config.projectRoot,t,V(m,S)),T=Ut(e.config.projectRoot,t,m,C),g={base:t,changedFiles:S,changedSymbols:y.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],attributionNotes:y.attributionNotes,rootCauseGroups:[],recordCompatibility:{suppressions:p.compatibility},note:y.summary.note};if(S.length===0)return g;let k=(G,We)=>{if(u.has(G)){g.skipped.push({check:G,reason:"skipped via --skip"});return}let Je=g.findings.length,Ye=g.skipped.length,Xe=g.checksRun.length;ee(`diff-gate.check.${G}`,We,()=>({check:G,changedFiles:S.length,changedSymbols:y.changedSymbols.length,findingsAdded:g.findings.length-Je,skippedAdded:g.skipped.length-Ye,checksRunAdded:g.checksRun.length-Xe}))};return k("echo",()=>kt(e,y.changedSymbols,d,T,s,c,o,f,g)),k("incomplete-migration",()=>xt(e,t,m,a,o,f,C,g)),k("co-change-partner",()=>Tt(e,$,r,n,h,g)),k("twin-partner",()=>It(e,y.changedSymbols,d,o,g)),k("coverage-contract",()=>Et(e,$,g)),k("architecture",()=>Jt(e,g)),k("doc-reference",()=>Pt(e,d,w,m.changedRanges,m.renamedFiles,g)),k("unused-params",()=>_t(e,S,g)),k("new-dead",()=>Ot(e,y.changedSymbols,T,g)),l&&k("baseline",()=>Wt(e,g)),$t(g,[...e.config.suppressions??[],...p.suppressions]),g.rootCauseGroups=Ct(g.findings),g}function nn(e){return e.checksRun.length===0&&e.note===de}function rn(e){return e.filter(i=>!i.advisory)}function Ct(e){let i=new Map;for(let t of e){let r=t.groupKey??`${t.check}:${t.id}`,n=i.get(r);n||(n={groupKey:r,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(r,n)),n.count+=1,n.findingIds.push(t.id),n.severity=Ue(n.severity,t.severity),n.actionTier=qe(n.actionTier,t.actionTier),t.file&&n.files.add(t.file);for(let s of t.relatedFiles??[])n.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,r)=>r.count-t.count||M(r.severity)-M(t.severity)||t.groupKey.localeCompare(r.groupKey))}function Ue(e,i){return M(i)>M(e)?i:e}function M(e){return e==="error"?2:e==="warning"?1:0}function qe(e,i){return e?i&&_e(i)>_e(e)?i:e:i}function _e(e){return e==="direct"?2:e==="signal"?1:0}function $t(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let r of e.findings){let n=i.find(s=>wt(s,r));n?e.suppressed.push({finding:r,suppression:n}):t.push(r)}e.findings=t}function wt(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id&&!i.legacySuppressionIds?.includes(e.id)||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function R(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function kt(e,i,t,r,n,s,a,c,l){l.checksRun.push("echo");for(let o of i.slice(0,n)){if(!O(o.symbol)||r(o))continue;let f=ge(e,o.symbol,{maxLoc:15,scanLimit:a}).filter(d=>!t.has(d.file)).slice(0,5).map(d=>({otherFile:d.file,otherShort:d.shortName,otherSymbol:d.symbol,similarity:1,similarityBasis:"exact-body",sharedEvidence:[`exact normalized body (${d.loc} LOC)`]}));if(f.length>0){let d=b("echo",o.symbol,o.file),w=b("echo",o.symbol,o.file,...f.map(C=>`${C.otherSymbol}|${C.otherFile}`).sort()),$=f[0];R(l,{id:d,legacySuppressionIds:w===d?void 0:[w],groupKey:d,actionTier:"direct",check:"echo",severity:"warning",evidence:"heuristic",confidence:1,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(f.map(C=>C.otherFile))].sort(),sourceAnalyzer:"duplicate-bodies",rootCauseKey:`${o.symbol}:${$.otherSymbol}`,message:He(o,f),why:ze(o,f),remediation:Ve("direct",o.shortName,$.otherShort)});continue}let h=Ae(e,o.symbol,{minSimilarity:s,limit:5,scanLimit:a,semantic:c,sourceCandidateMode:"target-pruned"}),u=[];for(let d of h){let w=d.fileA===o.file?d.fileB:d.fileA,$=d.fileA===o.file?d.shortNameB:d.shortNameA,C=d.fileA===o.file?d.symbolB:d.symbolA;t.has(w)||u.push({otherFile:w,otherShort:$,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(u.length===0)continue;let p=u[0],m=b("echo",o.symbol,o.file,...u.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),y=b("echo",o.symbol,o.file),S=Ft(o,u);R(l,{id:y,legacySuppressionIds:m===y?void 0:[m],groupKey:y,actionTier:S,check:"echo",severity:"warning",evidence:"heuristic",confidence:p.similarity,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(u.map(d=>d.otherFile))].sort(),message:He(o,u),why:ze(o,u),remediation:Ve(S,o.shortName,p.otherShort)})}i.length>n&&l.skipped.push({check:"echo",reason:`echo check capped at ${n} of ${i.length} changed symbols`})}function Ft(e,i){return i.some(r=>Rt(e.symbol,r))?"direct":"signal"}function Rt(e,i){if(i.similarityBasis==="exact-body")return!0;if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=v(e),r=v(i.otherSymbol);return!t||!r?!1:t===r?!0:At(i.sharedEvidence)?!1:Dt(t,r)}function Dt(e,i){let t=Oe(e),r=Oe(i);if(t.length===0||r.length===0)return!1;let n=new Set(r),s=t.filter(a=>n.has(a)).length;return s>=2&&s/Math.min(t.length,r.length)>=.5}function Oe(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var vt=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function At(e){return e.length>=3&&e.every(i=>vt.has(i.toLowerCase()))}function He(e,i){let t=i[0],r=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${t.otherShort} (${t.otherFile})`}function ze(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))t.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),t.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function Ve(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function xt(e,i,t,r,n,s,a,c){let l=Ge(e,{base:i,maxHelpers:r,diffPlan:t,scanLimit:n,semantic:s,baseContentAt:a});if(!l.available){c.skipped.push({check:"incomplete-migration",reason:"no git history"});return}c.checksRun.push("incomplete-migration"),l.note&&c.skipped.push({check:"incomplete-migration",reason:l.note});for(let o of l.findings){let f=o.leftovers.map(d=>`${d.shortName} (${d.file}, ${Math.round(d.containment*100)}% helper / ${Math.round(d.siteCoverage*100)}% site, ${d.migrationScope})`).join(", "),h=o.leftovers.map(d=>`${d.shortName}: ${d.migrationScope} (${d.migrationScopeReasons[0]})`).join("; "),u=[...o.migratedFiles,...o.leftovers.map(d=>d.file)],p=o.leftovers.length===0?void 0:Math.max(...o.leftovers.map(d=>Math.min(d.containment,d.siteCoverage))),m=o.leftovers.some(d=>d.migrationScope==="possible-subtype"),y=b("incomplete-migration",o.helperSymbol,o.helperFile,u.join("|")),S=b("incomplete-migration",o.helperSymbol,o.helperFile);R(c,{id:S,legacySuppressionIds:y===S?void 0:[y],check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:p,file:o.helperFile,symbol:o.helperSymbol,relatedFiles:u,message:`new helper ${o.helperShortName} (${o.helperFile}) is wired into ${o.migratedFiles.length} file(s), but ${o.leftovers.length} similar un-migrated site(s) remain: ${f}`,why:[`${o.helperShortName} is new in this diff and already referenced by ${o.migratedFiles.join(", ")}.`,`Helper shape: ${o.helperShape}; ${o.specificHelperCalleeCount}/${o.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${f}.`,`Migration scope hints: ${h}.`],remediation:m?`Migrate same-scope sites to ${o.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${o.helperShortName}, or confirm they are intentionally different.`})}}function Tt(e,i,t,r,n,s){let a=se(e,{historyMode:n}).directionalCoChangePairsForFiles(i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!a){s.skipped.push({check:"co-change-partner",reason:"no git history"});return}s.checksRun.push("co-change-partner");let c=new Set,l;for(let o of a){let f=i.has(o.fileA),h=i.has(o.fileB);if(f===h)continue;let u=f?o.fileA:o.fileB,p=f?o.fileB:o.fileA,m=f?o.changesA:o.changesB,y=m>0?o.together/m:0;if(y<r||H(p)||H(u)||!L(`${e.config.projectRoot}/${p}`))continue;let S=`${u}|${p}`;if(c.has(S))continue;c.add(S);let d=b("co-change-partner",u,p,String(o.together)),w=b("co-change-partner",u,p),$=ae(u,p),C=ce({fileA:u,fileB:p,together:o.together,confidence:y,commitScope:o.commitScope,recency:o.recency,subjectContext:o.subjectContext},$,(l??=le(e))(u,p)),T=[u,p].sort().join("|");s.findings.push({id:w,legacySuppressionIds:d===w?void 0:[d],check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${T}`,confidence:y,file:u,relatedFiles:[p],sourceAnalyzer:"co-change",rootCauseKey:T,partnerClass:$.partnerClass,partnerClassReasons:$.reasons,commitScope:o.commitScope,recency:o.recency,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:o.broadCommitRatio,lastTogetherAt:o.lastTogetherAt,recentTogether:o.recentTogether,subjectContext:o.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${u} changed, but ${p} did not \u2014 they change together ${o.together}x (${Math.round(y*100)}% of the time)`,why:[`${u} is in this diff and ${p} is not.`,`Git history shows ${o.together} co-change(s), which is ${Math.round(y*100)}% of changes to the edited side.`,`History context: ${Gt(o)}.`,`Subject context: ${Nt(o.subjectContext)}.`,...jt(o),`Partner class: ${$.partnerClass} (${$.reasons.join("; ")}).`],remediation:C?`Update ${p} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${p} alongside this change, or confirm the coupling no longer holds.`})}}function It(e,i,t,r,n){n.checksRun.push("twin-partner");let s=ye(e,{scanLimit:r}).filter(l=>l.relationship==="divergent"||l.relationship==="identical");if(s.length===0)return;let a=new Map;for(let l of s)for(let o of l.members)a.set(o.symbol,l);let c=new Set;for(let l of i){if(!O(l.symbol))continue;let o=a.get(l.symbol);if(!o)continue;let f=o.members.filter(m=>m.symbol!==l.symbol&&!t.has(m.file));if(f.length===0)continue;let h=[l.symbol,...f.map(m=>m.symbol)].sort().join("|");if(c.has(h))continue;c.add(h);let u=f[0],p=b("twin-partner",l.symbol,l.file,u.symbol);R(n,{id:p,groupKey:`twin-partner:${h}`,check:"twin-partner",severity:"warning",evidence:"heuristic",actionTier:"signal",advisory:!0,confidence:o.relationship==="identical"?1:Math.max(0,1-o.maxDivergence),file:l.file,symbol:l.symbol,relatedFiles:f.map(m=>m.file).sort(),sourceAnalyzer:"twin-drift",rootCauseKey:h,message:`${l.shortName} (${l.file}) changed but its same-name twin ${u.shortName} (${u.file}) did not \u2014 verify the change shouldn't apply to both, or consolidate them.`,why:[`${l.symbol} is in this diff.`,`${u.symbol} shares its (near-)name and is classified '${o.relationship}' with it, but ${u.file} is not in this diff.`,o.relationship==="divergent"?`The two bodies already diverge (~${Math.round(o.maxDivergence*100)}% token difference) \u2014 this diff may widen or narrow that drift.`:"The two bodies were byte-identical before this diff.","Advisory: twin-partner never fails the gate by itself \u2014 see the twin-partner entry in the diff-gate checks table."],remediation:`Update ${u.file} alongside this change, consolidate ${l.shortName}/${u.shortName} into one helper, or confirm the twin should diverge on purpose.`})}}function Et(e,i,t){t.checksRun.push("coverage-contract");let r=e.config.coverageContracts??[];for(let n of r){if(!Se(n,i))continue;let s=be(e,n);if(s.status==="ok")continue;let a=b("coverage-contract",n.name,n.file);R(t,{id:a,groupKey:`coverage-contract:${n.name}`,check:"coverage-contract",severity:s.status==="unavailable"?"warning":"error",evidence:"graph-fact",actionTier:"direct",file:n.file,sourceAnalyzer:"coverage-contracts",rootCauseKey:n.name,message:Ce(s),why:[`Contract "${n.name}" declares that ${n.file} (${n.keys.type}) must track ${n.mustEqual.type}.`,s.status==="unavailable"?`The declared side could not be evaluated: ${s.unavailableReason}.`:`Missing: ${s.missing.join(", ")||"none"}. Extra: ${s.extra.join(", ")||"none"}.`,"Either side of this contract changed in this diff."],remediation:s.status==="unavailable"?"Investigate why the declared key set could not be parsed (see the reason above) \u2014 do not treat this as a pass.":`Update ${n.file} so its ${n.keys.type==="object-literal-keys"||n.keys.type==="string-array"?n.keys.identifier:n.keys.marker} matches ${n.mustEqual.type}, or fix the ground-truth source if the declared set is right.`})}}function Gt(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Bt(e.lastTogetherAt)}`}function Nt(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(n=>`"${n}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function jt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function Bt(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}var Z=3;function Pt(e,i,t,r,n,s){s.checksRun.push("doc-reference");let a=D.referenceTargets(e,i,r);if(a.size===0)return;let c=new Set(n.map(o=>o.from)),l=[];for(let o of he(e,a))t.has(o.doc)||pe(e,o.doc)||l.push(Kt(e,o,c));for(let o of Mt(l))R(s,o)}function Kt(e,i,t){let r=i.citedClaims.length>0?i.citedClaims:D.citationContexts(e,i.doc,i.cited),n=D.classifyCitation(r),s=D.hasLineAnchoredCitation(i.citations),a=i.cited.some(h=>t.has(h)||!L(`${e.config.projectRoot}/${h}`)),c=!(s||a),l=i.cited[0]??"",o=b("doc-reference",i.doc,i.cited.join("|")),f=b("doc-reference",i.doc,l);return{id:f,legacySuppressionIds:o===f?void 0:[o],check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:n.actionTier,groupKey:`doc-reference:${l}`,rootCauseKey:l,confidence:1,file:i.doc,relatedFiles:i.cited,citationKind:n.citationKind,citationKindReasons:n.reasons,citedClaims:r,...c?{advisory:!0}:{},message:`${i.doc} cites ${i.cited.join(", ")} as ${D.citationKindLabel(n.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${i.cited.join(", ")} changed in this diff.`,`${i.doc} cites the changed file(s) but was not updated in the same diff.`,...n.reasons.map(h=>`Citation kind evidence: ${h}`),c?"Advisory: bare file-mention citation (no line anchor, cited file still present under the same path) \u2014 21.2 calibration found this citation shape low-precision; verify at your leisure.":s?"Blocking: citation includes a line anchor that may now point at the wrong lines.":"Blocking: the cited file was deleted or renamed in this diff \u2014 the citation almost certainly needs an update."],remediation:D.citationRemediation(n.citationKind,i.doc)}}function Mt(e){let i=new Map;for(let r of e){let n=r.rootCauseKey??"",s=i.get(n);s?s.push(r):i.set(n,[r])}let t=[];for(let[r,n]of i)n.length<=Z?t.push(...n):t.push(Lt(r,n));return t}function Lt(e,i){let t=[...i].sort((f,h)=>(f.file??"").localeCompare(h.file??"")),r=t.slice(0,Z).map(f=>({doc:f.file??"",citedClaims:f.citedClaims??[]})),n=t.length-r.length,s=t.every(f=>f.advisory===!0),a=t.reduce((f,h)=>Ue(f,h.severity),"info"),c=t.reduce((f,h)=>qe(f,h.actionTier),void 0),l=t.map(f=>f.file??"").filter(f=>f.length>0),o=[...new Set(t.flatMap(f=>[f.id,...f.legacySuppressionIds??[]]))];return{id:b("doc-reference","hub-cluster",e),memberFindingIds:o,check:"doc-reference",severity:a,evidence:"change-graph",actionTier:c,groupKey:`doc-reference:${e}`,rootCauseKey:e,confidence:1,file:r[0]?.doc,relatedFiles:[e],citationCount:t.length,citationExemplars:r,suppressedCount:n,...s?{advisory:!0}:{},message:`${e} is cited by ${t.length} doc(s) changed in this diff, doc(s) untouched \u2014 showing ${r.length} example(s), ${n} more damped`,why:[`${e} changed in this diff.`,`${t.length} doc(s) cite it but were not updated in the same diff: ${l.join(", ")}.`,...r.map(f=>`Example \u2014 ${f.doc}: ${f.citedClaims[0]??"(no captured citation text)"}`),`${n} additional doc(s) also cite this file, past the per-hub-file cascade cap (${Z}) \u2014 not silently dropped: counted in citationCount/suppressedCount and individually addressable via memberFindingIds.`,s?"Advisory: every citation in this cluster is a bare file-mention (no line anchor, cited file still present).":"Blocking: at least one citation in this cluster is line-anchored or cites a deleted/renamed file."],remediation:`Review the ${r.length} example doc(s) above; ${t.length} total doc(s) cite ${e} the same way \u2014 see citationExemplars and memberFindingIds in --json for the complete list.`}}function _t(e,i,t){t.checksRun.push("unused-params");for(let r of Ne(e,{files:i,limit:50})){let n=b("unused-params",r.symbol,r.file,r.unusedTrailing.join("|")),s=b("unused-params",r.symbol,r.file);R(t,{id:s,legacySuppressionIds:n===s?void 0:[n],check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function Ot(e,i,t,r){r.checksRun.push("new-dead");let n=new oe(e),s=Q(e.config.projectRoot),a=s.length>1;for(let c of i){if(t(c)||c.fanIn>0||n.fileKind(c.file)==="test"||I(e,c.file)||E(e,c.symbol,c.file)||Vt(c.symbol))continue;let l=b("new-dead",c.symbol,c.file),o=a&&Ht(s,c.file)&&zt(e,c.symbol);R(r,{id:l,check:"new-dead",severity:"warning",evidence:o?"heuristic":"graph-fact",confidence:o?.4:.9,file:c.file,symbol:c.symbol,message:o?`${c.shortName} (${c.file}) unconfirmed (cross-package ambiguous-name resolution gap): zero indexed consumers found, but this name is ambiguous project-wide and lives in a workspace package \u2014 verify manually before treating as dead`:`${c.shortName} (${c.file}) was changed but has zero indexed consumers`,why:o?[`${c.shortName} is a changed production symbol in a workspace package.`,"The index, semantic, and source-fallback layers all report zero consumers for this symbol.","Its leaf name is ambiguous project-wide (a same-named definition exists elsewhere), and cross-package consumers reached only through a re-exporting barrel are a known unresolvable shape for this tool \u2014 see docs/plans/2026-07-02-followups.md item 2."]:[`${c.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:o?"Verify with a direct code search before deleting; this tool cannot confidently resolve this symbol.":"Wire it up, or remove it before it becomes permanent dead code."})}}function Ht(e,i){return e.some(t=>i===t.relativeDir||i.startsWith(`${t.relativeDir}/`))}function zt(e,i){let t=v(i);return t?(ne(e).get(t)?.length??0)>1:!1}function Vt(e){if(ie(e)!=="type")return!1;let i=v(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Ut(e,i,t,r){let n=new Map(t.renamedFiles.map(a=>[a.to,a.from])),s=r??z(e,i,V(t));return a=>{let c=n.get(a.file)??a.file,l=v(a.symbol);if(!l)return!1;let o=s(c);return o!==null&&qt(o,l)}}function qt(e,i){return new RegExp(`\\b${te(i)}\\b`).test(e)}function Wt(e,i){if(!L(x(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=Be(e);for(let r of t.newFindings.filter(n=>!n.startsWith(N))){let n=U(r),s=b("baseline",r);R(i,{id:s,groupKey:`baseline:${n.sourceAnalyzer}:${n.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:n.actionTier,confidence:1,file:n.file,relatedFiles:n.relatedFiles.length>0?n.relatedFiles:void 0,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${n.sourceAnalyzer}.`,`Inherited action tier: ${n.actionTier}.`,`Root cause key: ${n.rootCauseKey}.`,...n.why],remediation:n.remediation})}}function Jt(e,i){if(!$e(e.config.architecture)){i.skipped.push({check:"architecture",reason:"no closed architecture dependency rows, requireCompletePolicy rule, or requireAcyclic rule configured"});return}if(!L(x(e))){i.skipped.push({check:"architecture",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("architecture");let t=Pe(e);for(let r of t.newFindings){let n=U(r),s=b("architecture",r);R(i,{id:s,groupKey:`architecture:${n.rootCauseKey}`,check:"architecture",severity:"error",evidence:"baseline",actionTier:"direct",confidence:1,sourceAnalyzer:"architecture",rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["The project declares an enforceable architecture rule.","The current boundary graph contains a violation not present in the committed baseline.",...n.why],remediation:n.remediation})}}function b(e,...i){return`SQ${St("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{je as a,yi as b,Be as c,Pe as d,en as e,tn as f,nn as g,rn as h,Ut as i};
2
- //# sourceMappingURL=chunk-HEBAY673.js.map
@@ -1,2 +0,0 @@
1
- import{execFileSync as l,spawnSync as P}from"child_process";import{platform as g}from"os";var a=g()==="win32";function i(e){let n=a?"where":"which";try{return l(n,[e],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var m=/\.(?:c|m)?js$/i,f=/\.(?:exe|com)$/i;function E(e,n){return m.test(e)?{binary:process.execPath,args:[e,...n]}:{binary:e,args:[...n]}}function d(e,n){return l(e,n,{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function _(e,n={}){let r=n.isWindows??a,p=n.lookup??d,o;try{o=p(r?"where":"which",[e])}catch{return null}let s=o.split(/\r?\n/).map(t=>t.trim()).filter(Boolean);return r?s.find(t=>f.test(t))??null:s[0]??null}import{execFileSync as c}from"child_process";import{createRequire as h}from"module";import{existsSync as S}from"fs";import{platform as u,arch as w}from"os";var y="https://github.com/sourcegraph/scip",v="SCIP_QUERY_SCIP_BIN";function x(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let n=e.env[v];if(n&&e.fileExists(n))return{source:"env",path:n};if(e.platform==="win32"){let r=e.resolveSidecar(e.arch);if(r&&e.fileExists(r))return{source:"sidecar",path:r}}return null}function b(e){let n=h(import.meta.url);for(let r of e==="arm64"?["arm64","x64"]:[e])try{return n.resolve(`scip-query-scip-windows/scip-win32-${r}.exe`)}catch{}return null}function k(e=process.env){return x({platform:u(),arch:w(),env:e,isOnPath:i,fileExists:S,resolveSidecar:b})?.path??null}function O(e){if(u()==="darwin"&&i("brew")){e("Installing scip CLI via Homebrew...");try{if(c("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),i("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(n){let r=n instanceof Error?n.message:String(n);e(`Homebrew install failed: ${r}`)}}if(i("go")){e("Installing scip CLI via go install...");try{if(c("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),i("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(n){let r=n instanceof Error?n.message:String(n);e(`go install failed: ${r}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${y}/releases`),!1}export{i as a,E as b,_ as c,k as d,O as e};
2
- //# sourceMappingURL=chunk-HELS7KFF.js.map
@@ -1,6 +0,0 @@
1
- import{a as m}from"./chunk-N3SE646F.js";import{a as h}from"./chunk-2OXVAGGT.js";import{d as g}from"./chunk-ZTTISZ7J.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
2
- `),c=Math.max(0,e.startLine-a),l=Math.min(n.length-1,e.endLine+a),u=n.slice(c,l+1).join(`
3
- `);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:l,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let i=m(t,e);if(!i)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),l;try{l=f(c,"utf-8")}catch{return null}let u=l.split(`
4
- `),o=Math.max(0,a-1-r),p=Math.min(u.length-1,s-1+r),b=u.slice(o,p+1).join(`
5
- `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:p,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
- //# sourceMappingURL=chunk-IPDCSB6N.js.map
@@ -1,16 +0,0 @@
1
- import{d as re,e as oe,f as se,g as M,h as T,i as ce,k as le,n as fe,o as me}from"./chunk-Z5QQPJ3U.js";import{d as R}from"./chunk-2OXVAGGT.js";import{M as ae}from"./chunk-GA64UPMI.js";import{a as te}from"./chunk-YLVE3SXZ.js";import{e as S,s as ne,z as ie}from"./chunk-ZTTISZ7J.js";import{a as K,b as Q,f as L,p as v}from"./chunk-7LABSJSR.js";import{B as ee,L as A,a as X,c as I}from"./chunk-DGMCFMPG.js";import{B as y,H as p,l as d,m as W,p as w,q as E,s as V,u as F,z as q}from"./chunk-B5MHCHP3.js";function D(e,i,n,t={}){if(!n)return[];let r=p(e,i);return r?r.indexOf(n)===-1?[]:(O(e,i).get(n)??[]).filter(o=>!Le(o,t)):[]}function Le(e,i){return typeof i.excludeStartLine=="number"&&typeof i.excludeEndLine=="number"&&e>=i.excludeStartLine&&e<=i.excludeEndLine}var ve=d("file-identifiers",{clearGroups:["whole-project","source-file"]});function ue(e,i){let n=L(e,i);return n?n.fileIdentifiers:ve.get(e,i,()=>new Set(O(e,i).keys()))}var Re=d("file-ident-lines",{clearGroups:["whole-project","source-file"]});function O(e,i){let n=L(e,i);return n?n.identifierLineMap:Re.get(e,i,()=>De(e,i))}var Me=d("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function qe(e,i){let n=L(e,i);return n?n.identifiersByLine:Me.get(e,i,()=>{let t=O(e,i),r=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>r&&(r=c)}let s=new Array(r+1);for(let o=0;o<=r;o+=1)s[o]=new Set;for(let[o,c]of t)for(let a of c)s[a].add(o);return s})}function De(e,i){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},r=p(e,i);if(!r)return n;let s=Q(r).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<s.length;c+=1){let a=s[c]??"";for(let l of a.matchAll(o))l[1]&&t(l[1],c)}return n}function rt(e,i){let n=pe(e);return n?i.filter(t=>pe(t.file)===n):i}function ot(e,i,n,t){let r=n.find(s=>s.file===i);if(r)return r;if(t){let s=new Set(v(e,i).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of s)if(I(c,o.file))return o;return null}return n.length===1?n[0]:null}function pe(e){let i=ee(e);return i?i==="typescript"||i==="tsx"||i==="javascript"?"javascript-family":i:null}var _e=W("global-leaf-index",{clearGroups:["whole-project"]});function j(e){return _e.get(e,()=>{let i=e.all(`SELECT gs.id, gs.symbol,
2
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
3
- FROM global_symbols gs
4
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
5
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
6
- LEFT JOIN (
7
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
8
- FROM mentions m
9
- JOIN chunks c ON m.chunk_id = c.id
10
- JOIN documents d ON c.document_id = d.id
11
- WHERE m.role = 1
12
- GROUP BY m.symbol_id
13
- ) mention_doc ON mention_doc.symbol_id = gs.id
14
- WHERE 1 = 1
15
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of i){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let r=S(t.symbol);if(!r)continue;let s=n.get(r);s||(s=[],n.set(r,s)),s.some(o=>o.symbolId===t.id)||s.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var xe=d("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function ge(e,i){let n=X(i);return xe.get(e,n,()=>Pe(e,n))}function Pe(e,i){let n=new Map;for(let t of v(e,i)){if(!t.sourcePath)continue;let r=t.localName??t.importedName;if(r&&de(n,r,t.sourcePath),t.kind==="namespace")for(let s of t.usedMembers)de(n,s,t.sourcePath)}return n}function de(e,i,n){let t=e.get(i);t||(t=new Set,e.set(i,t)),t.add(n)}var he=/[A-Za-z_$][A-Za-z0-9_$]*/g,ye=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Ne=512;function H(e){let i=[],n=!1;for(let t of e)t&&(n=!0,ye.test(t)||i.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:i}}function Se(e,i){let n=ke(i)?i:H(i);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=Ne){for(let r of n.candidateNames)if(r){if(ye.test(r)){if(we(r).test(e))return!0;continue}if(e.includes(r))return!0}return!1}he.lastIndex=0;let t;for(;(t=he.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let r of n.nonIdentifierNames)if(e.includes(r))return!0;return!1}function ke(e){return"candidateNames"in e}function we(e){return new RegExp(`(?<![A-Za-z_$0-9])${K(e)}(?![A-Za-z_$0-9])`)}function z(e,i,n){let t=j(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[C(t[0])];let r=t.filter(a=>a.file===i);if(r.length>0)return r.map(C);let s=ge(e,i),o=s.get(n);if(o)for(let a of o){let l=t.filter(m=>I(a,m.file));if(l.length>0)return l.map(C)}let c=new Set;for(let a of s.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(m=>I(a,m.file));if(l.length>0&&l.length===t.length)return l.map(C)}return[]}function Lt(e,i,n){let t=z(e,i,n);if(t.length>0)return t;let r=j(e).get(n);return!r||r.length===0?[]:r.map(C)}function be(e,i,n={}){let t=R(e,i);if(!t)return[];let r=S(t.symbol);if(!r)return[];if(n.semantic!==!1&&n.semanticEvidence){let o=n.semanticEvidence.references(e,{...t,leaf:r,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let a of o){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return _(e,c)}}let s=new Map;for(let o of A(e)){let c=p(e,o);if(!c||c.indexOf(r)===-1||o!==t.relativePath&&!z(e,o,r).some(m=>m.symbolId===t.symbolId))continue;let a=D(e,o,r,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&s.set(o,a)}return _(e,s)}function vt(e,i,n={}){let t=new Map;for(let a of i){if(!a.leaf)continue;let l=t.get(a.leaf)??[];l.push(a),t.set(a.leaf,l)}if(t.size===0)return new Map;let r=new Set(i.map(a=>a.symbolId)),s=new Set(t.keys()),o=H(s),c=new Map;for(let a of A(e)){if(n.skipPath?.(a)||!Se(p(e,a),o))continue;let l=ue(e,a);if(l.size!==0){for(let m of l)if(t.has(m))for(let g of z(e,a,m)){if(!r.has(g.symbolId)||a===g.relativePath)continue;let h=c.get(g.symbolId);h||(h=new Set,c.set(g.symbolId,h)),h.add(a)}}}return c}function C(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function _(e,i){let n=[],t=new Set;for(let[r,s]of i){let o=ne(e,r);for(let c of s){let a=ie(o,c),l=`${r}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:r,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Fe(e,i){let n=ze(e,i);return n?_(e,Te(e,n.match,n.identifier)):[]}function Nt(e,i,n={}){return Ae(e,i,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Ae(e,i,n={}){let t=be(e,i,{semantic:n.semantic,semanticEvidence:n.semanticEvidence}),r=t.length>0?Ie(t,"source-attribution"):Ie(Fe(e,i),"scip-reference-chunk");return n.includeIgnored===!0?r:r.filter(s=>!e.isIgnored(s.file))}function Ie(e,i){return e.map(n=>({...n,provenance:i}))}function Te(e,i,n){let t=new Map;for(let[r,s]of Oe(e,i.symbolId))t.set(r,je(e,r,s,i,n));return t}function Oe(e,i){let n=new Map;for(let t of re(e,[i])){if(e.isIgnored(t.relative_path))continue;let r=n.get(t.relative_path);r||(r=[],n.set(t.relative_path,r)),r.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function je(e,i,n,t,r){let s=i===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=r?D(e,i,r,s):[];return n.flatMap(c=>He(o,c))}function He(e,i){let n=e.filter(t=>t>=i.start_line&&t<=i.end_line);return n.length>0?n:[i.start_line]}function ze(e,i){let n=R(e,i);return n?{match:n,identifier:S(n.symbol)||null}:null}var $t={references:le,referenceMap:fe,callerMap:(e,i)=>T(e).callerMap(i),calleeMap:Be};function Be(e,i){let n=q(),t=new Map,r=ce(e,i),s=[],o=[],c=0,a=0,l=0,m=0,g=0,h=0,B=0;for(let{definition:f,callees:u}of r.hits)g+=1,u.length>0&&(h+=1,B+=u.length,t.set(f.symbolId,u));let b=Ge(e,r.hits);if(b.entries.length>0&&y("semantic.callees.prefetch-cache-write",()=>F(e,b.entries),()=>({entries:b.entries.length,sourceMissing:b.sourceMissing,skippedUnsupportedLanguage:b.skippedUnsupportedLanguage})),y("semantic.callees.cache-scan",()=>{for(let[f,u]of oe(r.misses)){if(!M(f)){n&&(c+=u.length);continue}let J=p(e,f);if(!J){n&&(a+=u.length),o.push(...u);continue}let Z=E(e,f,J),P=Ce(e,f);if(!P){o.push(...u);continue}let Ee=V(e,f,Z,P);for(let N of u){let Y=Ee.get(N.symbol)??null;if(Y!==null){let k=Ue(Y);if(k){n&&(l+=1),k.length>0&&t.set(N.symbolId,k);continue}n&&(m+=1)}s.push({def:N,contentHash:Z,depsDigest:P})}}},()=>({definitions:i.length,skippedUnsupportedLanguage:c,sourceMissing:a,cacheHits:l,parseFailures:m,misses:s.length,unkeyed:o.length,inMemoryHits:g,inMemoryRows:h,inMemoryCalleeCount:B,resultRows:t.size})),s.length===0&&o.length===0)return t;let G=[...o,...s.map(f=>f.def)],$=0,U=y("semantic.callees.compute-misses",()=>{let f=me(e,G);return $=f.size,f},()=>({definitions:G.length,misses:s.length,unkeyed:o.length,rows:$}));for(let[f,u]of U)t.set(f,u);let x=s.filter(f=>T(e).capability("semantic-callees",f.def.relativePath).available).map(f=>({relativePath:f.def.relativePath,symbol:f.def.symbol,contentHash:f.contentHash,depsDigest:f.depsDigest,payload:JSON.stringify(U.get(f.def.symbolId)??[])}));return x.length>0?y("semantic.callees.cache-write",()=>F(e,x),()=>({entries:x.length})):y("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:s.length})),t}function Ge(e,i){let n=[],t=new Map,r=0,s=0;for(let{definition:o,callees:c}of i){if(!M(o.relativePath)){s+=1;continue}if(!t.has(o.relativePath)){let l=p(e,o.relativePath),m=l?Ce(e,o.relativePath):null;t.set(o.relativePath,l&&m?{contentHash:E(e,o.relativePath,l),depsDigest:m}:null)}let a=t.get(o.relativePath);if(!a){r+=1;continue}n.push({relativePath:o.relativePath,symbol:o.symbol,contentHash:a.contentHash,depsDigest:a.depsDigest,payload:JSON.stringify(c)})}return{entries:n,sourceMissing:r,skippedUnsupportedLanguage:s}}var $e="typescript-callees-v1";function Ce(e,i){let n=M(i);if(n==="typescript")return ae(e,i,$e)?.key??null;let t=Ze(e,i);return n==="rust"?w(JSON.stringify({kind:"semantic-callees",language:n,engine:se(e.config.projectRoot),positionMapping:"nearby-leaf-v1",depsDigest:t})):t}function Ue(e){try{return JSON.parse(e)}catch{return null}}var Je=d("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function Ze(e,i){return Je.get(e,i,()=>{let t=[...te(e).get(i)??[]].sort().map(r=>`${r}:${E(e,r,p(e,r))}`);return w(t.join("|"))})}export{O as a,qe as b,rt as c,ot as d,j as e,H as f,Se as g,ge as h,z as i,Lt as j,vt as k,Fe as l,Nt as m,$t as n};
16
- //# sourceMappingURL=chunk-JERWGHQT.js.map