scip-query 0.19.8 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +158 -48
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/chunk-26QA6FAI.js +8 -0
  5. package/dist/{chunk-KJ2IIBZN.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-24GTWJ3N.js → chunk-3CLX5EOX.js} +2 -2
  9. package/dist/{chunk-QGGLL3UH.js → chunk-3G66UZBH.js} +2 -2
  10. package/dist/{chunk-AA4UWRNL.js → chunk-3ORVDL3H.js} +2 -2
  11. package/dist/chunk-4MAK2HOY.js +6 -0
  12. package/dist/{chunk-QIQ63BHW.js → chunk-4TURLRL5.js} +2 -2
  13. package/dist/chunk-4UQVNCQE.js +2 -0
  14. package/dist/chunk-55Q3WLZX.js +2 -0
  15. package/dist/{chunk-CTF2GDEX.js → chunk-5E4WNAVD.js} +2 -2
  16. package/dist/{chunk-ZCEJ63SP.js → chunk-5I5G2QOX.js} +2 -2
  17. package/dist/chunk-6LDJQXAH.js +2 -0
  18. package/dist/{chunk-3EDFLQ6A.js → chunk-6O5TICIZ.js} +2 -2
  19. package/dist/{chunk-ACAM6O5R.js → chunk-6SHPK5ZE.js} +2 -2
  20. package/dist/chunk-7BAVHKMJ.js +49 -0
  21. package/dist/chunk-7O5IKBTZ.js +16 -0
  22. package/dist/{chunk-WJL2L6MV.js → chunk-7PIO7NKH.js} +2 -2
  23. package/dist/chunk-7S5E7KWT.js +2 -0
  24. package/dist/{chunk-YLFORA5G.js → chunk-7SQQWSY3.js} +2 -2
  25. package/dist/chunk-7WPLAODU.js +5 -0
  26. package/dist/chunk-A73XVBCR.js +20 -0
  27. package/dist/chunk-AFHORGLH.js +42 -0
  28. package/dist/chunk-AIE7TFJW.js +9 -0
  29. package/dist/{chunk-TWMJ3Y3G.js → chunk-AZJQQKDD.js} +2 -2
  30. package/dist/{chunk-BDOIKGDI.js → chunk-B2PX5I6M.js} +2 -2
  31. package/dist/{chunk-DQBCO2UY.js → chunk-B7PBSLZN.js} +2 -2
  32. package/dist/chunk-BBW6JFHN.js +2 -0
  33. package/dist/{chunk-YTVWB7YJ.js → chunk-BDCC2NPY.js} +2 -2
  34. package/dist/{chunk-O23I56NA.js → chunk-BNXCIFVY.js} +2 -2
  35. package/dist/{chunk-MLFZP76A.js → chunk-BPAPWKP6.js} +2 -2
  36. package/dist/chunk-BS2NMXQZ.js +4 -0
  37. package/dist/chunk-C3KV2II6.js +2 -0
  38. package/dist/chunk-C43RDDP4.js +20 -0
  39. package/dist/{chunk-K2WO7XY7.js → chunk-CJST5ETY.js} +2 -2
  40. package/dist/chunk-DAFAHMNB.js +42 -0
  41. package/dist/{chunk-KKME5ZAI.js → chunk-DQGFVPUV.js} +2 -2
  42. package/dist/chunk-DQLPXMH6.js +8 -0
  43. package/dist/chunk-EKZTZXHZ.js +117 -0
  44. package/dist/{chunk-FJ5UDTQF.js → chunk-EN3O7VJA.js} +2 -2
  45. package/dist/{chunk-HZYDQPNY.js → chunk-EW2NTSFA.js} +2 -2
  46. package/dist/chunk-F3Z4OUDS.js +8 -0
  47. package/dist/chunk-FJH2NW7J.js +66 -0
  48. package/dist/{chunk-MSBDMFER.js → chunk-FKSELJQF.js} +2 -2
  49. package/dist/chunk-FTFP6O3L.js +11 -0
  50. package/dist/chunk-FYLK2DEJ.js +2 -0
  51. package/dist/{chunk-WUW7YUAH.js → chunk-GH74ASD6.js} +2 -2
  52. package/dist/{chunk-464PLI5O.js → chunk-GMXWZP2B.js} +2 -2
  53. package/dist/chunk-GOUBFH5O.js +3 -0
  54. package/dist/{chunk-FIJCV235.js → chunk-HLF2TX6R.js} +2 -2
  55. package/dist/{chunk-WWKWUPSU.js → chunk-HX4GQPZP.js} +2 -2
  56. package/dist/chunk-HX7M4BDI.js +30 -0
  57. package/dist/chunk-HZ72SESS.js +128 -0
  58. package/dist/{chunk-SERUIGV5.js → chunk-IB2N4FIY.js} +2 -2
  59. package/dist/chunk-ILMHV3KM.js +2 -0
  60. package/dist/chunk-IZYYAFN5.js +2 -0
  61. package/dist/{chunk-GNC4JVAN.js → chunk-JAYYFEQY.js} +2 -2
  62. package/dist/{chunk-QJIVBYEK.js → chunk-JDOEX4E6.js} +2 -2
  63. package/dist/chunk-JFGGXWQF.js +947 -0
  64. package/dist/chunk-JN4NMBEX.js +8 -0
  65. package/dist/{chunk-6M7RONVB.js → chunk-JVYA47YU.js} +2 -2
  66. package/dist/{chunk-7KYNAMMH.js → chunk-JW56N3KI.js} +2 -2
  67. package/dist/{chunk-OUBAF226.js → chunk-JZ2OXNWB.js} +2 -2
  68. package/dist/chunk-KMKTIO2G.js +8 -0
  69. package/dist/chunk-L5GJNV2T.js +8 -0
  70. package/dist/{chunk-MNSTUIDD.js → chunk-L7AW2QB5.js} +2 -2
  71. package/dist/chunk-L7JDSCDF.js +4 -0
  72. package/dist/chunk-LU47HG23.js +14 -0
  73. package/dist/chunk-LVY7NPF7.js +2 -0
  74. package/dist/chunk-LY4WC4AD.js +74 -0
  75. package/dist/{chunk-7FT5Y65S.js → chunk-MKCDWWGV.js} +2 -2
  76. package/dist/chunk-MNE7YG56.js +2 -0
  77. package/dist/{chunk-7QHY3H7P.js → chunk-MRXBEXSY.js} +2 -2
  78. package/dist/chunk-MV7OWDUX.js +2 -0
  79. package/dist/{chunk-ZJ5CBXK3.js → chunk-N5W4YZMK.js} +2 -2
  80. package/dist/chunk-NGEXCJJW.js +11 -0
  81. package/dist/{chunk-7SWJEWJF.js → chunk-NIW6JDC5.js} +2 -2
  82. package/dist/{chunk-O3O4XXO6.js → chunk-O64IZ6UX.js} +2 -2
  83. package/dist/{chunk-3ZSJ3PWF.js → chunk-PBUQFCNB.js} +2 -2
  84. package/dist/{chunk-7RAG65VK.js → chunk-POAVPHH7.js} +2 -2
  85. package/dist/{chunk-A3QXWFBK.js → chunk-PQCI4SQX.js} +2 -2
  86. package/dist/{chunk-4BV4QAZJ.js → chunk-PXY7F6Y4.js} +2 -2
  87. package/dist/chunk-RDO52JGY.js +2 -0
  88. package/dist/chunk-RJT3TUUZ.js +2 -0
  89. package/dist/{chunk-S4S2WOIX.js → chunk-RUJURYSV.js} +2 -2
  90. package/dist/{chunk-JAY7YWS3.js → chunk-RVLDN63O.js} +2 -2
  91. package/dist/chunk-RXOXSKY3.js +2 -0
  92. package/dist/chunk-S7OYBOCK.js +2 -0
  93. package/dist/chunk-SMNXQT5Z.js +3 -0
  94. package/dist/{chunk-NE3TZUCI.js → chunk-SRAFT254.js} +2 -2
  95. package/dist/{chunk-ELLMY7XJ.js → chunk-SXP2MBJH.js} +2 -2
  96. package/dist/chunk-T7YQSHPQ.js +3 -0
  97. package/dist/{chunk-WY45BHKQ.js → chunk-TFRAYKN6.js} +2 -2
  98. package/dist/{chunk-2SNGN6U4.js → chunk-UJCOIXDY.js} +2 -2
  99. package/dist/{chunk-MZZBAITE.js → chunk-UJPRPGCO.js} +2 -2
  100. package/dist/chunk-W4ETQAXM.js +2 -0
  101. package/dist/chunk-WCCFZ7V7.js +113 -0
  102. package/dist/chunk-WUPW3UN3.js +3 -0
  103. package/dist/{chunk-7LSVMFX7.js → chunk-WXZLAAWK.js} +2 -2
  104. package/dist/{chunk-5ML2BNRH.js → chunk-X54AGLVX.js} +2 -2
  105. package/dist/chunk-XKWKXZKW.js +20 -0
  106. package/dist/{chunk-5YLUDDAF.js → chunk-XSRF6Q77.js} +2 -2
  107. package/dist/chunk-Y2MVPNKY.js +5 -0
  108. package/dist/{chunk-JHF3E4YM.js → chunk-YKUU5AIC.js} +2 -2
  109. package/dist/{chunk-E3HYEQO7.js → chunk-YLCJLTPL.js} +2 -2
  110. package/dist/{chunk-7VCOXZH3.js → chunk-YTQVETEO.js} +2 -2
  111. package/dist/chunk-Z4N3MZYA.js +38 -0
  112. package/dist/chunk-ZHXX42OH.js +18 -0
  113. package/dist/chunk-ZJOOT3BG.js +2 -0
  114. package/dist/{chunk-P3UO3EH3.js → chunk-ZK26BAQL.js} +2 -2
  115. package/dist/{chunk-33KUO7CG.js → chunk-ZTETIQ35.js} +2 -2
  116. package/dist/cli.js +3 -8
  117. package/dist/command-descriptors-DSS46KXI.js +642 -0
  118. package/dist/{config-types-B6MEoRNy.d.ts → config-types-jVM3D7MA.d.ts} +68 -2
  119. package/dist/{db-DYLKr9Wn.d.ts → db-B5PM5yNk.d.ts} +20 -2
  120. package/dist/{diff-gate-types-C9BoYwYD.d.ts → diff-gate-types-B0QYpDv1.d.ts} +2 -1
  121. package/dist/direct-navigation-6YHV6IB5.js +3 -0
  122. package/dist/{health-DgxIDXJC.d.ts → health-Do5TKSJI.d.ts} +1 -1
  123. package/dist/index.d.ts +3 -3
  124. package/dist/index.js +1 -1
  125. package/dist/postinstall.js +1 -1
  126. package/dist/queries/affected.d.ts +2 -2
  127. package/dist/queries/affected.js +1 -1
  128. package/dist/queries/architecture.d.ts +2 -2
  129. package/dist/queries/architecture.js +1 -1
  130. package/dist/queries/bottlenecks.d.ts +2 -2
  131. package/dist/queries/bottlenecks.js +1 -1
  132. package/dist/queries/by-kind.d.ts +2 -2
  133. package/dist/queries/by-kind.js +1 -1
  134. package/dist/queries/call-graph.d.ts +2 -2
  135. package/dist/queries/call-graph.js +1 -1
  136. package/dist/queries/change-surface.d.ts +22 -3
  137. package/dist/queries/change-surface.js +1 -1
  138. package/dist/queries/cleanup-plan.d.ts +2 -2
  139. package/dist/queries/cleanup-plan.js +1 -1
  140. package/dist/queries/co-change.d.ts +2 -2
  141. package/dist/queries/co-change.js +1 -1
  142. package/dist/queries/code.d.ts +2 -2
  143. package/dist/queries/code.js +1 -1
  144. package/dist/queries/complexity-hotspots.d.ts +3 -3
  145. package/dist/queries/complexity-hotspots.js +1 -1
  146. package/dist/queries/complexity.d.ts +3 -3
  147. package/dist/queries/complexity.js +1 -1
  148. package/dist/queries/convergence.d.ts +2 -2
  149. package/dist/queries/convergence.js +1 -1
  150. package/dist/queries/coupling.d.ts +2 -2
  151. package/dist/queries/coupling.js +1 -1
  152. package/dist/queries/cycles.d.ts +2 -2
  153. package/dist/queries/cycles.js +1 -1
  154. package/dist/queries/dataflow.d.ts +2 -2
  155. package/dist/queries/dataflow.js +1 -1
  156. package/dist/queries/dead.d.ts +2 -2
  157. package/dist/queries/dead.js +1 -1
  158. package/dist/queries/decorative-checkers.d.ts +2 -2
  159. package/dist/queries/decorative-checkers.js +1 -1
  160. package/dist/queries/deep-chains.d.ts +2 -2
  161. package/dist/queries/deep-chains.js +1 -1
  162. package/dist/queries/deps.d.ts +2 -2
  163. package/dist/queries/deps.js +1 -1
  164. package/dist/queries/diff-gate.d.ts +40 -7
  165. package/dist/queries/diff-gate.js +1 -1
  166. package/dist/queries/diff-impact.d.ts +84 -6
  167. package/dist/queries/diff-impact.js +1 -1
  168. package/dist/queries/doc-drift.d.ts +3 -3
  169. package/dist/queries/doc-drift.js +1 -1
  170. package/dist/queries/drift.d.ts +2 -2
  171. package/dist/queries/drift.js +1 -1
  172. package/dist/queries/duplicate-bodies.d.ts +3 -3
  173. package/dist/queries/duplicate-bodies.js +1 -1
  174. package/dist/queries/extract-candidates.d.ts +2 -2
  175. package/dist/queries/extract-candidates.js +1 -1
  176. package/dist/queries/fan.d.ts +2 -2
  177. package/dist/queries/fan.js +1 -1
  178. package/dist/queries/files.d.ts +12 -3
  179. package/dist/queries/files.js +1 -1
  180. package/dist/queries/health.d.ts +3 -3
  181. package/dist/queries/health.js +1 -1
  182. package/dist/queries/hierarchy.d.ts +2 -2
  183. package/dist/queries/hierarchy.js +1 -1
  184. package/dist/queries/hotspots.d.ts +2 -2
  185. package/dist/queries/hotspots.js +1 -1
  186. package/dist/queries/imports.d.ts +2 -2
  187. package/dist/queries/imports.js +1 -1
  188. package/dist/queries/incomplete-migration.d.ts +8 -6
  189. package/dist/queries/incomplete-migration.js +1 -1
  190. package/dist/queries/index.d.ts +141 -10
  191. package/dist/queries/index.js +1 -1
  192. package/dist/queries/isolated.d.ts +2 -2
  193. package/dist/queries/isolated.js +1 -1
  194. package/dist/queries/locality-candidates.d.ts +2 -2
  195. package/dist/queries/locality-candidates.js +1 -1
  196. package/dist/queries/members.d.ts +2 -2
  197. package/dist/queries/members.js +1 -1
  198. package/dist/queries/methods.d.ts +34 -3
  199. package/dist/queries/methods.js +1 -1
  200. package/dist/queries/not-implemented.d.ts +2 -2
  201. package/dist/queries/not-implemented.js +1 -1
  202. package/dist/queries/outline.d.ts +2 -2
  203. package/dist/queries/outline.js +1 -1
  204. package/dist/queries/passthrough-candidates.d.ts +3 -3
  205. package/dist/queries/passthrough-candidates.js +1 -1
  206. package/dist/queries/plan-context.d.ts +3 -3
  207. package/dist/queries/plan-context.js +1 -1
  208. package/dist/queries/react-component-duplicates.d.ts +2 -2
  209. package/dist/queries/react-component-duplicates.js +1 -1
  210. package/dist/queries/react-hook-candidates.d.ts +2 -2
  211. package/dist/queries/react-hook-candidates.js +1 -1
  212. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  213. package/dist/queries/react-large-component-pressure.js +1 -1
  214. package/dist/queries/recent-duplicates.d.ts +2 -2
  215. package/dist/queries/recent-duplicates.js +1 -1
  216. package/dist/queries/redundant-reexports.d.ts +2 -2
  217. package/dist/queries/redundant-reexports.js +1 -1
  218. package/dist/queries/refs.d.ts +2 -2
  219. package/dist/queries/refs.js +1 -1
  220. package/dist/queries/self-audit.d.ts +2 -2
  221. package/dist/queries/self-audit.js +1 -1
  222. package/dist/queries/similar-chains.d.ts +2 -2
  223. package/dist/queries/similar-chains.js +1 -1
  224. package/dist/queries/similar-files.d.ts +2 -2
  225. package/dist/queries/similar-files.js +1 -1
  226. package/dist/queries/similar-signatures.d.ts +2 -2
  227. package/dist/queries/similar-signatures.js +1 -1
  228. package/dist/queries/similar.d.ts +2 -2
  229. package/dist/queries/similar.js +1 -1
  230. package/dist/queries/slice.d.ts +2 -2
  231. package/dist/queries/slice.js +1 -1
  232. package/dist/queries/stale-abstractions.d.ts +2 -2
  233. package/dist/queries/stale-abstractions.js +1 -1
  234. package/dist/queries/stats.d.ts +2 -2
  235. package/dist/queries/surface.d.ts +2 -2
  236. package/dist/queries/surface.js +1 -1
  237. package/dist/queries/symbols.d.ts +2 -2
  238. package/dist/queries/symbols.js +1 -1
  239. package/dist/queries/system.d.ts +2 -2
  240. package/dist/queries/system.js +1 -1
  241. package/dist/queries/test-quality.d.ts +2 -2
  242. package/dist/queries/test-quality.js +1 -1
  243. package/dist/queries/trace.d.ts +2 -2
  244. package/dist/queries/trace.js +1 -1
  245. package/dist/queries/twin-ab.d.ts +14 -3
  246. package/dist/queries/twin-ab.js +1 -1
  247. package/dist/queries/twin-drift.d.ts +2 -2
  248. package/dist/queries/twin-drift.js +1 -1
  249. package/dist/queries/unused-imports.d.ts +2 -2
  250. package/dist/queries/unused-imports.js +1 -1
  251. package/dist/queries/unused-params.d.ts +2 -2
  252. package/dist/queries/unused-params.js +1 -1
  253. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  254. package/dist/queries/vue-component-duplicates.js +1 -1
  255. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  256. package/dist/queries/vue-composable-candidates.js +1 -1
  257. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  258. package/dist/queries/vue-large-view-pressure.js +1 -1
  259. package/dist/queries/wrapper-candidates.d.ts +2 -2
  260. package/dist/queries/wrapper-candidates.js +1 -1
  261. package/dist/reindex-worker.js +21 -21
  262. package/dist/reindex.d.ts +3 -3
  263. package/dist/reindex.js +33 -33
  264. package/dist/runtime.d.ts +5 -3
  265. package/dist/runtime.js +3 -3
  266. package/dist/rust-semantic-session-server.js +1 -1
  267. package/dist/rust-semantic-session-worker.js +1 -1
  268. package/dist/rust-semantic-worker.js +1 -1
  269. package/dist/{scip-cli-Cc6c00-a.d.ts → scip-cli-BnEwZRLJ.d.ts} +1 -1
  270. package/dist/{symbol-types-BgWU6lhL.d.ts → symbol-types-BIQwfoAx.d.ts} +7 -1
  271. package/dist/typescript-mailbox-worker.js +2 -0
  272. package/dist/watch-server.js +2 -42
  273. package/docs/AGENT_GUIDE.md +13 -6
  274. package/docs/CLI_JSON_OUTPUT.md +110 -22
  275. package/docs/COMMAND_REFERENCE.md +88 -88
  276. package/docs/COMMITTED_RECORD_COMPATIBILITY.md +55 -18
  277. package/docs/DURABILITY.md +88 -38
  278. package/docs/INDEX_GENERATIONS.md +65 -19
  279. package/docs/MAILBOX_LIFECYCLE.md +28 -1
  280. package/docs/REINDEX_METADATA_COMPATIBILITY.md +18 -8
  281. package/docs/SECURITY_MODEL.md +31 -14
  282. package/docs/TELEMETRY_RETENTION.md +11 -4
  283. package/docs/WATCH_REFRESH_REQUESTS.md +34 -21
  284. package/docs/WINDOWS_SIDECAR_RELEASE.md +9 -4
  285. package/docs/analyzer-inventory.md +31 -22
  286. package/docs/analyzer-validation-ledger.md +8 -0
  287. package/docs/schemas/outcome-event-record.schema.json +57 -1
  288. package/docs/schemas/project-config.schema.json +82 -1
  289. package/docs/schemas/suppression-record.schema.json +84 -3
  290. package/package.json +5 -5
  291. package/skills/_shared/SKILL.md +2 -2
  292. package/skills/_shared/references/agent-contract-catalog.md +1 -1
  293. package/skills/_shared/references/detector-precision-and-diffgate.md +1 -1
  294. package/skills/scip-audit/SKILL.md +6 -6
  295. package/skills/scip-audit/references/claims.md +1 -1
  296. package/skills/scip-audit/references/cleanup.md +19 -20
  297. package/skills/scip-audit/references/directory.md +4 -4
  298. package/skills/scip-audit/references/frontend.md +10 -10
  299. package/skills/scip-audit/references/twin-drift.md +2 -2
  300. package/skills/scip-diagnose/references/debug.md +8 -8
  301. package/skills/scip-diagnose/references/root-cause.md +3 -3
  302. package/skills/scip-diagnose/references/triage.md +10 -10
  303. package/skills/scip-explore/SKILL.md +3 -3
  304. package/skills/scip-improve/SKILL.md +10 -10
  305. package/skills/scip-improve/references/cleanup-batches.md +3 -3
  306. package/skills/scip-improve/references/directory-moves.md +3 -3
  307. package/skills/scip-improve/references/doc-reconcile.md +1 -1
  308. package/skills/scip-improve/references/frontend-extraction.md +2 -2
  309. package/skills/scip-improve/references/twin-drift.md +3 -3
  310. package/skills/scip-plan/SKILL.md +2 -2
  311. package/skills/scip-plan/references/api-impact.md +5 -5
  312. package/skills/scip-plan/references/conductor.md +2 -2
  313. package/skills/scip-plan/references/hyper-optimization.md +1 -1
  314. package/skills/scip-query/SKILL.md +15 -5
  315. package/skills/scip-setup/references/bootstrap-workflow.md +7 -8
  316. package/skills/scip-setup/references/language-verification.md +2 -2
  317. package/skills/scip-setup/references/per-repo-triage.md +1 -1
  318. package/skills/scip-verify/SKILL.md +10 -10
  319. package/skills/scip-verify/references/calibrate-detectors.md +7 -7
  320. package/dist/chunk-2465DLHK.js +0 -3
  321. package/dist/chunk-2U3OLUNJ.js +0 -61
  322. package/dist/chunk-33XTHFKR.js +0 -2
  323. package/dist/chunk-43KC6EQZ.js +0 -2
  324. package/dist/chunk-47BU5Z4T.js +0 -8
  325. package/dist/chunk-4YTUWQ6M.js +0 -18
  326. package/dist/chunk-64MNV6AB.js +0 -8
  327. package/dist/chunk-67QRR5YC.js +0 -6
  328. package/dist/chunk-6GXYN7YA.js +0 -40
  329. package/dist/chunk-A2TNXAXO.js +0 -8
  330. package/dist/chunk-APMMR5Y2.js +0 -2
  331. package/dist/chunk-AZFUMCQB.js +0 -2
  332. package/dist/chunk-BNXICU42.js +0 -33
  333. package/dist/chunk-C5Q44Q5D.js +0 -3
  334. package/dist/chunk-DQGSM7RZ.js +0 -20
  335. package/dist/chunk-E2LAW7SL.js +0 -30
  336. package/dist/chunk-E4NFOAD4.js +0 -6
  337. package/dist/chunk-E5HNT4X2.js +0 -3
  338. package/dist/chunk-FD3HFKXR.js +0 -5
  339. package/dist/chunk-GHKEJTCE.js +0 -35
  340. package/dist/chunk-GLZTVKAB.js +0 -16
  341. package/dist/chunk-HIB452NU.js +0 -949
  342. package/dist/chunk-IF6FP6B2.js +0 -66
  343. package/dist/chunk-JORHF5AL.js +0 -108
  344. package/dist/chunk-KSGTULOS.js +0 -9
  345. package/dist/chunk-KXDJAG4N.js +0 -38
  346. package/dist/chunk-L4S2A7BV.js +0 -2
  347. package/dist/chunk-LP3ARJKF.js +0 -8
  348. package/dist/chunk-LSOR3LQG.js +0 -3
  349. package/dist/chunk-NTUMF2X3.js +0 -56
  350. package/dist/chunk-QOXBSI6G.js +0 -20
  351. package/dist/chunk-QXK6UUSM.js +0 -2
  352. package/dist/chunk-RA3AYNWP.js +0 -112
  353. package/dist/chunk-RJMDJR3A.js +0 -2
  354. package/dist/chunk-RLH5VUMG.js +0 -2
  355. package/dist/chunk-SMQWE25B.js +0 -3
  356. package/dist/chunk-TAVELHYR.js +0 -2
  357. package/dist/chunk-VAXNI5NE.js +0 -146
  358. package/dist/chunk-VVY2G5ET.js +0 -2
  359. package/dist/chunk-W3DBTGL4.js +0 -11
  360. package/dist/chunk-WANA4KAQ.js +0 -5
  361. package/dist/chunk-X4FR5BZF.js +0 -9
  362. package/dist/chunk-X6RKPDY7.js +0 -2
  363. package/dist/chunk-YCPASUCX.js +0 -2
  364. package/dist/chunk-ZL2OGDCD.js +0 -2
  365. package/dist/command-descriptors-ZW5J4ZEM.js +0 -631
  366. package/dist/direct-navigation-42YHQPOI.js +0 -3
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-WANA4KAQ.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
- //# sourceMappingURL=chunk-24GTWJ3N.js.map
1
+ import{b as i}from"./chunk-Y2MVPNKY.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
+ //# sourceMappingURL=chunk-3CLX5EOX.js.map
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-7LSVMFX7.js";import{a as D}from"./chunk-DQBCO2UY.js";import{a as g}from"./chunk-O3O4XXO6.js";import{a as F}from"./chunk-O23I56NA.js";import{a as y}from"./chunk-S4S2WOIX.js";import{e as f}from"./chunk-WANA4KAQ.js";import{j as d}from"./chunk-RA3AYNWP.js";import{I as h}from"./chunk-WUW7YUAH.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
2
- //# sourceMappingURL=chunk-QGGLL3UH.js.map
1
+ import{a as R}from"./chunk-WXZLAAWK.js";import{a as D}from"./chunk-B7PBSLZN.js";import{a as g}from"./chunk-O64IZ6UX.js";import{a as F}from"./chunk-BNXCIFVY.js";import{a as y}from"./chunk-RUJURYSV.js";import{e as f}from"./chunk-Y2MVPNKY.js";import{j as d}from"./chunk-EKZTZXHZ.js";import{I as h}from"./chunk-GH74ASD6.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
2
+ //# sourceMappingURL=chunk-3G66UZBH.js.map
@@ -1,2 +1,2 @@
1
- import{c}from"./chunk-B75HZHUP.js";import{a,b as n}from"./chunk-KXDJAG4N.js";import{n as t}from"./chunk-GLZTVKAB.js";import{a as m}from"./chunk-SMQWE25B.js";import{d as o,h as r}from"./chunk-RA3AYNWP.js";function N(s,y,b={}){let l=m(s,y);if(!l)return null;let i=b.semantic!==!1,f=n(s,l,{semantic:i,semanticEvidence:t}).filter(e=>r(e.symbol)).slice(0,50),p=c(a(s,l,{limit:50,additive:!0,callableOnly:!0,semantic:i,semanticEvidence:t}));return{symbol:l.symbol,shortName:o(l.symbol),callers:f.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file})),callees:p.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file}))}}export{N as a};
2
- //# sourceMappingURL=chunk-AA4UWRNL.js.map
1
+ import{c}from"./chunk-B75HZHUP.js";import{a,b as n}from"./chunk-Z4N3MZYA.js";import{o as t}from"./chunk-7O5IKBTZ.js";import{a as m}from"./chunk-T7YQSHPQ.js";import{d as o,h as r}from"./chunk-EKZTZXHZ.js";function N(s,y,b={}){let l=m(s,y);if(!l)return null;let i=b.semantic!==!1,f=n(s,l,{semantic:i,semanticEvidence:t}).filter(e=>r(e.symbol)).slice(0,50),p=c(a(s,l,{limit:50,additive:!0,callableOnly:!0,semantic:i,semanticEvidence:t}));return{symbol:l.symbol,shortName:o(l.symbol),callers:f.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file})),callees:p.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file}))}}export{N as a};
2
+ //# sourceMappingURL=chunk-3ORVDL3H.js.map
@@ -0,0 +1,6 @@
1
+ import{a as d}from"./chunk-S7OYBOCK.js";import{a as f}from"./chunk-T7YQSHPQ.js";import{d as m}from"./chunk-EKZTZXHZ.js";import{E as u,F as g}from"./chunk-WCCFZ7V7.js";import{extname as y}from"path";function M(t,e,r={}){let{context:n=0}=r,a=R(e);if(a)return x(t,a.filePath,a.startLine,a.endLine,n);let i=f(t,e);return i?L(t,i,n):null}function R(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(!e)return null;let r=Number(e[2]),n=Number(e[3]);if(!Number.isSafeInteger(r)||r<1)throw new RangeError(`Source range start line must be a positive integer, got "${e[2]}".`);if(!Number.isSafeInteger(n)||n<r)throw new RangeError(`Source range end line must be an integer at or after ${r}, got "${e[3]}".`);return{filePath:e[1],startLine:r,endLine:n}}function L(t,e,r){let n=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),a;try{a=u(t.config.projectRoot,e.relativePath,{inputKind:"indexed source file"})}catch(l){if(!g(l))throw l;return null}let i=a.split(`
2
+ `),s=Math.max(0,e.startLine-r),o=Math.min(i.length-1,e.endLine+r),c=i.slice(s,o+1).join(`
3
+ `);return{symbol:e.symbol,shortName:m(e.symbol),relativePath:e.relativePath,startLine:s,endLine:o,language:n?.language??b(e.relativePath),source:c}}function x(t,e,r,n,a){let i=d(t,e);if(!i)return null;let s=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!s)return null;let o;try{o=u(t.config.projectRoot,s.relative_path,{inputKind:"indexed source file"})}catch(h){if(!g(h))throw h;return null}let c=o.split(`
4
+ `),l=Math.max(0,r-1-a),p=Math.min(c.length-1,n-1+a),v=c.slice(l,p+1).join(`
5
+ `);return{symbol:`${s.relative_path}:${r}-${n}`,shortName:`${s.relative_path}:${r}-${n}`,relativePath:s.relative_path,startLine:l,endLine:p,language:s.language??b(s.relative_path),source:v}}function b(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-4MAK2HOY.js.map
@@ -1,4 +1,4 @@
1
- import{c as p}from"./chunk-2SNGN6U4.js";import{a as y}from"./chunk-SMQWE25B.js";import{d}from"./chunk-RA3AYNWP.js";import{b as h}from"./chunk-MZZBAITE.js";import{A as l}from"./chunk-WUW7YUAH.js";import{J as u,K as f}from"./chunk-JORHF5AL.js";function T(t,e,s={}){let n=y(t,e);if(!n)return null;let a=new p(t),o=P(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(B=>B.symbol));return{symbol:n.symbol,shortName:d(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:L(t,n.symbolId),fanOut:w(m,n.relativePath)}}function P(t,e){let s=l(t,e.relativePath);if(s){let n=x(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:E(S(t,e.relativePath,e.startLine,e.endLine),g(t,e.relativePath)),estimateBasis:"regex-fallback"}}function j(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});M(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,N(t,c))}return s}function N(t,e){return{branches:E(S(t,e.relativePath,e.startLine,e.endLine),g(t,e.relativePath)),estimateBasis:"regex-fallback"}}function g(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function S(t,e,s,n){try{return u(t.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
1
+ import{c as p}from"./chunk-UJCOIXDY.js";import{a as y}from"./chunk-T7YQSHPQ.js";import{d}from"./chunk-EKZTZXHZ.js";import{b as h}from"./chunk-UJPRPGCO.js";import{A as l}from"./chunk-GH74ASD6.js";import{E as u,F as f}from"./chunk-WCCFZ7V7.js";function T(t,e,s={}){let n=y(t,e);if(!n)return null;let a=new p(t),o=P(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(B=>B.symbol));return{symbol:n.symbol,shortName:d(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:L(t,n.symbolId),fanOut:w(m,n.relativePath)}}function P(t,e){let s=l(t,e.relativePath);if(s){let n=x(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:E(S(t,e.relativePath,e.startLine,e.endLine),g(t,e.relativePath)),estimateBasis:"regex-fallback"}}function j(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});M(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,N(t,c))}return s}function N(t,e){return{branches:E(S(t,e.relativePath,e.startLine,e.endLine),g(t,e.relativePath)),estimateBasis:"regex-fallback"}}function g(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function S(t,e,s,n){try{return u(t.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
2
2
  `).slice(s,n+1).join(`
3
3
  `)}catch(a){if(!f(a))throw a;return""}}function L(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
@@ -13,4 +13,4 @@ import{c as p}from"./chunk-2SNGN6U4.js";import{a as y}from"./chunk-SMQWE25B.js";
13
13
  WHERE m.symbol_id = ?
14
14
  AND m.role != 1
15
15
  AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function v(t){let e=0;return b(t,s=>{e+=_(s)}),e}function M(t,e,s){let n=[...e].sort((a,o)=>a.startLine-o.startLine||o.endLine-a.endLine);b(t,a=>{let o=_(a);if(o===0)return;let r=a.startPosition.row,i=a.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=o)}})}function b(t,e){e(t);for(let s of t.namedChildren)b(s,e)}function x(t,e,s){if(t.startPosition.row>e||t.endPosition.row<s)return null;for(let n of t.namedChildren){let a=x(n,e,s);if(a)return a}return t}var C=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function _(t){return C.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?D(t.text):0}function D(t){return(t.match(/&&|\|\|/g)??[]).length}function E(t,e){let s=h(t),n=0,a=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of a){let r=s.match(o);r&&(n+=r.length)}if(e==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}return n}export{T as a,P as b,j as c,v as d};
16
- //# sourceMappingURL=chunk-QIQ63BHW.js.map
16
+ //# sourceMappingURL=chunk-4TURLRL5.js.map
@@ -0,0 +1,2 @@
1
+ import{a as ce}from"./chunk-PQCI4SQX.js";import{a as se}from"./chunk-WXZLAAWK.js";import{a as oe}from"./chunk-B7PBSLZN.js";import{a as ae}from"./chunk-6LDJQXAH.js";import{a as re}from"./chunk-O64IZ6UX.js";import{a as ie}from"./chunk-BNXCIFVY.js";import{a as ne}from"./chunk-XSRF6Q77.js";import{b as G,e as m}from"./chunk-YLCJLTPL.js";import{a as te}from"./chunk-HX4GQPZP.js";import{a as Z}from"./chunk-MKCDWWGV.js";import{a as ee}from"./chunk-6YTSKJJ3.js";import{a as J}from"./chunk-6O5TICIZ.js";import{a as X}from"./chunk-EN3O7VJA.js";import{a as K}from"./chunk-EW2NTSFA.js";import{a as Y}from"./chunk-7SQQWSY3.js";import{a as W}from"./chunk-FYLK2DEJ.js";import{b as U}from"./chunk-B2PX5I6M.js";import{a as j}from"./chunk-JVYA47YU.js";import{a as M,b as q}from"./chunk-GOUBFH5O.js";import{b as N}from"./chunk-ZK26BAQL.js";import{a as z}from"./chunk-RUJURYSV.js";import{a as ue}from"./chunk-JW56N3KI.js";import{f as Q}from"./chunk-Y2MVPNKY.js";import{g as E,h as O}from"./chunk-26QA6FAI.js";import{q as _}from"./chunk-WCCFZ7V7.js";import{createHash as Bt,randomUUID as Ft}from"crypto";function Et(e){for(let r=e.length-1;r>=0;r-=1){let t=e[r];if(t?.event==="caught"||t?.event==="reopened")return t}}function de(e,r){let t=new Map;for(let n of e){let o=t.get(n.check)??[];o.push(n),t.set(n.check,o)}let i=[];for(let[n,o]of t){let s=o.filter(d=>d.outcome==="resolved").length,c=o.filter(d=>d.outcome==="suppressed").length,l=o.filter(d=>d.outcome==="still-open").length,h=o.length,C=o.filter(d=>d.outcome==="still-open").sort((d,v)=>d.firstSeen-v.firstSeen)[0];i.push({check:n,seen:h,resolved:s,suppressed:c,stillOpen:l,resolutionRate:h>0?s/h:0,suppressionRate:h>0?c/h:0,oldestOpenAgeDays:C?Math.floor((r-C.firstSeen)/Ie):null})}return i.sort((n,o)=>n.check.localeCompare(o.check))}var Ie=864e5;function le(e){return _(e).map($e)}function $e(e){return{check:e.check,findingId:e.findingId,firstSeen:e.firstSeen,lastSeen:e.lastSeen,timesShown:e.timesShown,outcome:e.outcome}}function f(e){return e.scoreCount??e.count}function A(e){let r=Ne(e),{breakdown:t,pressure:i}=je(e),n=me(t,"risk"),o=me(t,"hygiene");return{score:Math.min(n,o),riskScore:n,hygieneScore:o,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:Ve(e),validation:ze(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0,detectorPrecision:[]}}function Ve(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:_e(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function _e(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:g(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ze(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),n=0,o=0,s=0;for(let[C,d]of Object.entries(r))i.has(C)?n+=d.fixChanges:(o+=d.fixChanges,s+=1);let c=i.size>0?g(n/i.size):0,l=s>0?g(o/s):0,h={};for(let[C,d]of Object.entries(t)){let v=new Set(d);if(v.size===0)continue;let S=0;for(let P of v)S+=r[P]?.fixChanges??0;let w=g(S/v.size);h[C]={flaggedFiles:v.size,fixDensity:w,lift:l>0?g(w/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:c,baselineFixDensity:l,ratio:i.size>0&&l>0?g(c/l):null,byCategory:h,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function g(e){return Math.round(e*100)/100}function he(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function L(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${he(t)} score-weighted after ${r})`}function y(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${he(t)} score-weighted)`}function Ne(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${L(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${L(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${L(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${n.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&n.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${n.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query diff-gate\` or \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+L({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((n,o)=>{let s=t[n.impact]*i[n.effort];return t[o.impact]*i[o.effort]-s}),r}var pe={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function me(e,r){let t=e.filter(i=>i.kind===r).reduce((i,n)=>i+n.points,0);return Math.max(0,Math.min(100,100-t))}function je(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],n=[],o=(p,x,b)=>{x>0&&i.push({axis:p,points:x,detail:b,kind:pe[p]??"hygiene"})},s=(p,x,b,Me,Ae,Be,Fe)=>{let H=Math.max(Me,1);if(b<=H)return;let D=b/H,k=Math.min(Ae,Math.ceil(Math.log2(D)*Be));if(k<=0)return;let Te=pe[p]??"hygiene";n.push({axis:p,category:x,kind:Te,count:b,threshold:g(H),ratio:g(D),extraPenalty:k}),o(p,k,`${b} ${Fe} exceed pressure threshold ${g(H)} (${g(D)}x)`)},c=e.dead.count/t;o("dead-code",Math.min(20,Math.round(c*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;o("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),o("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let h=e.similarCount/t*1e3;o("similar",Math.min(10,Math.round(h)),`${e.similarCount} similar function pair(s)`);let C=e.duplicateBodies.count/t*1e3;o("duplicate-bodies",Math.min(10,Math.round(C*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let d=e.twinDrift.count/t*1e3;o("twin-drift",Math.min(10,Math.round(d*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let v=e.reactComponentDuplicates.count/r*1e3;o("react-component-duplicates",Math.min(10,Math.round(v)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let S=f(e.reactHookCandidates),w=S/r*1e3;o("react-hook-candidates",Math.min(10,Math.round(w)),y(e.reactHookCandidates,"duplicated React behavior pair(s)"));let P=e.reactLargeComponentPressure.count/r*1e3;o("react-large-component-pressure",Math.min(5,Math.round(P/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let De=e.vueComponentDuplicates.count/r*1e3;o("vue-component-duplicates",Math.min(10,Math.round(De)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let I=f(e.vueComposableCandidates),ke=I/r*1e3;o("vue-composable-candidates",Math.min(10,Math.round(ke)),y(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Ee=e.vueLargeViewPressure.count/r*1e3;o("vue-large-view-pressure",Math.min(5,Math.round(Ee/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let $=f(e.wrappers);o("wrappers",Math.min(3,$),y(e.wrappers,"wrapper candidate(s)"));let V=f(e.passthroughs);o("passthroughs",Math.min(3,V),y(e.passthroughs,"passthrough candidate(s)")),o("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Oe=e.drift.direct/r;if(o("drift",Math.min(5,Math.round(Oe*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),o("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;o("hidden-coupling",Math.min(5,Math.ceil(p/10)),y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:p},"co-changing pair(s) without a structural link"))}if(s("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),s("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;s("hidden-coupling-pressure","Hidden coupling",p,50,10,4,"score-weighted co-changing pair(s)")}return s("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),s("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),s("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),s("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),s("react-hook-candidates-pressure","Duplicated React hook behavior",S,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),s("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),s("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),s("vue-composable-candidates-pressure","Duplicated Vue behavior",I,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),s("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),s("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),s("wrappers-pressure","Wrapper functions",$,50,4,2,"wrapper candidate(s)"),s("passthroughs-pressure","Passthrough functions",V,50,4,2,"passthrough candidate(s)"),s("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),s("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:n}}import{getHeapStatistics as Ue}from"v8";var Ge=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ue();r.heap_size_limit-r.used_heap_size<Ge||e()}var We=50,qe=25e3,Ke=2500,ge=2500,fe=50,Ye=10,Xe=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],be={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ze(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:et(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:tt(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:rt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:nt(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:ot(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:st(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:ct(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:at(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:ut(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:dt(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:lt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:it(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:pt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:mt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:ht(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:vt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:bt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:gt(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ft(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:Ct(e,t)})};function fr(e,r={}){return Se(e,r.full!==!1,(t,i)=>{let n=Qe(e,r.scope,t,i),o=A(n);return o.detectorPrecision=de(le(e),Date.now()),o})}function Cr(e,r,t={}){return Je(e,[r],t)[0]}function Je(e,r,t={}){return Se(e,t.full!==!1,(i,n)=>{let o={...n,releaseCachesBetweenPhases:!1};return r.map(s=>be[s](e,t.scope,o,i))})}function Se(e,r,t){let i=ee(e),n=St(i,r);try{return t(i,n)}finally{M(e,{semanticProvider:!0}),B()}}function vr(e){return A(ye(e))}function ye(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Ce(e,"git-evidence")?.gitEvidence??null,suppressions:Ce(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Ce(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Qe(e,r,t,i){return ye(Xe.map(n=>be[n](e,r,i,t)))}function Ze(e,r,t){return a(e,t,"dead",()=>{let i=q(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(xt(e,i.symbols))})}function et(e,r,t){return a(e,t,"isolated",()=>{let i=X(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(Ht(e,i))})}function tt(e,r,t){return a(e,t,"cycles",()=>W(e,{scope:r}).filter(n=>n.kind==="real").length)}function rt(e,r,t){let i=a(e,t,"similar",()=>Q(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function it(e,r,t){return a(e,t,"extract-candidates",()=>Y(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function nt(e,r,t){return a(e,t,"duplicate-bodies",()=>{let i=j(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),n=new Set,o=0;for(let s of i)for(let c of s.functions.slice(1))n.add(c.file),o+=c.loc;return{count:i.length,loc:o,files:[...n]}})}function ot(e,r,t){return a(e,t,"twin-drift",()=>{let i=U(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(s=>s.relationship==="divergent"||s.relationship==="identical"),n=new Set,o=0;for(let s of i)for(let c of s.members)n.add(c.file),o+=c.loc;return{count:i.length,loc:o,files:[...n].sort()}})}function st(e,r,t){return a(e,t,"react-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ct(e,r,t){return a(e,t,"react-hook-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xe(i,Rt)})}function at(e,r,t){return a(e,t,"react-large-component-pressure",()=>{let i=ne(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Lt(i)})}function ut(e,r,t){return a(e,t,"vue-component-duplicates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function dt(e,r,t){return a(e,t,"vue-composable-candidates",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xe(i,Pt)})}function lt(e,r,t){return a(e,t,"vue-large-view-pressure",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function pt(e,r,t){return a(e,t,"wrapper-candidates",()=>{let i=te(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return we(i,Dt)})}function mt(e,r,t){return a(e,t,"passthrough-candidates",()=>{let i=J(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return we(i,kt)})}function ht(e,r,t){return a(e,t,"stale-abstractions",()=>{let i=Z(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),n=i.filter(o=>o.consumers===0).length;return{count:i.length,loc:i.reduce((o,s)=>o+s.loc,0),files:[...new Set(i.map(o=>o.file))],unused:n,singleUse:i.length-n}})}function gt(e,r){return a(e,r,"git-evidence",()=>{let t=z(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let n=t.commitHistory(),o=N(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),s={};for(let[c,l]of i)s[c]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:T(o.findings.reduce((c,l)=>c+ve(l),0)),top:o.findings.slice(0,5).map(c=>({fileA:c.fileA,fileB:c.fileB,together:c.together,confidence:c.confidence,focusedTogether:c.focusedTogether,broadTogether:c.broadTogether,broadCommitRatio:c.broadCommitRatio,lastTogetherAt:c.lastTogetherAt,recentTogether:c.recentTogether,commitScope:c.commitScope,recency:c.recency,scoreWeight:ve(c),subjectContext:c.subjectContext}))},fileStats:s,commitsScanned:n?.commits.length??0}})}function ft(e,r){return a(e,r,"suppressions",()=>{let t=ae(e);return{total:t.total,byCategory:{...t.byCategory}}})}function Ct(e,r){return a(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],n=G(e,t).filter(o=>o.status!=="ok");return{count:n.length,loc:0,files:[...new Set(n.map(o=>o.file))].sort()}})}function vt(e,r,t){return a(e,t,"drift",()=>{let i=K(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),n=i.results.filter(c=>c.kind!=="pattern-deviation"),o=n.filter(c=>c.actionTier==="direct").length,s=n.length-o;return{count:n.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:o,signal:s}})}function bt(e,r,t){return a(e,t,"complexity-hotspots",()=>{let i=ue(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:i.filter(n=>n.score>We).length}})}function St(e,r){let t=e.symbols>=qe||e.documents>=Ke,i=r?Number.POSITIVE_INFINITY:fe,n=r?Number.POSITIVE_INFINITY:Ye;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:n,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ge,candidateResultLimit:i,complexityResultLimit:n,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ge} symbols and reported their top ${fe} findings. Enable full mode for unbounded candidate counts.`]}}function yt(e,r){r.releaseCachesBetweenPhases&&(M(e),B())}function a(e,r,t,i){wt(t);try{return i()}finally{yt(e,r)}}function wt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function xt(e,r){return r.filter(t=>!E(e,t.relativePath)&&!O(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ht(e,r){return r.filter(t=>!E(e,t.relativePath)&&!O(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function we(e,r){return{...R(e),scoreCount:T(e.reduce((i,n)=>i+r(n),0))}}function Lt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function F(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function xe(e,r){return{...F(e),scoreCount:T(e.reduce((i,n)=>i+r(n),0))}}function Rt(e){let r=e.sharedHooks.length>0,t=He({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Le(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Pt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=He({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Le(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function He(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Pe.has(Re(r))).length+Math.min(e.functions.length,3)}function Le(e,r,t){let i=[...e,...r,...t].map(Re);return i.length>0&&i.every(n=>Pe.has(n))}function Re(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Dt(e){return e.actionTier==="signal"?.25:1}function kt(e){return e.actionTier==="signal"?.25:1}function ve(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function T(e){return Math.round(e*100)/100}var Pe=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Et as a,Xe as b,fr as c,Cr as d,Je as e,vr as f};
2
+ //# sourceMappingURL=chunk-4UQVNCQE.js.map
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-S7OYBOCK.js";import{x as e}from"./chunk-EKZTZXHZ.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
+ //# sourceMappingURL=chunk-55Q3WLZX.js.map
@@ -1,4 +1,4 @@
1
- import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as d,t as p}from"./chunk-RA3AYNWP.js";import{a as c}from"./chunk-64MNV6AB.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
1
+ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as d,t as p}from"./chunk-EKZTZXHZ.js";import{a as c}from"./chunk-NGEXCJJW.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN global_symbols gs ON der.symbol_id = gs.id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -20,4 +20,4 @@ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as
20
20
  ${n.symbolNoiseFor("gs")}
21
21
  AND d.relative_path IN (${i})
22
22
  ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
23
- //# sourceMappingURL=chunk-CTF2GDEX.js.map
23
+ //# sourceMappingURL=chunk-5E4WNAVD.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-SMQWE25B.js";import{b as g,d as m}from"./chunk-RA3AYNWP.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as d}from"./chunk-T7YQSHPQ.js";import{b as g,d as m}from"./chunk-EKZTZXHZ.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
- //# sourceMappingURL=chunk-ZCEJ63SP.js.map
3
+ //# sourceMappingURL=chunk-5I5G2QOX.js.map
@@ -0,0 +1,2 @@
1
+ import{H as c}from"./chunk-GH74ASD6.js";import{J as p,L as u}from"./chunk-WCCFZ7V7.js";import{d as a}from"./chunk-7S5E7KWT.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-6LDJQXAH.js.map
@@ -1,3 +1,3 @@
1
- import{a as S}from"./chunk-ZJ5CBXK3.js";import{a as y}from"./chunk-33KUO7CG.js";import{c as x}from"./chunk-2SNGN6U4.js";import{a as h,g as b}from"./chunk-LP3ARJKF.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as d}from"./chunk-RA3AYNWP.js";import{a as u,h as m,i as g}from"./chunk-MZZBAITE.js";import{P as f}from"./chunk-JORHF5AL.js";import{basename as L,extname as D}from"path";function K(n,e){let{scope:i,maxLoc:t=15,limit:r=30,scanLimit:a}=e??{},s=new x(n);return y({candidates:()=>A(n,s,i,t),orderCandidates:P,scanLimit:a,profile:{name:"passthrough-candidates"},prepare:o=>s.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,c)=>w(n,o,c.get(o.symbolId)??[]),orderResults:(o,c)=>o.loc-c.loc||o.file.localeCompare(c.file),limit:r})}function w(n,e,i){let t=j(i);if(t.size!==1||!m(n,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0],a=I(n,e,r),s=T(n,e),o=a.length>0||s.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:r.symbol,forwardsToShort:l(r.symbol),forwardsToFile:r.file,actionTier:o,boundaryEvidence:a,publicFacadeEvidence:s,recommendation:E(o,a,s)}}function I(n,e,i){return S(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(i.file,D(i.file))}])}function E(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return C(n,e)?h(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(n,e){let i=f(n,e.relativePath);if(i.length===0)return!1;let t=p(e.symbol);if(!t)return!1;let r=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{a as S}from"./chunk-N5W4YZMK.js";import{a as y}from"./chunk-ZTETIQ35.js";import{c as x}from"./chunk-UJCOIXDY.js";import{a as h,h as b}from"./chunk-26QA6FAI.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as d}from"./chunk-EKZTZXHZ.js";import{a as u,h as m,i as g}from"./chunk-UJPRPGCO.js";import{K as f}from"./chunk-WCCFZ7V7.js";import{basename as L,extname as D}from"path";function K(n,e){let{scope:i,maxLoc:t=15,limit:r=30,scanLimit:a}=e??{},s=new x(n);return y({candidates:()=>A(n,s,i,t),orderCandidates:P,scanLimit:a,profile:{name:"passthrough-candidates"},prepare:o=>s.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,c)=>w(n,o,c.get(o.symbolId)??[]),orderResults:(o,c)=>o.loc-c.loc||o.file.localeCompare(c.file),limit:r})}function w(n,e,i){let t=j(i);if(t.size!==1||!m(n,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0],a=I(n,e,r),s=T(n,e),o=a.length>0||s.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:r.symbol,forwardsToShort:l(r.symbol),forwardsToFile:r.file,actionTier:o,boundaryEvidence:a,publicFacadeEvidence:s,recommendation:E(o,a,s)}}function I(n,e,i){return S(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(i.file,D(i.file))}])}function E(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return C(n,e)?h(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(n,e){let i=f(n,e.relativePath);if(i.length===0)return!1;let t=p(e.symbol);if(!t)return!1;let r=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `),a=u(t);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${a}\\b|(?:const|let|var)\\s+${a}\\b)`,"m").test(r)?!0:R(i,t)}function R(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${u(e)}\\b`);return n.some(t=>i.test(t))}function F(n){return n.includes("public surface")}function j(n){let e=n.some(t=>d(t.symbol))?n.filter(t=>d(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i,t){return e.productionCallableDefinitions({scope:i,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(r=>!g(n,r))}export{K as a,C as b};
3
- //# sourceMappingURL=chunk-3EDFLQ6A.js.map
3
+ //# sourceMappingURL=chunk-6O5TICIZ.js.map
@@ -1,2 +1,2 @@
1
- import{A as s}from"./chunk-WUW7YUAH.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
- //# sourceMappingURL=chunk-ACAM6O5R.js.map
1
+ import{A as s}from"./chunk-GH74ASD6.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
+ //# sourceMappingURL=chunk-6SHPK5ZE.js.map
@@ -0,0 +1,49 @@
1
+ import{a as s}from"./chunk-S7OYBOCK.js";var c=`SELECT COUNT(*) AS shared
2
+ FROM (
3
+ SELECT definition_m.symbol_id
4
+ FROM documents definition_d
5
+ JOIN chunks definition_c ON definition_c.document_id = definition_d.id
6
+ JOIN mentions definition_m ON definition_m.chunk_id = definition_c.id
7
+ AND definition_m.role = 1
8
+ JOIN mentions reference_m ON reference_m.symbol_id = definition_m.symbol_id
9
+ AND reference_m.role != 1
10
+ JOIN chunks reference_c ON reference_c.id = reference_m.chunk_id
11
+ JOIN documents reference_d ON reference_d.id = reference_c.document_id
12
+ WHERE definition_d.relative_path = ?
13
+ AND reference_d.relative_path = ?
14
+ UNION
15
+ SELECT definition_m.symbol_id
16
+ FROM documents definition_d
17
+ JOIN chunks definition_c ON definition_c.document_id = definition_d.id
18
+ JOIN mentions definition_m ON definition_m.chunk_id = definition_c.id
19
+ AND definition_m.role = 1
20
+ JOIN mentions reference_m ON reference_m.symbol_id = definition_m.symbol_id
21
+ AND reference_m.role != 1
22
+ JOIN chunks reference_c ON reference_c.id = reference_m.chunk_id
23
+ JOIN documents reference_d ON reference_d.id = reference_c.document_id
24
+ WHERE definition_d.relative_path = ?
25
+ AND reference_d.relative_path = ?
26
+ )`;function u(e,d,n){let i=s(e,d)??d,r=s(e,n)??n,t=e.get(c,i,r,r,i);return{..._(i,r,t?.shared??0)}}function N(e,d={}){let{limit:n=20,scope:i}=d,r=i?"AND def_d.relative_path LIKE ? AND ref_d.relative_path LIKE ?":"",t=i?[`%${i}%`,`%${i}%`]:[];return e.all(`SELECT
27
+ def_d.relative_path AS file1,
28
+ ref_d.relative_path AS file2,
29
+ COUNT(DISTINCT gs.id) AS shared
30
+ FROM mentions m
31
+ JOIN chunks c ON m.chunk_id = c.id
32
+ JOIN documents ref_d ON c.document_id = ref_d.id
33
+ JOIN global_symbols gs ON m.symbol_id = gs.id
34
+ JOIN (
35
+ SELECT m2.symbol_id, c2.document_id
36
+ FROM mentions m2
37
+ JOIN chunks c2 ON m2.chunk_id = c2.id
38
+ WHERE m2.role = 1
39
+ GROUP BY m2.symbol_id
40
+ ) sym_def ON sym_def.symbol_id = gs.id
41
+ JOIN documents def_d ON sym_def.document_id = def_d.id
42
+ WHERE m.role != 1
43
+ AND def_d.id != ref_d.id
44
+ ${e.pathExclusionsFor("def_d","ref_d")}
45
+ ${r}
46
+ GROUP BY def_d.id, ref_d.id
47
+ ORDER BY shared DESC
48
+ LIMIT ?`,...t,n).filter(o=>!e.isIgnored(o.file1)&&!e.isIgnored(o.file2)).map(o=>_(o.file1,o.file2,o.shared))}function _(e,d,n){return{file1:e,file2:d,sharedSymbols:n,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${n} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{u as a,N as b};
49
+ //# sourceMappingURL=chunk-7BAVHKMJ.js.map
@@ -0,0 +1,16 @@
1
+ import{d as re,e as oe,f as se,g as v,h as T,i as ce,k as le,n as fe,o as ue}from"./chunk-HX7M4BDI.js";import{d as L}from"./chunk-T7YQSHPQ.js";import{Q as ae}from"./chunk-7WPLAODU.js";import{a as te}from"./chunk-C43RDDP4.js";import{e as b,s as ne,z as ie}from"./chunk-EKZTZXHZ.js";import{a as K,b as Q,f as R,p as M}from"./chunk-UJPRPGCO.js";import{H as A,x as ee}from"./chunk-GH74ASD6.js";import{J as p,j as w,k as E,m as X,o as F,t as q,v as y}from"./chunk-WCCFZ7V7.js";import{c as d,d as V}from"./chunk-7S5E7KWT.js";import{b as W,d as I}from"./chunk-C3KV2II6.js";function D(e,n,t,i={}){if(!t)return[];let r=p(e,n);return r?r.indexOf(t)===-1?[]:(O(e,n).get(t)??[]).filter(s=>!Ee(s,i)):[]}function Ee(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var Re=d("file-identifiers",{clearGroups:["whole-project","source-file"]});function me(e,n){let t=R(e,n);return t?t.fileIdentifiers:Re.get(e,n,()=>new Set(O(e,n).keys()))}var Me=d("file-ident-lines",{clearGroups:["whole-project","source-file"]});function O(e,n){let t=R(e,n);return t?t.identifierLineMap:Me.get(e,n,()=>De(e,n))}var ve=d("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function et(e,n){let t=R(e,n);return t?t.identifiersByLine:ve.get(e,n,()=>{let i=O(e,n),r=0;for(let s of i.values()){let c=s[s.length-1];c!==void 0&&c>r&&(r=c)}let o=new Array(r+1);for(let s=0;s<=r;s+=1)o[s]=new Set;for(let[s,c]of i)for(let a of c)o[a].add(s);return o})}function De(e,n){let t=new Map,i=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},r=p(e,n);if(!r)return t;let o=Q(r).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&i(l[1],c)}return t}function at(e,n){let t=pe(e);return t?n.filter(i=>pe(i.file)===t):n}function ct(e,n,t,i){let r=t.find(o=>o.file===n);if(r)return r;if(i){let o=new Set(M(e,n).map(s=>s.sourcePath).filter(s=>!!s));for(let s of t)for(let c of o)if(I(c,s.file))return s;return null}return t.length===1?t[0]:null}function pe(e){let n=ee(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var xe=V("global-leaf-index",{clearGroups:["whole-project"]});function j(e){return xe.get(e,()=>{let n=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")}`),t=new Map;for(let i of n){if(!i.relative_path||e.isIgnored(i.relative_path))continue;let r=b(i.symbol);if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.some(s=>s.symbolId===i.id)||o.push({symbol:i.symbol,symbolId:i.id,file:i.relative_path})}return t})}var _e=d("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function ge(e,n){let t=W(n);return _e.get(e,t,()=>Pe(e,t))}function Pe(e,n){let t=new Map;for(let i of M(e,n)){if(!i.sourcePath)continue;let r=i.localName??i.importedName;if(r&&de(t,r,i.sourcePath),i.kind==="namespace")for(let o of i.usedMembers)de(t,o,i.sourcePath)}return t}function de(e,n,t){let i=e.get(n);i||(i=new Set,e.set(n,i)),i.add(t)}var he=/[A-Za-z_$][A-Za-z0-9_$]*/g,ye=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Ne=512;function H(e){let n=[],t=!1;for(let i of e)i&&(t=!0,ye.test(i)||n.push(i));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function be(e,n){let t=ke(n)?n:H(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=Ne){for(let r of t.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 i;for(;(i=he.exec(e))!==null;)if(t.candidateNames.has(i[0]))return!0;for(let r of t.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 B(e,n,t){let i=j(e).get(t);if(!i||i.length===0)return[];if(i.length===1)return[C(i[0])];let r=i.filter(a=>a.file===n);if(r.length>0)return r.map(C);let o=ge(e,n),s=o.get(t);if(s)for(let a of s){let l=i.filter(u=>I(a,u.file));if(l.length>0)return l.map(C)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=i.filter(u=>I(a,u.file));if(l.length>0&&l.length===i.length)return l.map(C)}return[]}function vt(e,n,t){let i=B(e,n,t);if(i.length>0)return i;let r=j(e).get(t);return!r||r.length===0?[]:r.map(C)}function Se(e,n,t={}){let i=Fe(e,n);if(!i)return[];let r=L(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...r,leaf:i.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return x(e,c)}}let o=new Map;for(let s of A(e)){let c=Ae(e,i,s);c.length>0&&o.set(s,c)}return x(e,o)}function Fe(e,n){let t=L(e,n);if(!t)return null;let i=b(t.symbol);return i?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:i}:null}function Ae(e,n,t){let i=p(e,t);return!i||i.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!B(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:D(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Dt(e,n,t={}){let i=new Map;for(let a of n){if(!a.leaf)continue;let l=i.get(a.leaf)??[];l.push(a),i.set(a.leaf,l)}if(i.size===0)return new Map;let r=new Set(n.map(a=>a.symbolId)),o=new Set(i.keys()),s=H(o),c=new Map;for(let a of A(e)){if(t.skipPath?.(a)||!be(p(e,a),s))continue;let l=me(e,a);if(l.size!==0){for(let u of l)if(i.has(u))for(let g of B(e,a,u)){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 x(e,n){let t=[],i=new Set;for(let[r,o]of n){let s=ne(e,r);for(let c of o){let a=ie(s,c),l=`${r}|${c}|${a?.symbol??""}`;i.has(l)||(i.add(l),t.push({file:r,line:c,enclosingSymbol:a?.symbol??null}))}}return t}function Te(e,n){return Oe(e,[n]).get(n.symbolId)??[]}function Oe(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:$e(e,o)})).filter(o=>o.prelude!==null),i=Be(e,t.map(o=>o.symbolId)),r=new Map;for(let{symbolId:o,prelude:s}of t){let c=He(e,i.get(o)??new Map,s.match,s.identifier);r.set(o,x(e,c))}return r}function Ft(e,n,t={}){return je(e,n,t).map(i=>({file:i.file,line:i.line,enclosingSymbol:i.enclosingSymbol}))}function je(e,n,t={}){let i=Se(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),r=i.length>0?Ie(i,"source-attribution"):Ie(Te(e,n),"scip-reference-chunk");return t.includeIgnored===!0?r:r.filter(o=>!e.isIgnored(o.file))}function Ie(e,n){return e.map(t=>({...t,provenance:n}))}function He(e,n,t,i){let r=new Map;for(let[o,s]of n)r.set(o,ze(e,o,s,t,i));return r}function Be(e,n){let t=new Map;for(let i of re(e,n)){if(e.isIgnored(i.relative_path))continue;let r=t.get(i.symbol_id);r||(r=new Map,t.set(i.symbol_id,r));let o=r.get(i.relative_path);o||(o=[],r.set(i.relative_path,o)),o.push({start_line:i.chunk_start,end_line:i.chunk_end})}return t}function ze(e,n,t,i,r){let o=n===i.relativePath?{excludeStartLine:i.startLine,excludeEndLine:i.endLine}:{},s=r?D(e,n,r,o):[];return t.flatMap(c=>Ge(s,c))}function Ge(e,n){let t=e.filter(i=>i>=n.start_line&&i<=n.end_line);return t.length>0?t:[n.start_line]}function $e(e,n){let t=L(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}var Zt={references:le,referenceMap:fe,callerMap:(e,n)=>T(e).callerMap(n),calleeMap:Ue};function Ue(e,n){let t=q(),i=new Map,r=ce(e,n),o=[],s=[],c=0,a=0,l=0,u=0,g=0,h=0,z=0;for(let{definition:f,callees:m}of r.hits)g+=1,m.length>0&&(h+=1,z+=m.length,i.set(f.symbolId,m));let S=Je(e,r.hits);if(S.entries.length>0&&y("semantic.callees.prefetch-cache-write",()=>F(e,S.entries),()=>({entries:S.entries.length,sourceMissing:S.sourceMissing,skippedUnsupportedLanguage:S.skippedUnsupportedLanguage})),y("semantic.callees.cache-scan",()=>{for(let[f,m]of oe(r.misses)){if(!v(f)){t&&(c+=m.length);continue}let J=p(e,f);if(!J){t&&(a+=m.length),s.push(...m);continue}let Z=E(e,f,J),P=Le(e,f);if(!P){s.push(...m);continue}let Ce=X(e,f,Z,P);for(let N of m){let Y=Ce.get(N.symbol)??null;if(Y!==null){let k=Ye(Y);if(k){t&&(l+=1),k.length>0&&i.set(N.symbolId,k);continue}t&&(u+=1)}o.push({def:N,contentHash:Z,depsDigest:P})}}},()=>({definitions:n.length,skippedUnsupportedLanguage:c,sourceMissing:a,cacheHits:l,parseFailures:u,misses:o.length,unkeyed:s.length,inMemoryHits:g,inMemoryRows:h,inMemoryCalleeCount:z,resultRows:i.size})),o.length===0&&s.length===0)return i;let G=[...s,...o.map(f=>f.def)],$=0,U=y("semantic.callees.compute-misses",()=>{let f=ue(e,G);return $=f.size,f},()=>({definitions:G.length,misses:o.length,unkeyed:s.length,rows:$}));for(let[f,m]of U)i.set(f,m);let _=o.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 _.length>0?y("semantic.callees.cache-write",()=>F(e,_),()=>({entries:_.length})):y("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:o.length})),i}function Je(e,n){let t=[],i=new Map,r=0,o=0;for(let{definition:s,callees:c}of n){if(!v(s.relativePath)){o+=1;continue}if(!i.has(s.relativePath)){let l=p(e,s.relativePath),u=l?Le(e,s.relativePath):null;i.set(s.relativePath,l&&u?{contentHash:E(e,s.relativePath,l),depsDigest:u}:null)}let a=i.get(s.relativePath);if(!a){r+=1;continue}t.push({relativePath:s.relativePath,symbol:s.symbol,contentHash:a.contentHash,depsDigest:a.depsDigest,payload:JSON.stringify(c)})}return{entries:t,sourceMissing:r,skippedUnsupportedLanguage:o}}var Ze="typescript-callees-v1";function Le(e,n){let t=v(n);if(t==="typescript")return ae(e,n,Ze)?.key??null;let i=Ve(e,n);return t==="rust"?w(JSON.stringify({kind:"semantic-callees",language:t,engine:se(e.config.projectRoot),positionMapping:"nearby-leaf-v1",depsDigest:i})):i}function Ye(e){try{return JSON.parse(e)}catch{return null}}var We=d("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function Ve(e,n){return We.get(e,n,()=>{let i=[...te(e).get(n)??[]].sort().map(r=>`${r}:${E(e,r,p(e,r))}`);return w(i.join("|"))})}export{O as a,et as b,at as c,ct as d,j as e,H as f,be as g,ge as h,B as i,vt as j,Dt as k,Te as l,Oe as m,Ft as n,Zt as o};
16
+ //# sourceMappingURL=chunk-7O5IKBTZ.js.map
@@ -1,4 +1,4 @@
1
- import{k as f,q as u}from"./chunk-VVY2G5ET.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
1
+ import{f,l as u}from"./chunk-2KAZEZ6M.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
2
2
  `)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
3
3
  # Dependencies
4
4
  node_modules/
@@ -57,4 +57,4 @@ Thumbs.db
57
57
  # Type definitions (often noise in queries)
58
58
  *.d.ts
59
59
  `;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
60
- //# sourceMappingURL=chunk-WJL2L6MV.js.map
60
+ //# sourceMappingURL=chunk-7PIO7NKH.js.map
@@ -0,0 +1,2 @@
1
+ var b=[];function p(t){t.groups.length>0&&b.push(t)}function D(t,c){let a=new Set(c.groups);for(let n of b)n.groups.some(r=>a.has(r))&&(c.file!==void 0&&n.clearFile?n.clearFile(t,c.file):n.clearAll(t))}function g(){let t=new WeakMap;return{cache:t,ensure(c){let a=t.get(c);return a||(a=new Map,t.set(c,a)),a}}}function f(t,c){let{cache:a,ensure:n}=g(),r={get(e,i,o){let s=n(e);if(s.has(i))return s.get(i);let l=o();return s.set(i,l),l},invalidate(e,i){a.get(e)?.delete(i)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:t,groups:c.clearGroups,clearAll:e=>r.invalidateAll(e),clearFile:(e,i)=>r.invalidate(e,i)}),r}function S(t,c){let a=new WeakMap,n={get(r,e){let i=a.get(r);if(i)return i.value;let o=e();return a.set(r,{value:o}),o},invalidate(r){a.delete(r)},has(r){return a.has(r)}};return p({name:t,groups:c.clearGroups,clearAll:r=>n.invalidate(r)}),n}var h={clearGroups:["whole-project","source-file"]};function P(t){return C(t,h)}function C(t,c){let{cache:a,ensure:n}=g(),r={get(e,i,o,s){let l=n(e),u=l.get(i);if(u&&u.source===o)return u.value;let d=s();return l.set(i,{source:o,value:d}),d},invalidate(e,i){a.get(e)?.delete(i)},invalidateAll(e){a.delete(e)}};return p({name:t,groups:c.clearGroups,clearAll:e=>r.invalidateAll(e),clearFile:(e,i)=>r.invalidate(e,i)}),r}export{p as a,D as b,f as c,S as d,P as e,C as f};
2
+ //# sourceMappingURL=chunk-7S5E7KWT.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-33KUO7CG.js";import{c as m}from"./chunk-2SNGN6U4.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-RA3AYNWP.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-YLFORA5G.js.map
1
+ import{a as g}from"./chunk-ZTETIQ35.js";import{c as m}from"./chunk-UJCOIXDY.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-EKZTZXHZ.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
+ //# sourceMappingURL=chunk-7SQQWSY3.js.map
@@ -0,0 +1,5 @@
1
+ import{a as R,b as G,c as ve,d as Ae,e as _,g as Te,k as Fe,l as F,m as te,o as ne,p as re,q as Ne,s as je}from"./chunk-BS2NMXQZ.js";import{a as $}from"./chunk-C43RDDP4.js";import{A as De,C as ke,D as qe,a as xe,b as Ie,e as O,g as Re,j as ie,v as oe,y as Le}from"./chunk-WCCFZ7V7.js";import{a as Be}from"./chunk-NGEXCJJW.js";import{d as Ee}from"./chunk-7S5E7KWT.js";import{b as Me,c as u,j as we,m as b,q as Pe}from"./chunk-2KAZEZ6M.js";import{join as yt}from"path";var gt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function tr(t,e={}){return se(yt(t,"gc.lock"),e)}function se(t,e={}){let n=e.waitMs??0,r=e.pollMs??10,i=e.now??_,o=i()+n;do{let s=bt(t);if(s)return ht(s);let a=o-i();if(a<=0)return null;St(Math.min(r,a))}while(i()<=o);return null}function bt(t){let e=Te(t,{kind:"generic",parseLegacy:gt});return e.kind==="acquired"?e.lock:null}function ht(t){return{release:()=>{t.release()}}}function St(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}function Ce(t,e,n={}){ne(t,Oe(e,n),{durability:"visibility",runtime:n.runtime})}function ir(t,e,n={}){return ne(t,Oe(e,n),{durability:"durable",runtime:n.runtime})}function Oe(t,e){let n=JSON.stringify(t,null,e.spacing);return e.trailingNewline?`${n}
2
+ `:n}import{execFileSync as _e}from"child_process";import{createHash as xt}from"crypto";import{existsSync as z,statSync as It}from"fs";import{createRequire as Mt}from"module";import{platform as Rt}from"os";import{dirname as Ge,join as E}from"path";var wt=Mt(import.meta.url),yr={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function ae(t){return[t.indexerBinary,...t.binaryAliases??[]]}function Pt(t){let e=ae(t);return e.length===1?e[0]:e.join(" or ")}function ce(t){for(let e of ae(t)){let n=je(e);if(n)return n}return At(t)}function gr(t){return ce(t)!==null||vt(t)}function vt(t){return $e(t)!==null}function At(t){let e=$e(t);if(!e)return null;let r=JSON.parse(b(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return E(Ge(e),r);for(let i of ae(t)){let o=r[i];if(o)return E(Ge(e),o)}return null}function $e(t){if(!t.bundledNpmPackage)return null;try{return wt.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function Tt(t,e){for(let n of t.projectLocalBinaries??[]){let r=E(e,n);if(z(r))return r}return null}function Ft(t,e){for(let n of t.projectLocalBinaries??[]){let r=E(e,n);if(z(r))return ze(e,n,r)}return null}function br(t,e){let n=Et(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function Et(t,e){try{return ze(t,e.relativePath,e.configuredPath)}catch{return null}}function ze(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=ke(t,e,r),o=qe(t,e,r),s=It(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:xt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function Bt(t,e,n={}){return(n.trustProjectTools?Ft(t,e)?.canonicalPath:null)??ce(t)}function hr(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||de(n,e))return e;let r=We(n,e);return r?{...e,DOTNET_ROOT:r}:e}function Sr(t,e,n={}){let r=Pt(t),i=e?Bt(t,e,n):ce(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&Tt(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=Lt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function Lt(t){if(de(t,process.env))return{runnable:!0};let e=We(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=Je(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 We(t,e){for(let n of Je(e))if(de(t,{...e,DOTNET_ROOT:n}))return n;return null}function Je(t){let e=[],n=t.DOTNET_ROOT;if(n&&z(n)&&e.push(n),Rt()==="darwin"&&Ne("brew"))try{let r=_e("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=E(r,"libexec");z(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function de(t,e){try{return _e(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var Dt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function W(t){let e=t.toLowerCase();return Dt.some(n=>e.endsWith(n))}function H(t){let e=J(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(c=>[c.path,c])),i=t.snapshot.files.filter(c=>{let m=xe(c.path,["typescript"]);return m==="config"||m==="ambient"}).map(c=>c.path),o=J([...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=>He(r.get(c))),p=ie(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:J(t.snapshot.typescriptProjects),membership:e})),l=new Map;return{identityFor(c,m){if(!n.has(c))return w("target-outside-project");if(a)return w("duplicate-input-path");if(s)return w("missing-input-fingerprint");if(d)return w("unreadable-input");let g=[],f,I;if(t.graph===null)g.push("dependency-graph-unavailable"),I="whole-project",f=o;else{let C=qt(c,t.graph,l);if(C.find(ee=>!r.has(ee)))return w("missing-input-fingerprint");if(f=J([...C,...i]),f.some(ee=>He(r.get(ee))))return w("unreadable-input");I="dependency-closure"}let j=f.map(C=>Nt(r.get(C)));return{version:1,key:ie(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:p,inputs:j})),mode:I,inputFiles:f,reasons:g}}}}function kt(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 qt(t,e,n){let r=n.get(t);if(r)return r;let i=kt(t,e);return n.set(t,i),i}function Nt(t){return{path:t.path,size:t.size,hash:t.hash}}function He(t){return t.size<0||t.hash==="unreadable"}function w(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function J(t){return[...new Set(t)].sort()}import{createRequire as jt}from"module";var Ue=jt(import.meta.url),B,U;function Ct(){if(B!==void 0)return B;try{B=Ue("ts-morph")}catch{B=null}return B}function V(){if(U)return U;let t=Ct();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=Ue("ts-morph/package.json").version??"unknown"}catch{}return U=`ts-morph:${e}:typescript:${t.ts.version}`,U}function vr(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function Ar(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var Ot=Ee("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function le(t,e,n){let r=Ot.get(t,()=>Gt(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 L(t){return Be(t,{includeIgnored:!1}).filter(W).sort()}function Gt(t){try{if(!t.generation.metadataRaw)return null;let e=O(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=Ie(e.metadata.fingerprint);return n?{builder:H({projectFiles:L(t),snapshot:n,graph:$(t),engineIdentity:V()}),identities:new Map}:null}catch{return null}}function K(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,_t(o));return r}function Qe(t,e,n){let r=Ke(t,e),i=Ke(t,n),o=[...r].filter(c=>!i.has(c)).sort(),s=[...i].filter(c=>!r.has(c)).sort(),a=Ve(t,e),d=Ve(t,n),p=[...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:p.length===0&&l.length===0,expectedCount:a.size,actualCount:d.size,missing:p,extra:l}}}function Ve(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 Cr(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,$t(s));return i}function Ke(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 _t(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(Xe)}function $t(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)||Xe(n.location,r.location))}function Xe(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var ue="typescript-reference-fragment-v2",X=Le({kind:"typescript-reference-fragments",invalidation:De("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Wt});function Vr(t,e,n,r=t){let i=L(t),o=H({projectFiles:i,snapshot:e,graph:$(t),engineIdentity:V()}),s=[...n].map(([a,d])=>({relativePath:a,contentHash:o.identityFor(a,ue).key,value:[...d]}));if(s.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return X.writeBatch(r,s.map(a=>({...a,contentHash:a.contentHash}))),s.length}function Kr(t,e,n,r){let i=e.filter(s=>W(s.relativePath));if(i.length===0)return Q("no TypeScript definitions");let o=Q("shadow did not run");return oe("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=Q("TypeScript reference fragment provider is unavailable"),o;let a=L(t),d=new Set(a),p=s.referenceFragmentsForFiles(a),l=K(i,p),c=Qe(i,zt(n,d),l);if(!c.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...c},o;let m=[];for(let g of a){let f=le(t,g,ue);f?.key&&m.push({relativePath:g,contentHash:f.key,value:p.get(g)??[]})}return X.writeBatch(t,m),o={state:"passing",files:a.length,keyedFiles:m.length,writtenFiles:m.length,...c},o}catch(s){return o=Q(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function zt(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 oe("typescript.reference-fragments.materialize",()=>{try{let d=L(t);i=d.length;let p=new Map,l=new Map,c=[];for(let f of d){let I=le(t,f,ue);if(!I?.key)return null;p.set(f,I.key);let j=X.read(t,f,I.key);j===null?(s+=1,c.push(f)):(o+=1,l.set(f,j))}if(s===0)return r="hit",{references:K(e,l),files:i,cacheHits:o,cacheMisses:s,computedFiles:a};let m=n(e[0].relativePath);if(!m.availability().available||!m.referenceFragmentsForFiles)return null;let g=m.referenceFragmentsForFiles(c);if(c.some(f=>!g.has(f)))return null;a=g.size,X.writeBatch(t,c.map(f=>({relativePath:f,contentHash:p.get(f),value:g.get(f)??[]})));for(let[f,I]of g)l.set(f,I);return r="computed",{references:K(e,l),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function Q(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Wt(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Jt)?null:e}catch{return null}}function Jt(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 Ht,randomUUID as Ut}from"crypto";import{existsSync as k,mkdirSync as Vt,readdirSync as Kt,rmSync as Ze,statSync as et}from"fs";import{basename as Qt,dirname as ye,join as x}from"path";var Xt=1,Yt=1,Zt=".scipquery-generations",en="manifest.json",tt="readers",tn="gc.lock",nn=128,D=new Map,nt={pid:process.pid,now:()=>new Date,randomToken:()=>Ut(),isProcessAlive:Ae,readProcessIdentity:ve};function P(t){return x(ye(t),Zt)}function rn(t){return x(P(t),tn)}function ci(t,e=nt){let n=se(rn(t.dbPath),{waitMs:5e3});if(!n)throw new Error("SQLite generation retention is busy; retry opening the index.");let r;try{let i=ln(t);if(i.source!=="immutable")return{generation:i,release(){}};let o=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let s=x(P(t.dbPath),tt);Vt(s,{recursive:!0}),r=x(s,`${e.pid}-${o}.json`);let a=e.readProcessIdentity(e.pid);Ce(r,{version:1,token:o,generationIdentity:i.identity,pid:e.pid,...a?{processIdentity:a}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let d=!1;return{generation:i,release(){d||!r||(d=!0,Ze(r,{force:!0}))}}}finally{n.release()}}function di(t,e,n=nt,r={}){let i=x(P(t),tt);if(!k(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,d=0;for(let p of Kt(i,{withFileTypes:!0})){if(!p.isFile()||!p.name.endsWith(".json"))continue;let l=x(i,p.name),c;try{c=on(JSON.parse(b(l,"SQLite generation reader lease")))}catch{c=null}if(!c){d+=1;for(let m of e)o.add(m);continue}if(!sn(c,n)){r.removeStale!==!1&&(Ze(l,{force:!0}),a+=1);continue}s+=1,o.add(c.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:d}}function on(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=e.processIdentity===void 0?null:R(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...n?{processIdentity:n}:{},acquiredAt:e.acquiredAt}}function sn(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let n=e.readProcessIdentity(t.pid);return n===null||G(t.processIdentity,n)}function an(t){try{let e=JSON.parse(b(x(P(t),"state.json"),"SQLite generation state"));return gn(e)?e:null}catch{return null}}function cn(t,e){return dn(P(t),e)}function dn(t,e){try{let n=JSON.parse(b(x(t,e,en),"SQLite generation manifest"));return yn(n,e)?n:null}catch{return null}}function ln(t){let e=an(t.dbPath);if(e){let n=pn(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(k(x(ye(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return fn(t,e?.currentGeneration)}function un(t){return Re(O(t))??t}function pn(t,e){try{let n=x(P(t.dbPath),e),r=cn(t.dbPath,e);if(!r)return null;let i=pe(n,r.database),o=r.index?pe(n,r.index):void 0,s=r.metadata?pe(n,r.metadata):void 0;return!fe(i,r.database)||r.index&&(!o||!fe(o,r.index))||r.metadata&&(!s||!fe(s,r.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:b(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function fn(t,e){let n=rt(t.dbPath),r=x(ye(t.dbPath),"meta.json"),i=k(r)?b(r,"reindex metadata"):void 0,o=k(t.indexPath)?t.indexPath:void 0;return{identity:e??mn(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:r,metadataRaw:i},source:"legacy",databaseFileIdentity:n}}function mn(t,e){let n=Ht("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&n.update(un(e)),n.update(`\0${rt(t)}`),n.digest("hex")}function rt(t){let e=et(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function pe(t,e){if(Qt(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return x(t,e.file)}function fe(t,e){if(!k(t))return!1;let n=Ye(t);if(!n||n.size!==e.size)return!1;let r=`${t}\0${e.sha256}\0${n.identity}`;if(D.has(r))return!0;let i=Pe(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=Ye(t);if(!o||o.identity!==n.identity||i!==e.sha256)return!1;for(D.set(r,!0);D.size>nn;){let s=D.keys().next().value;if(s===void 0)break;D.delete(s)}return!0}function Ye(t){let e=et(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function yn(t,e){return t.version===Yt&&t.identity===e&&me(t.database)&&(t.index===void 0||me(t.index))&&(t.metadata===void 0||me(t.metadata))}function me(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 gn(t){return t.version===Xt&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&bn(t.stableMirrors)&&hn(t.previousGeneration)&&Sn(t.publication)}function bn(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 hn(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 xn,randomUUID as ct}from"crypto";import{existsSync as T,lstatSync as N,readdirSync as A,renameSync as dt,rmSync as M}from"fs";import{basename as ge,dirname as In,join as y}from"path";function Y(t){return Array.isArray(t)?`[${t.map(Y).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>`${JSON.stringify(e)}:${Y(n)}`).join(",")}}`:JSON.stringify(t)}var Mn=1,Rn=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}),v=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},wn=".owner.json",Pn={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function Ii(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function vn(t={}){let e={...Rn,...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 lt(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>Fe(n));return te(...e)}function Mi(t,e){return xn("sha256").update(Y({namespace:t,payload:e})).digest("hex")}function An(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=vn(n.limits),i=n.nowMs??Date.now(),o=lt(t);return qn(e),Fn(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??_,()=>{Tn(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),d=it(t,e.id);if(d){let m=ot(d,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:m.deadlineAtMs??e.deadlineAtMs}}let p=`${JSON.stringify(e)}
3
+ `,l=Buffer.byteLength(p),c=ut(t);if(l>r.maxItemBytes)throw new v("item-too-large",c,r,l);if(c.totalItems+1>r.maxItems)throw new v("item-capacity",c,r,l);if(c.totalBytes+l>r.maxBytes)throw new v("byte-capacity",c,r,l);n.onBeforePublish?.();try{let m=re(s,p,{durability:"durable"}),g=te(o,m.directorySync);return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:g==="synced"?"directory-durable":"file-flushed",directorySync:g}}catch(m){if(m.code!=="EEXIST")throw m;let g=it(t,e.id);if(!g)throw m;let f=ot(g,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:f.deadlineAtMs??e.deadlineAtMs}}})}function Tn(t,e,n,r=Pn){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of he(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(T(a)){M(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||Dn(t,s.ownerId,r)!=="dead")continue;let d=y(t.pendingDir,s.originalFile);try{dt(s.path,d),i.reclaimed++}catch(p){if(p.code!=="EEXIST")throw p;M(s.path,{force:!0})}F(In(s.path)),F(t.pendingDir),o--}o=st(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=st(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 pt(s)){if(o<=0)break;ge(a).includes(".tmp-")&&(N(a).mtimeMs+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--))}}return Nn(t.inflightDir),i}function ut(t){lt(t);let e=[...q(t.pendingDir).map(d=>({path:d,pending:!0})),...q(t.legacyRequestDir).map(d=>({path:d,pending:!0}))],n=he(t.inflightDir).map(d=>({path:d.path,pending:!1})),r=q(t.responseDir).map(d=>({path:d,pending:!1})),i=q(t.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let d of e){let p=Se(d.path);if(!p){s++;continue}let l=p.enqueuedAtMs??N(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,p)=>d+jn(p.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Fn(t,e,n,r,i){let o=y(t.rootDir,".admission.lock"),s=`${process.pid}-${ct()}`,a=r()+Math.max(0,n);for(;!En(t.rootDir,o,s);){if(Bn(o),r()>=a)throw new v("admission-busy",ut(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return i()}finally{try{be(o).ownerToken===s&&(M(o,{recursive:!0,force:!0}),F(t.rootDir))}catch{}}}function En(t,e,n){let r=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
4
+ `;try{return re(e,r,{durability:"durable"}),!0}catch(i){if(i.code==="EEXIST")return!1;try{be(e).ownerToken===n&&(M(e,{force:!0}),F(t))}catch{}throw i}}function Bn(t){let e=null;try{let r=be(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||Ln(e))return;let n=`${t}.stale-${ct()}`;try{dt(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}M(n,{recursive:!0,force:!0})}function be(t){try{return JSON.parse(b(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof we&&e.reason==="not-regular"))throw e;return JSON.parse(b(y(t,"owner.json"),"mailbox lock owner record"))}}function Ln(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function Dn(t,e,n){let r=kn(y(t.inflightDir,ft(e),wn));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?G(r.processIdentity,i)?"live":"dead":"unknown"}function kn(t){try{let e=JSON.parse(b(t,"mailbox owner record"));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:R(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 it(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(T(n))return n;for(let n of he(t.inflightDir))if(n.requestId===e)return n.path;return null}function ot(t,e,n){let r=Se(t);if(!r||r.operationKey!==e)throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`);return r}function qn(t){if(t.mailboxVersion!==Mn||t.id!==An(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 he(t){if(!T(t))return[];let e=[];for(let n of A(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=at(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of A(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=at(s[1]),d=Number(s[2]);if(a===null||ge(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(d))continue;let p=y(i,o.name),l=Se(p)??{id:ge(a,".json")},c=N(p);e.push({requestId:l.id,ownerId:r,path:p,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 Se(t){try{let e=JSON.parse(b(t,"mailbox record"));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 st(t,e,n,r,i){for(let o of q(t)){if(e<=0)break;let s=N(o);n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function q(t){return T(t)?A(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function pt(t){if(!T(t))return[];let e=[];for(let n of A(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...pt(r))}return e.sort()}function Nn(t){if(T(t))for(let e of A(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);A(n).some(r=>r.endsWith(".claim"))||M(n,{recursive:!0,force:!0})}}function jn(t){try{return N(t).size}catch{return 0}}function ft(t){return Buffer.from(t,"utf8").toString("base64url")}function at(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return ft(e)===t?e:null}catch{return null}}import{join as Z}from"path";var Cn="watch.lock",On="watch-state.json",Gn="watch-activity.json",_n="watch-refresh-requests";function Fi(t){return{lockPath:Z(t,Cn),statePath:Z(t,On),activityPath:Z(t,Gn),refreshRequestsPath:Z(t,_n)}}function Ei(t){try{return $n(JSON.parse(b(t,"watch service state")))}catch{return null}}function $n(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"||!S(e.startedAt)||!S(e.heartbeatAt)||!S(e.lastActivityAt)||!zn(e.watcher)||e.idleDeadlineAt!==void 0&&!S(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=R(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&&!Wn(e.lastError)||e.lastRefresh!==void 0&&!Jn(e.lastRefresh)||e.reindexActivity!==void 0&&!Hn(e.reindexActivity)||e.refreshRequests!==void 0&&!Un(e.refreshRequests)||e.typescriptSemantic!==void 0&&!Vn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Kn(e.typescriptIndex)?null:e}function S(t){return Me(t)}function zn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return h(e.changedFiles)&&h(e.reindexAt);case"indexing":return h(e.startedAt);case"cooldown":return h(e.until)&&typeof e.dirty=="boolean";case"draining":return h(e.startedAt)&&typeof e.reason=="string";default:return!1}}function Wn(t){if(!t||typeof t!="object")return!1;let e=t;return S(e.at)&&typeof e.message=="string"}function Jn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&S(e.startedAt)&&S(e.completedAt)&&h(e.durationMs)}function Hn(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!u(e.recordsRead)||e.invalidRecords!==void 0&&!u(e.invalidRecords)||e.skippedRecords!==void 0&&!u(e.skippedRecords)||e.readErrors!==void 0&&!u(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!u(e.ignoredPartialTailBytes)||!S(e.windowStartedAt)||!S(e.windowEndedAt)||!u(e.runs)||!u(e.rebuilt)||!u(e.reused)||!u(e.failed)||!u(e.suppressed)||!h(e.estimatedLogicalOutputBytes)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"?!1:Object.values(e.byTrigger).every(n=>n===void 0||u(n))}function Un(t){if(!t||typeof t!="object")return!1;let e=t;return u(e.pending)&&u(e.claimed)&&u(e.completed)&&u(e.expired)&&u(e.invalid)&&(e.oldestPendingAt===void 0||S(e.oldestPendingAt))}function Vn(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")&&h(e.requests)&&h(e.sessionsCreated)&&h(e.sessionsReused)&&h(e.sessionsRefreshed)&&h(e.sessionsReplaced)&&h(e.projectsCreated)&&(e.lastRequestAt===void 0||S(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||S(e.busyUntil))&&(e.mailbox===void 0||mt(e.mailbox))}function Kn(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")&&u(e.requests)&&u(e.sessionsCreated)&&u(e.sessionsReplaced)&&u(e.initializations)&&u(e.programUpdates)&&u(e.documentsEmitted)&&u(e.documentsRemoved)&&(e.lastRequestAt===void 0||S(e.lastRequestAt))&&(e.lastDurationMs===void 0||h(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||S(e.busyUntil))&&(e.mailbox===void 0||mt(e.mailbox))}function mt(t){if(!t||typeof t!="object")return!1;let e=t;return u(e.pending)&&u(e.inflight)&&u(e.responses)&&u(e.deadLetters)&&u(e.invalid)&&u(e.totalItems)&&h(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||S(e.oldestPendingAt))}function h(t){return typeof t=="number"&&Number.isFinite(t)}export{tr as a,se as b,Ce as c,ir as d,Xt as e,Yt as f,Zt as g,en as h,P as i,rn as j,ci as k,di as l,an as m,cn as n,dn as o,ln as p,un as q,rt as r,yr as s,Pt as t,ce as u,gr as v,Tt as w,Ft as x,br as y,hr as z,Sr as A,Y as B,Mn as C,Ii as D,Mi as E,An as F,Ri as G,Fi as H,Ei as I,Dt as J,W as K,Ct as L,vr as M,Ar as N,Cr as O,H as P,le as Q,Vr as R,Kr as S,Qr as T};
5
+ //# sourceMappingURL=chunk-7WPLAODU.js.map
@@ -0,0 +1,20 @@
1
+ import{k as l,p as d,r as u}from"./chunk-7WPLAODU.js";import{f as c}from"./chunk-C3KV2II6.js";import h from"better-sqlite3";var m=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],o=class{constructor(t,e){this.connection=t;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(t){try{for(let e of m)this.connection.pragma(e);t(this.connection)}catch(e){try{this.close()}catch(n){throw new AggregateError([e,n],"SQLite initialization and rollback both failed.",{cause:n})}throw e}}close(){if(!this.active)return;this.active=!1;let t,e;try{this.connection.close()}catch(n){t=n}try{this.releaseGenerationReader()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"SQLite connection close and generation-reader release both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}},b=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],p=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null;let n=S(t),i=new o(n.db,n.release);try{i.initialize(y),this.generation=n.generation,this.connection=n.db,this.connectionOwnership=i,this.db=g(n.db)}catch(r){try{i.close()}catch(s){throw new AggregateError([r,s],"SQLite construction and rollback both failed.",{cause:s})}throw r}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
2
+ EXISTS (
3
+ SELECT 1
4
+ FROM defn_enclosing_ranges local_der
5
+ JOIN documents local_d ON local_der.document_id = local_d.id
6
+ WHERE local_der.symbol_id = gs.id
7
+ ${this.pathExclusionsFor("local_d").trimStart()}
8
+ )
9
+ OR EXISTS (
10
+ SELECT 1
11
+ FROM mentions local_m
12
+ JOIN chunks local_c ON local_m.chunk_id = local_c.id
13
+ JOIN documents local_d ON local_c.document_id = local_d.id
14
+ WHERE local_m.symbol_id = gs.id
15
+ AND local_m.role = 1
16
+ ${this.pathExclusionsFor("local_d").trimStart()}
17
+ )
18
+ )`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>b.flatMap(n=>[`AND ${e}.relative_path NOT LIKE '${n}/%'`,`AND ${e}.relative_path NOT LIKE '%/${n}/%'`])).join(`
19
+ `)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.connectionOwnership.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.connection.prepare(t),this.statementCache.set(t,e)),e}};function g(a){return Object.freeze({prepare(t){let e=a.prepare(t);if(!e.readonly||!e.reader)throw new Error("ScipDatabase.db only permits read-only statements that return rows.");return f(e)}})}function f(a){let t={get:(...e)=>a.get(...e),all:(...e)=>a.all(...e),iterate:(...e)=>a.iterate(...e),pluck(e){return e===void 0?a.pluck():a.pluck(e),t},expand(e){return e===void 0?a.expand():a.expand(e),t},raw(e){return e===void 0?a.raw():a.raw(e),t},bind(...e){return a.bind(...e),t},columns:()=>a.columns(),safeIntegers(e){return e===void 0?a.safeIntegers():a.safeIntegers(e),t}};return Object.freeze(t)}function y(a){if(!a.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=a.prepare("SELECT relative_path FROM documents").iterate();for(let n of e)c(n.relative_path)}function S(a){for(let t=0;t<4;t+=1){let e=l(a),n=e.generation,i;try{i=new h(n.databasePath,{readonly:!0,fileMustExist:!0})}catch(r){throw e.release(),r}if(n.source==="immutable")return{db:i,generation:n,release:e.release};try{let r=d(a);if(n.databaseFileIdentity===u(n.databasePath)&&r.source==="legacy"&&r.identity===n.identity&&r.databaseFileIdentity===n.databaseFileIdentity&&r.metadataRaw===n.metadataRaw)return{db:i,generation:n,release:e.release}}catch(r){throw i.close(),e.release(),r}i.close(),e.release()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{p as a};
20
+ //# sourceMappingURL=chunk-A73XVBCR.js.map
@@ -0,0 +1,42 @@
1
+ function d(e,t,i){return i.length===0?[]:e.all(n(e,t,i.length),...i).map(r=>r.relative_path)}function n(e,t,i){if(!Number.isSafeInteger(i)||i<=0)throw new Error("file dependency SQL requires at least one selected path");let r=Array.from({length:i},()=>"(?)").join(", ");return t==="forward"?o(e,r):s(e,r)}function o(e,t){return`WITH selected(relative_path) AS (VALUES ${t}),
2
+ source_symbols(symbol_id) AS MATERIALIZED (
3
+ SELECT DISTINCT source_m.symbol_id
4
+ FROM selected
5
+ JOIN documents source_d ON source_d.relative_path = selected.relative_path
6
+ JOIN chunks source_c ON source_c.document_id = source_d.id
7
+ JOIN mentions source_m ON source_m.chunk_id = source_c.id
8
+ JOIN global_symbols gs ON gs.id = source_m.symbol_id
9
+ WHERE ${e.localSymbolPredicate}
10
+ )
11
+ SELECT DISTINCT target_d.relative_path
12
+ FROM source_symbols
13
+ JOIN mentions definition_m ON definition_m.symbol_id = source_symbols.symbol_id
14
+ AND definition_m.role = 1
15
+ JOIN chunks definition_c ON definition_c.id = definition_m.chunk_id
16
+ JOIN documents target_d ON target_d.id = definition_c.document_id
17
+ WHERE NOT EXISTS (
18
+ SELECT 1
19
+ FROM selected target_selected
20
+ WHERE target_selected.relative_path = target_d.relative_path
21
+ )
22
+ ORDER BY target_d.relative_path`}function s(e,t){return`WITH selected(relative_path) AS (VALUES ${t}),
23
+ target_symbols(symbol_id) AS MATERIALIZED (
24
+ SELECT DISTINCT definition_m.symbol_id
25
+ FROM selected
26
+ JOIN documents target_d ON target_d.relative_path = selected.relative_path
27
+ JOIN chunks definition_c ON definition_c.document_id = target_d.id
28
+ JOIN mentions definition_m ON definition_m.chunk_id = definition_c.id
29
+ AND definition_m.role = 1
30
+ )
31
+ SELECT DISTINCT source_d.relative_path
32
+ FROM target_symbols
33
+ JOIN mentions source_m ON source_m.symbol_id = target_symbols.symbol_id
34
+ JOIN chunks source_c ON source_c.id = source_m.chunk_id
35
+ JOIN documents source_d ON source_d.id = source_c.document_id
36
+ WHERE NOT EXISTS (
37
+ SELECT 1
38
+ FROM selected source_selected
39
+ WHERE source_selected.relative_path = source_d.relative_path
40
+ )
41
+ ORDER BY source_d.relative_path`}export{d as a};
42
+ //# sourceMappingURL=chunk-AFHORGLH.js.map