codebaseiq 0.1.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 (432) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/LICENSE +202 -0
  3. package/README.md +349 -0
  4. package/dist/augment-vue-worker.js +2 -0
  5. package/dist/call-graph-evidence-gNsxjCW8.d.ts +16 -0
  6. package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
  7. package/dist/chunk-2Q2LW5JW.js +14 -0
  8. package/dist/chunk-2X7V4HS4.js +88 -0
  9. package/dist/chunk-34WBMAYK.js +2 -0
  10. package/dist/chunk-35NLDRZC.js +2 -0
  11. package/dist/chunk-362QOSFD.js +3 -0
  12. package/dist/chunk-3IER7Q6H.js +12 -0
  13. package/dist/chunk-3JSXXYTZ.js +345 -0
  14. package/dist/chunk-3LCDIREB.js +4 -0
  15. package/dist/chunk-476NR5B7.js +2 -0
  16. package/dist/chunk-4FC325IF.js +30 -0
  17. package/dist/chunk-4WKDMDEW.js +9 -0
  18. package/dist/chunk-4XTAUQFD.js +2 -0
  19. package/dist/chunk-5PUWMSDU.js +26 -0
  20. package/dist/chunk-5VKBFZZU.js +3 -0
  21. package/dist/chunk-6BQ3DSPK.js +2 -0
  22. package/dist/chunk-6CS3UQTN.js +3 -0
  23. package/dist/chunk-6MUIJMVL.js +6 -0
  24. package/dist/chunk-6NW7MU72.js +40 -0
  25. package/dist/chunk-6OAHRI2D.js +6 -0
  26. package/dist/chunk-6YTSKJJ3.js +2 -0
  27. package/dist/chunk-7FND7D7N.js +2 -0
  28. package/dist/chunk-7MGU3HPH.js +2 -0
  29. package/dist/chunk-7NVGT435.js +2 -0
  30. package/dist/chunk-7XAN6GKB.js +2 -0
  31. package/dist/chunk-AAQQPKCU.js +2 -0
  32. package/dist/chunk-ADTBPVUZ.js +21 -0
  33. package/dist/chunk-AKB7V7TV.js +2 -0
  34. package/dist/chunk-ANFVSJWQ.js +11 -0
  35. package/dist/chunk-B2OB55RR.js +3 -0
  36. package/dist/chunk-B3UYV66Z.js +4 -0
  37. package/dist/chunk-B75HZHUP.js +2 -0
  38. package/dist/chunk-BFFZDZQV.js +2 -0
  39. package/dist/chunk-BGBBVSH4.js +2 -0
  40. package/dist/chunk-BH5F2Q4O.js +2 -0
  41. package/dist/chunk-BJ6SQAEN.js +2 -0
  42. package/dist/chunk-BMYOV5GP.js +77 -0
  43. package/dist/chunk-BVAJLC5A.js +7 -0
  44. package/dist/chunk-C6SBF2WH.js +4 -0
  45. package/dist/chunk-C74PPYLA.js +3 -0
  46. package/dist/chunk-C7QOQX32.js +8 -0
  47. package/dist/chunk-CAUCPUOF.js +7 -0
  48. package/dist/chunk-CO5R3UNA.js +2 -0
  49. package/dist/chunk-CQP3THUZ.js +7 -0
  50. package/dist/chunk-CVYSU6BX.js +16 -0
  51. package/dist/chunk-CWONGW6P.js +3 -0
  52. package/dist/chunk-DDZ7VHWV.js +20 -0
  53. package/dist/chunk-DGXRDLV5.js +2 -0
  54. package/dist/chunk-DO6WQD2T.js +3 -0
  55. package/dist/chunk-DQMDCD24.js +2 -0
  56. package/dist/chunk-DR2LURYU.js +3 -0
  57. package/dist/chunk-DRENNWRG.js +2 -0
  58. package/dist/chunk-ECQBG7PW.js +564 -0
  59. package/dist/chunk-EF2R3WNQ.js +2 -0
  60. package/dist/chunk-ELNRLMC5.js +29 -0
  61. package/dist/chunk-EMNIHCRB.js +18 -0
  62. package/dist/chunk-ENCCHKM6.js +5 -0
  63. package/dist/chunk-EZNMUY67.js +5 -0
  64. package/dist/chunk-FAJQ7LWY.js +3 -0
  65. package/dist/chunk-FDGD5AB5.js +2 -0
  66. package/dist/chunk-FETNQCFO.js +117 -0
  67. package/dist/chunk-FM5BPL4V.js +60 -0
  68. package/dist/chunk-FQKZWM4L.js +49 -0
  69. package/dist/chunk-FW53T7EB.js +2 -0
  70. package/dist/chunk-G6XFR4ZL.js +4 -0
  71. package/dist/chunk-GCHRX4YW.js +4 -0
  72. package/dist/chunk-GTIYTDRE.js +562 -0
  73. package/dist/chunk-GTXSJDCO.js +2 -0
  74. package/dist/chunk-GW6Z3WGY.js +2 -0
  75. package/dist/chunk-H3LGFZVK.js +2 -0
  76. package/dist/chunk-HKQUXIFO.js +2 -0
  77. package/dist/chunk-HOA5YGOH.js +3 -0
  78. package/dist/chunk-HPJRBHVT.js +3 -0
  79. package/dist/chunk-HRWGYWRJ.js +49 -0
  80. package/dist/chunk-I2T2LLK2.js +4 -0
  81. package/dist/chunk-ICFDQHAM.js +3 -0
  82. package/dist/chunk-ID63777H.js +4 -0
  83. package/dist/chunk-IJ4HMYBE.js +3 -0
  84. package/dist/chunk-ILMHV3KM.js +2 -0
  85. package/dist/chunk-IOP6FWIM.js +2 -0
  86. package/dist/chunk-IRQOAM5G.js +2 -0
  87. package/dist/chunk-J77SU6VA.js +38 -0
  88. package/dist/chunk-JE3WZ6II.js +2 -0
  89. package/dist/chunk-JEJLSICM.js +4 -0
  90. package/dist/chunk-JOIRNPPY.js +2 -0
  91. package/dist/chunk-JSOYNVWH.js +3 -0
  92. package/dist/chunk-KMITESMT.js +2 -0
  93. package/dist/chunk-KUW32IRO.js +2 -0
  94. package/dist/chunk-KWVHSKHK.js +31 -0
  95. package/dist/chunk-L4NRUAGJ.js +18 -0
  96. package/dist/chunk-L57ZKWVG.js +6 -0
  97. package/dist/chunk-LTA3BRZX.js +2 -0
  98. package/dist/chunk-LU3BMVH2.js +10 -0
  99. package/dist/chunk-LZYFLFEH.js +2 -0
  100. package/dist/chunk-MOVBWNIP.js +16 -0
  101. package/dist/chunk-MVB3DAEY.js +3 -0
  102. package/dist/chunk-N3IQCBCF.js +29 -0
  103. package/dist/chunk-NAUD7LCA.js +2 -0
  104. package/dist/chunk-NCZUNH3E.js +109 -0
  105. package/dist/chunk-NE6IU5ZD.js +5 -0
  106. package/dist/chunk-NEDP5RFQ.js +60 -0
  107. package/dist/chunk-NMTSZXCL.js +2 -0
  108. package/dist/chunk-NNJ2KZZG.js +4 -0
  109. package/dist/chunk-NNO6A2PO.js +2 -0
  110. package/dist/chunk-NNOKTMZT.js +20 -0
  111. package/dist/chunk-O6QTXQPJ.js +13 -0
  112. package/dist/chunk-OANDYLJQ.js +2 -0
  113. package/dist/chunk-OFBE4NGP.js +2 -0
  114. package/dist/chunk-OGTFJ3XD.js +2 -0
  115. package/dist/chunk-OL6KJP3N.js +16 -0
  116. package/dist/chunk-OLF4MA5W.js +8 -0
  117. package/dist/chunk-OTOKVOJ3.js +2 -0
  118. package/dist/chunk-OVTS4DKB.js +2 -0
  119. package/dist/chunk-OZYRSMSH.js +3 -0
  120. package/dist/chunk-P5XHIJHI.js +2 -0
  121. package/dist/chunk-PBI2LFKH.js +2 -0
  122. package/dist/chunk-PIOMTC27.js +2 -0
  123. package/dist/chunk-PTAWHLVJ.js +6 -0
  124. package/dist/chunk-PX4RYAAK.js +2 -0
  125. package/dist/chunk-PYAB5SM6.js +7 -0
  126. package/dist/chunk-Q5ELPRKQ.js +2 -0
  127. package/dist/chunk-Q65CQ4XL.js +2 -0
  128. package/dist/chunk-Q72QSKXC.js +308 -0
  129. package/dist/chunk-QCN62RTF.js +3 -0
  130. package/dist/chunk-QDCCHMVZ.js +2 -0
  131. package/dist/chunk-QHRNXP3C.js +3 -0
  132. package/dist/chunk-QKPLA6IC.js +2 -0
  133. package/dist/chunk-QOKYJ33H.js +2 -0
  134. package/dist/chunk-QW7EP6WI.js +21 -0
  135. package/dist/chunk-R2NOK63J.js +4 -0
  136. package/dist/chunk-RBAS5ZHI.js +2 -0
  137. package/dist/chunk-RDBI2RXU.js +9 -0
  138. package/dist/chunk-RKEJ6VTF.js +73 -0
  139. package/dist/chunk-RR7SX44N.js +35 -0
  140. package/dist/chunk-RU65DDUP.js +215 -0
  141. package/dist/chunk-SELM5MER.js +2 -0
  142. package/dist/chunk-SGX43S2L.js +2 -0
  143. package/dist/chunk-SMRBZ6EC.js +2 -0
  144. package/dist/chunk-SNNWPCN7.js +4 -0
  145. package/dist/chunk-ST7V3SKN.js +2 -0
  146. package/dist/chunk-SWHMHUKF.js +2 -0
  147. package/dist/chunk-SYDJMPES.js +2 -0
  148. package/dist/chunk-SZD2KF7Q.js +2 -0
  149. package/dist/chunk-T3DGWPXM.js +3 -0
  150. package/dist/chunk-TFZB6XTM.js +239 -0
  151. package/dist/chunk-TIIC3ZE7.js +2 -0
  152. package/dist/chunk-TRRC4ZJ7.js +2 -0
  153. package/dist/chunk-TXXOEMZJ.js +2 -0
  154. package/dist/chunk-UBGWN7I4.js +2 -0
  155. package/dist/chunk-UCD3H3UZ.js +5 -0
  156. package/dist/chunk-UDS562V4.js +5 -0
  157. package/dist/chunk-UNBY47BC.js +3 -0
  158. package/dist/chunk-UP3BUZR5.js +74 -0
  159. package/dist/chunk-UXM43C7T.js +3 -0
  160. package/dist/chunk-UZGZB3VB.js +3 -0
  161. package/dist/chunk-VE5AVNMP.js +2 -0
  162. package/dist/chunk-VEXUL62T.js +2 -0
  163. package/dist/chunk-VFY6Y2H6.js +61 -0
  164. package/dist/chunk-VUIYB2V3.js +2 -0
  165. package/dist/chunk-VXYS3FZD.js +23 -0
  166. package/dist/chunk-WE5RZHZ7.js +5 -0
  167. package/dist/chunk-WMPRTGH2.js +2 -0
  168. package/dist/chunk-WOQBZPIF.js +2 -0
  169. package/dist/chunk-XLQ3GLWZ.js +2 -0
  170. package/dist/chunk-XME3HPXZ.js +2 -0
  171. package/dist/chunk-XMQ23E27.js +2 -0
  172. package/dist/chunk-XWUOUWYI.js +2 -0
  173. package/dist/chunk-XZEE23VG.js +5 -0
  174. package/dist/chunk-Y6KHROC3.js +7 -0
  175. package/dist/chunk-YESXMKX3.js +3 -0
  176. package/dist/chunk-YMGZZEW4.js +2 -0
  177. package/dist/chunk-YSNONTJ2.js +2 -0
  178. package/dist/chunk-YUKYB54I.js +1 -0
  179. package/dist/chunk-YVCIMIOC.js +12 -0
  180. package/dist/chunk-Z54RD7VL.js +3 -0
  181. package/dist/chunk-ZKX2FRS6.js +15 -0
  182. package/dist/chunk-ZMI2JSX2.js +2 -0
  183. package/dist/chunk-ZV3JV5G5.js +8 -0
  184. package/dist/chunk-ZZ3MWF33.js +4 -0
  185. package/dist/chunk-ZZXSWSN6.js +2 -0
  186. package/dist/cli-context-3SNLDYBM.js +3 -0
  187. package/dist/cli-context-T3B7W6GG.js +2 -0
  188. package/dist/cli-program-YNOXO72B.js +7 -0
  189. package/dist/cli.js +3 -0
  190. package/dist/code-DlqpBDd0.d.ts +121 -0
  191. package/dist/command-descriptors-6AOUKWW7.js +346 -0
  192. package/dist/command-descriptors-ZFKJSRUP.js +344 -0
  193. package/dist/command-panels-SZONPMLJ.js +3 -0
  194. package/dist/config-types-BNoC96J3.d.ts +560 -0
  195. package/dist/db-D7sauVFH.d.ts +95 -0
  196. package/dist/direct-navigation-DP4LVMRX.js +3 -0
  197. package/dist/direct-navigation-FLUS3BT6.js +2 -0
  198. package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
  199. package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
  200. package/dist/file-kind-BKCVMNUf.d.ts +10 -0
  201. package/dist/frontend-behavior-evidence-EfM4_9bc.d.ts +4 -0
  202. package/dist/git-history-ChNHbfZQ.d.ts +13 -0
  203. package/dist/graph-evidence-BIFqyisO.d.ts +131 -0
  204. package/dist/health-DJaZXg8I.d.ts +340 -0
  205. package/dist/index.d.ts +183 -0
  206. package/dist/index.js +2 -0
  207. package/dist/invocation-command-descriptors-QT2JMY5J.js +3 -0
  208. package/dist/invocation-command-descriptors-YN4QJEAX.js +2 -0
  209. package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
  210. package/dist/output-continuation-command-2V2SL4TD.js +2 -0
  211. package/dist/output-continuation-command-65J5IP3O.js +3 -0
  212. package/dist/postinstall.js +3 -0
  213. package/dist/project-reindex-5JOKXAXT.js +2 -0
  214. package/dist/project-reindex-UQBIKO4M.js +3 -0
  215. package/dist/queries/affected.d.ts +40 -0
  216. package/dist/queries/affected.js +2 -0
  217. package/dist/queries/anchors.d.ts +123 -0
  218. package/dist/queries/anchors.js +2 -0
  219. package/dist/queries/architecture.d.ts +166 -0
  220. package/dist/queries/architecture.js +2 -0
  221. package/dist/queries/bottlenecks.d.ts +68 -0
  222. package/dist/queries/bottlenecks.js +2 -0
  223. package/dist/queries/by-kind.d.ts +27 -0
  224. package/dist/queries/by-kind.js +2 -0
  225. package/dist/queries/call-graph.d.ts +52 -0
  226. package/dist/queries/call-graph.js +2 -0
  227. package/dist/queries/change-surface.d.ts +55 -0
  228. package/dist/queries/change-surface.js +2 -0
  229. package/dist/queries/cleanup-plan.d.ts +66 -0
  230. package/dist/queries/cleanup-plan.js +2 -0
  231. package/dist/queries/co-change.d.ts +90 -0
  232. package/dist/queries/co-change.js +2 -0
  233. package/dist/queries/code.d.ts +6 -0
  234. package/dist/queries/code.js +2 -0
  235. package/dist/queries/complexity-hotspots.d.ts +61 -0
  236. package/dist/queries/complexity-hotspots.js +2 -0
  237. package/dist/queries/complexity.d.ts +74 -0
  238. package/dist/queries/complexity.js +2 -0
  239. package/dist/queries/context.d.ts +146 -0
  240. package/dist/queries/context.js +2 -0
  241. package/dist/queries/convergence.d.ts +33 -0
  242. package/dist/queries/convergence.js +2 -0
  243. package/dist/queries/coupling.d.ts +32 -0
  244. package/dist/queries/coupling.js +2 -0
  245. package/dist/queries/cycles.d.ts +66 -0
  246. package/dist/queries/cycles.js +2 -0
  247. package/dist/queries/dataflow.d.ts +77 -0
  248. package/dist/queries/dataflow.js +2 -0
  249. package/dist/queries/dead.d.ts +58 -0
  250. package/dist/queries/dead.js +2 -0
  251. package/dist/queries/decorative-checkers.d.ts +34 -0
  252. package/dist/queries/decorative-checkers.js +2 -0
  253. package/dist/queries/deep-chains.d.ts +5 -0
  254. package/dist/queries/deep-chains.js +2 -0
  255. package/dist/queries/dependence-slice.d.ts +46 -0
  256. package/dist/queries/dependence-slice.js +2 -0
  257. package/dist/queries/dependency-depth.d.ts +49 -0
  258. package/dist/queries/dependency-depth.js +2 -0
  259. package/dist/queries/deps.d.ts +15 -0
  260. package/dist/queries/deps.js +2 -0
  261. package/dist/queries/diff-impact.d.ts +165 -0
  262. package/dist/queries/diff-impact.js +2 -0
  263. package/dist/queries/doc-drift.d.ts +115 -0
  264. package/dist/queries/doc-drift.js +2 -0
  265. package/dist/queries/drift.d.ts +79 -0
  266. package/dist/queries/drift.js +2 -0
  267. package/dist/queries/duplicate-bodies.d.ts +55 -0
  268. package/dist/queries/duplicate-bodies.js +2 -0
  269. package/dist/queries/entry-map.d.ts +121 -0
  270. package/dist/queries/entry-map.js +2 -0
  271. package/dist/queries/evidence.d.ts +70 -0
  272. package/dist/queries/evidence.js +2 -0
  273. package/dist/queries/extract-candidates.d.ts +52 -0
  274. package/dist/queries/extract-candidates.js +2 -0
  275. package/dist/queries/fan.d.ts +53 -0
  276. package/dist/queries/fan.js +2 -0
  277. package/dist/queries/files.d.ts +20 -0
  278. package/dist/queries/files.js +2 -0
  279. package/dist/queries/health.d.ts +8 -0
  280. package/dist/queries/health.js +2 -0
  281. package/dist/queries/hierarchy.d.ts +21 -0
  282. package/dist/queries/hierarchy.js +2 -0
  283. package/dist/queries/hotspots.d.ts +42 -0
  284. package/dist/queries/hotspots.js +2 -0
  285. package/dist/queries/imports.d.ts +34 -0
  286. package/dist/queries/imports.js +2 -0
  287. package/dist/queries/incomplete-migration.d.ts +90 -0
  288. package/dist/queries/incomplete-migration.js +2 -0
  289. package/dist/queries/index.d.ts +180 -0
  290. package/dist/queries/index.js +2 -0
  291. package/dist/queries/isolated.d.ts +24 -0
  292. package/dist/queries/isolated.js +2 -0
  293. package/dist/queries/locality-candidates.d.ts +51 -0
  294. package/dist/queries/locality-candidates.js +2 -0
  295. package/dist/queries/members.d.ts +21 -0
  296. package/dist/queries/members.js +2 -0
  297. package/dist/queries/methods.d.ts +43 -0
  298. package/dist/queries/methods.js +2 -0
  299. package/dist/queries/not-implemented.d.ts +33 -0
  300. package/dist/queries/not-implemented.js +2 -0
  301. package/dist/queries/outline.d.ts +22 -0
  302. package/dist/queries/outline.js +2 -0
  303. package/dist/queries/passthrough-candidates.d.ts +41 -0
  304. package/dist/queries/passthrough-candidates.js +2 -0
  305. package/dist/queries/plan-context.d.ts +33 -0
  306. package/dist/queries/plan-context.js +2 -0
  307. package/dist/queries/react-component-duplicates.d.ts +39 -0
  308. package/dist/queries/react-component-duplicates.js +2 -0
  309. package/dist/queries/react-hook-candidates.d.ts +44 -0
  310. package/dist/queries/react-hook-candidates.js +2 -0
  311. package/dist/queries/react-large-component-pressure.d.ts +34 -0
  312. package/dist/queries/react-large-component-pressure.js +2 -0
  313. package/dist/queries/recent-duplicates.d.ts +79 -0
  314. package/dist/queries/recent-duplicates.js +2 -0
  315. package/dist/queries/redundant-reexports.d.ts +37 -0
  316. package/dist/queries/redundant-reexports.js +2 -0
  317. package/dist/queries/reference-neighborhood.d.ts +4 -0
  318. package/dist/queries/reference-neighborhood.js +2 -0
  319. package/dist/queries/reference-reachability.d.ts +48 -0
  320. package/dist/queries/reference-reachability.js +2 -0
  321. package/dist/queries/refs.d.ts +13 -0
  322. package/dist/queries/refs.js +2 -0
  323. package/dist/queries/self-audit.d.ts +65 -0
  324. package/dist/queries/self-audit.js +2 -0
  325. package/dist/queries/similar-chains.d.ts +48 -0
  326. package/dist/queries/similar-chains.js +2 -0
  327. package/dist/queries/similar-files.d.ts +35 -0
  328. package/dist/queries/similar-files.js +2 -0
  329. package/dist/queries/similar-signatures.d.ts +46 -0
  330. package/dist/queries/similar-signatures.js +2 -0
  331. package/dist/queries/similar.d.ts +187 -0
  332. package/dist/queries/similar.js +2 -0
  333. package/dist/queries/slice.d.ts +4 -0
  334. package/dist/queries/slice.js +2 -0
  335. package/dist/queries/source-inspection.d.ts +209 -0
  336. package/dist/queries/source-inspection.js +2 -0
  337. package/dist/queries/source-search.d.ts +85 -0
  338. package/dist/queries/source-search.js +2 -0
  339. package/dist/queries/stale-abstractions.d.ts +72 -0
  340. package/dist/queries/stale-abstractions.js +2 -0
  341. package/dist/queries/stats.d.ts +15 -0
  342. package/dist/queries/stats.js +2 -0
  343. package/dist/queries/surface.d.ts +22 -0
  344. package/dist/queries/surface.js +2 -0
  345. package/dist/queries/symbols.d.ts +14 -0
  346. package/dist/queries/symbols.js +2 -0
  347. package/dist/queries/system-map.d.ts +449 -0
  348. package/dist/queries/system-map.js +2 -0
  349. package/dist/queries/system.d.ts +21 -0
  350. package/dist/queries/system.js +2 -0
  351. package/dist/queries/test-quality.d.ts +56 -0
  352. package/dist/queries/test-quality.js +2 -0
  353. package/dist/queries/trace.d.ts +68 -0
  354. package/dist/queries/trace.js +2 -0
  355. package/dist/queries/twin-ab.d.ts +66 -0
  356. package/dist/queries/twin-ab.js +2 -0
  357. package/dist/queries/twin-drift.d.ts +119 -0
  358. package/dist/queries/twin-drift.js +2 -0
  359. package/dist/queries/unused-imports.d.ts +4 -0
  360. package/dist/queries/unused-imports.js +2 -0
  361. package/dist/queries/unused-params.d.ts +38 -0
  362. package/dist/queries/unused-params.js +2 -0
  363. package/dist/queries/value-flow.d.ts +42 -0
  364. package/dist/queries/value-flow.js +2 -0
  365. package/dist/queries/vue-component-duplicates.d.ts +43 -0
  366. package/dist/queries/vue-component-duplicates.js +2 -0
  367. package/dist/queries/vue-composable-candidates.d.ts +44 -0
  368. package/dist/queries/vue-composable-candidates.js +2 -0
  369. package/dist/queries/vue-large-view-pressure.d.ts +41 -0
  370. package/dist/queries/vue-large-view-pressure.js +2 -0
  371. package/dist/queries/wrapper-candidates.d.ts +34 -0
  372. package/dist/queries/wrapper-candidates.js +2 -0
  373. package/dist/reindex-worker.js +3 -0
  374. package/dist/reindex.d.ts +254 -0
  375. package/dist/reindex.js +298 -0
  376. package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
  377. package/dist/runtime.d.ts +555 -0
  378. package/dist/runtime.js +4 -0
  379. package/dist/rust-semantic-session-server.js +2 -0
  380. package/dist/rust-semantic-session-worker.js +2 -0
  381. package/dist/rust-semantic-worker.js +2 -0
  382. package/dist/scip-cli-B7N3haxa.d.ts +67 -0
  383. package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
  384. package/dist/symbol-types-BIQwfoAx.d.ts +74 -0
  385. package/dist/typescript-mailbox-worker.js +2 -0
  386. package/dist/watch-server.js +8 -0
  387. package/docs/AGENT_GUIDE.md +148 -0
  388. package/docs/AI_FAILURE_MODES.md +43 -0
  389. package/docs/API.md +40 -0
  390. package/docs/API_EVOLUTION.md +77 -0
  391. package/docs/CLI_JSON_OUTPUT.md +389 -0
  392. package/docs/COMMAND_REFERENCE.md +294 -0
  393. package/docs/CONFIGURATION_WRITE_SAFETY.md +131 -0
  394. package/docs/DETECTOR_GUIDE.md +46 -0
  395. package/docs/DURABILITY.md +159 -0
  396. package/docs/INDEX_GENERATIONS.md +167 -0
  397. package/docs/LOCK_PROTOCOL.md +133 -0
  398. package/docs/MAILBOX_LIFECYCLE.md +224 -0
  399. package/docs/REGEX_POLICY.md +36 -0
  400. package/docs/REINDEX_METADATA_COMPATIBILITY.md +104 -0
  401. package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
  402. package/docs/SECURITY_MODEL.md +125 -0
  403. package/docs/TELEMETRY_RETENTION.md +84 -0
  404. package/docs/TIME_SEMANTICS.md +77 -0
  405. package/docs/WATCH_REFRESH_REQUESTS.md +123 -0
  406. package/docs/WINDOWS_SIDECAR_RELEASE.md +424 -0
  407. package/docs/accuracy-audit-checklist.md +304 -0
  408. package/docs/accuracy-hardening-goal.md +500 -0
  409. package/docs/analyzer-inventory.md +78 -0
  410. package/docs/analyzer-validation-protocol.md +84 -0
  411. package/docs/architecture-coherence-vision.md +254 -0
  412. package/docs/assets/codebaseiq-logo-dark.svg +21 -0
  413. package/docs/assets/codebaseiq-logo.svg +24 -0
  414. package/docs/locality-analyzer-design.md +193 -0
  415. package/docs/schemas/cli-json-envelope.schema.json +237 -0
  416. package/docs/schemas/cli-output-page.schema.json +104 -0
  417. package/docs/schemas/npm-release-state.schema.json +146 -0
  418. package/docs/schemas/observation-receipt.schema.json +164 -0
  419. package/docs/schemas/project-config.schema.json +318 -0
  420. package/docs/schemas/suppression-record.schema.json +79 -0
  421. package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
  422. package/package.json +482 -0
  423. package/scripts/build-codebaseiq-windows.mjs +197 -0
  424. package/scripts/codebaseiq-windows-provenance.mjs +364 -0
  425. package/scripts/evidence-product-contract.mjs +197 -0
  426. package/scripts/verify-codebaseiq-windows.mjs +29 -0
  427. package/skills/codebaseiq/SKILL.md +75 -0
  428. package/skills/codebaseiq/agents/openai.yaml +4 -0
  429. package/skills/codebaseiq-explore/SKILL.md +34 -0
  430. package/skills/codebaseiq-explore/agents/openai.yaml +4 -0
  431. package/skills/concrete-plan/SKILL.md +79 -0
  432. package/skills/concrete-plan/agents/openai.yaml +4 -0
@@ -0,0 +1,2 @@
1
+ import{a as F}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-JOIRNPPY.js";import{h as le}from"./chunk-J77SU6VA.js";import{b as $,d as ne,e as te,f as ie,g as oe,h as re,j as N,k as ae,l as se}from"./chunk-CVYSU6BX.js";import{d as ee}from"./chunk-ELNRLMC5.js";import{f as X,h as Z}from"./chunk-C7QOQX32.js";import{a as C}from"./chunk-TIIC3ZE7.js";import{a as H}from"./chunk-NNOKTMZT.js";import{a as O,e as z,g as E,h as P,j as Q,k as W,t as D,u as Y,v as J,w as U,x as A}from"./chunk-FETNQCFO.js";import{k as G,m as S}from"./chunk-O6QTXQPJ.js";import{A as V,K as B,a as v,z as y}from"./chunk-ADTBPVUZ.js";import{u as _,x as M}from"./chunk-BMYOV5GP.js";import{d as j}from"./chunk-3LCDIREB.js";function ce(n,e,t={}){let i=new Map;if(e&&e.length===0)return i;let r=v(n,{includeIgnored:!1}),a=ie(n),o=e??Y(n),f=new Set(o.map(u=>u.symbolId)),c=ve(o);return pe(n,i,r,a,f,c),ye(n,i,o,f),Re(n,i,r,a,f,c),t.semantic!==!1&&t.semanticEvidence&&De(i,t.semanticEvidence.callerMap(n,Me(o))),i}function pe(n,e,t,i,r,a){for(let o of t){if(!y(o))continue;let f=G(n,o);if(f)for(let c of f){if(a&&!a.has(c.calleeLeaf))continue;let u=ne(o,i.get(c.calleeLeaf)??[]);if(!u||u.length===0)continue;let s=te(n,o,u,c.memberAccess,c.calleeQualifier);s&&r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function ye(n,e,t,i){let r=ge(t);for(let a of Se(n,i))n.isIgnored(a.relative_path)||he(a,r.get(a.symbol_id))||T(e,a.symbol_id,a.relative_path)}function Se(n,e){return ee(n,e?[...e]:void 0)}function ge(n){let e=new Map;for(let t of n)e.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return e}function he(n,e){return!!e&&e.docId===n.document_id&&n.chunk_start>=e.startLine&&n.chunk_end<=e.endLine}function Re(n,e,t,i,r,a){for(let o of t){if(y(o)!=="rust")continue;let f=S(n,o,{includeRustAttributeNames:!0});if(f.length!==0)for(let{name:c}of f){if(a&&!a.has(c))continue;let u=i.get(c);if(u)for(let s of u)r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function T(n,e,t){let i=n.get(e);i||(i=new Set,n.set(e,i)),i.add(t)}function ve(n){let e=new Set;for(let t of n){let i="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?z(t.symbol):"";i&&e.add(i)}return e.size>0?e:null}function Me(n){return n.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function De(n,e){for(let[t,i]of e){let r=n.get(t);r||(r=new Set,n.set(t,r));for(let a of i)r.add(a)}}function q(n,e,t={}){return ce(n,e,t)}function K(n,e,t={}){return se(n,e,t)}function fe(n,e,t={}){let i=q(n,e,{semantic:t.semantic,semanticEvidence:t.semanticEvidence});return t.sourceFallback===!1?i:Ce(i,K(n,e))}function Ce(n,e){let t=new Map;for(let[i,r]of n)t.set(i,new Set(r));for(let[i,r]of e){let a=t.get(i)??new Set;for(let o of r)a.add(o);t.set(i,a)}return t}function ue(n,e,t){let i=e.identifierResolution==="strict"?N:ae,r=e.candidateNames?oe(e.candidateNames):null,a=0,o=0,f=0,c=0,u="";for(let s of e.paths)if(a+=1,u=s,!(!y(s)&&!(e.includeVueSfc&&V(s)))&&!n.isIgnored(s)&&!e.skipPath?.(s))try{if(r&&!re(_(n,s),r))continue;o+=1;let h=(d,b,x,g)=>{if(e.candidateNames&&!e.candidateNames.has(d))return;f+=1;let R=e.resolveTargets?e.resolveTargets({sourceFile:s,name:d,kind:b,defaultTargets:g}):g();for(let w of R)c+=1,t({sourceFile:s,name:d,target:w,occurrences:x,kind:b})},k=$(n,s);for(let[d,b]of k)h(d,"identifier",b.length,()=>i(n,s,d));for(let d of S(n,s,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let b=d.kind==="cross-language-dispatch"?()=>N(n,s,d.name):()=>i(n,s,d.name);h(d.name,d.kind,d.occurrences,b)}}finally{e.afterPath?.(s),a%10===0&&j("source-reference-scan.progress",()=>{},()=>({scannedPaths:a,currentPath:u,candidateMatchedPaths:o,visitedNames:f,visitedHits:c}))}}function de(n,e={}){let{scope:t,files:i,minLoc:r=1,maxLoc:a=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:f=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:u=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:L=!1,excludeRustTraitImplMembers:h=!1,includeSuppressed:k=!1,sortByLocDesc:d=!1}=e,b=[],x=Ie(n,{scope:t,files:i,requireFunctionLikeSymbol:s,requireCallableSymbol:L}),g=new Map,R=new Map,w=l=>{let m=g.get(l);if(m!==void 0)return m;let p=X(n,l);return g.set(l,p),p},be=l=>{let m=R.get(l);if(m!==void 0)return m;let p=C(l);return R.set(l,p),p};for(let l of x){let m=l.relativePath;if(n.isIgnored(m)||f&&w(m)||!Fe(l,{requireFunctionLikeSymbol:s,requireCallableSymbol:L})||o!==void 0&&l.symbol===o)continue;let p=F(l);p<r||p>a||c&&Le(m)||u&&Z(n,l.symbol,m)||h&&Q(l.symbol)||be(m)!=="test"&&(W(l.symbol)||!k&&M(n,m,l.startLine)||b.push(l))}return d?b.sort((l,m)=>F(m)-F(l)):b}function Ie(n,e){return e.files!==void 0?[...new Set(e.files.map(i=>i.replace(/\\/g,"/")))].sort().filter(i=>!e.scope||i.includes(e.scope)).flatMap(i=>D(n,i)):e.requireCallableSymbol?A(n,{scope:e.scope,symbolMatches:E,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?A(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"function-like"}):U(n,e.scope)}function Fe(n,e){return e.requireCallableSymbol?E(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function Le(n){return(n.split("/").pop()??"").includes("types")}var me=class{constructor(e){this.db=e}db;scopedDefinitions(e){return J(this.db,e)}definitionsForFile(e){return D(this.db,e)}productionCallableDefinitions(e={}){return de(this.db,e)}calleeMap(e,t={}){return this.calleeEvidenceMap(e,t).rows}calleeEvidenceMap(e,t={}){return le(this.db,e,{...t,semanticEvidence:I})}crossFileCallerMap(e,t={}){return q(this.db,e,{...t,semanticEvidence:I})}sourceFallbackCallerFiles(e,t={}){return K(this.db,e,t)}callerFileMap(e,t={}){return fe(this.db,e,{...t,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let t=new Map;for(let r of e){if(!r.leaf)continue;let a=t.get(r.leaf)??[];a.push(r.symbolId),t.set(r.leaf,a)}let i=new Set;for(let r of v(this.db,{includeIgnored:!1}))if(y(r)==="rust")for(let{name:a}of S(this.db,r,{includeRustAttributeNames:!0}))for(let o of t.get(a)??[])i.add(o);return i}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let i=new Map(e.map(o=>[o.symbolId,o.symbol])),r=this.calleeEvidenceMap(e,t),a=new Set([...r.rows.entries()].filter(([o,f])=>{let c=i.get(o);return f.some(u=>u.symbol!==c)}).map(([o])=>o));for(let o of r.incompleteSymbolIds)a.add(o);for(let o of r.unavailableSymbolIds)a.add(o);return a}fileDependencyGraph(e){return H(this.db,e)}fileKind(e){return C(e)}hasSuppressionComment(e){return M(this.db,e.relativePath,e.startLine)}sourceFiles(){return B(this.db)}scanSourceReferences(e,t){ue(this.db,e,t)}callableSignature(e){let t=O(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{K as a,Ce as b,me as c};
2
+ //# sourceMappingURL=chunk-7FND7D7N.js.map
@@ -0,0 +1,2 @@
1
+ import{b as f,c as p}from"./chunk-EF2R3WNQ.js";import{execFileSync as y}from"child_process";import{platform as I}from"os";var b=1e3,T=2*1024*1024,M=25;function v(e,n,r=S){let t=r.readIdentity(e),o=new Map;return t&&o.set(e,t),{rootPid:e,rootIdentity:t,ownsProcessGroup:n,knownMembers:o}}async function k(e,n,r=S){if(!e.rootIdentity){let a=await l(e,n.gracefulMs+n.forceMs,r);return{reaped:a,reason:a?"terminated":"identity-unavailable",detail:a?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let t=g(e,r);if(t==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(t==="exited"&&!h(e,r))return{reaped:!0,reason:"terminated"};if(r.platform==="win32"){try{r.terminateWindowsTree(e.rootPid)}catch(u){let c=await l(e,n.forceMs,r);return{reaped:c,reason:c?"terminated":"signal-failed",detail:c?void 0:m(u)}}let a=await l(e,n.forceMs,r);return{reaped:a,reason:a?"terminated":"deadline"}}let o=P(e,"SIGTERM",r);if(await l(e,n.gracefulMs,r))return{reaped:!0,reason:"terminated"};let s=P(e,"SIGKILL",r);return await l(e,n.forceMs,r)?{reaped:!0,reason:"terminated"}:s?{reaped:!1,reason:s.reason,detail:s.detail}:o?{reaped:!1,reason:o.reason,detail:o.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function g(e,n){let r=n.readIdentity(e.rootPid);if(!r)return"exited";if(!e.rootIdentity||!f(e.rootIdentity,r))return"mismatch";e.knownMembers.set(e.rootPid,r);for(let t of n.listDescendantPids(e.rootPid)){let o=n.readIdentity(t);o&&e.knownMembers.set(t,o)}return"owned"}function P(e,n,r){let t=g(e,r);if(t==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${n}.`};if(t==="owned"&&e.ownsProcessGroup)try{return r.signal(-e.rootPid,n),null}catch(i){if(!w(i))return{reason:"signal-failed",detail:m(i)}}let o=null;for(let i of e.knownMembers.values()){let s=r.readIdentity(i.pid);if(!(!s||!f(i,s)))try{r.signal(i.pid,n)}catch(d){!w(d)&&o===null&&(o=m(d))}}return o===null?null:{reason:"signal-failed",detail:o}}async function l(e,n,r){let t=r.now()+n;for(;h(e,r);){if(r.now()>=t)return!1;await r.sleep(Math.min(M,Math.max(1,t-r.now())))}return!0}function h(e,n){if(!e.rootIdentity&&n.isProcessAlive(e.rootPid))return!0;for(let r of e.knownMembers.values()){let t=n.readIdentity(r.pid);if(t&&f(r,t))return!0}return!!(e.ownsProcessGroup&&n.isProcessGroupAlive(e.rootPid))}function R(e){let n=y("ps",["-axo","pid=,ppid="],{encoding:"utf8",timeout:b,maxBuffer:T,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Map;for(let s of n.split(/\r?\n/)){let d=/^\s*(\d+)\s+(\d+)\s*$/.exec(s);if(!d)continue;let a=Number(d[1]),u=Number(d[2]),c=r.get(u)??[];c.push(a),r.set(u,c)}let t=[],o=[...r.get(e)??[]],i=new Set;for(;o.length>0;){let s=o.pop();i.has(s)||(i.add(s),t.push(s),o.push(...r.get(s)??[]))}return t}function w(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function m(e){return e instanceof Error?e.message:String(e)}var S={platform:I(),now:Date.now,readIdentity:p,isProcessAlive(e){try{return process.kill(e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return R(e)}catch{return[]}},signal(e,n){process.kill(e,n)},terminateWindowsTree(e){y("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:b,maxBuffer:T,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(n=>setTimeout(n,e))}};export{v as a,k as b};
2
+ //# sourceMappingURL=chunk-7MGU3HPH.js.map
@@ -0,0 +1,2 @@
1
+ import{d as f}from"./chunk-OTOKVOJ3.js";import{M as d}from"./chunk-ADTBPVUZ.js";function S(n,e={}){let{minComponentLines:o=300,minFileLines:i=800,minJsxTokens:u=80,minBehaviorTokens:s=40,limit:a=20,scope:m,scanLimit:c,filePattern:p}=e;return d(n).reactProfiles({scope:m,scanLimit:c}).filter(t=>t.kind==="component").filter(t=>!p||t.file.includes(p)||t.name.includes(p)).map(t=>C(t,{minComponentLines:o,minFileLines:i,minJsxTokens:u,minBehaviorTokens:s})).filter(t=>t!==null).sort((t,r)=>r.componentLines-t.componentLines||r.fileLines-t.fileLines||t.file.localeCompare(r.file)).slice(0,a)}function C(n,e){let o=Math.max(80,Math.floor(e.minComponentLines/2)),i=f(n,x({minComponentLines:e.minComponentLines,minFileLines:e.minFileLines,minJsxTokens:e.minJsxTokens,minBehaviorTokens:e.minBehaviorTokens,substantialComponentLines:o}),"component"),{reasons:u}=i;if(u.length===0)return null;let s=i.dominantPressure,a=i.pressureKinds,m=b(n),c=R(s,a,m);return{file:n.file,component:n.name,componentLines:n.loc,fileLines:n.fileLines,jsxTokens:n.jsxTokens.size,behaviorTokens:n.behaviorTokens.size,dominantPressure:s,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:v(c,m),reasons:u,loc:n.loc}}function x(n){return[{axis:"component",value:e=>e.loc,qualifies:(e,o)=>o>=n.minComponentLines,reason:(e,o)=>`${o} component line(s)`},{axis:"file",value:e=>e.fileLines,qualifies:(e,o)=>o>=n.minFileLines&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} file line(s)`},{axis:"jsx-structure",value:e=>e.jsxTokens.size,weightedValue:(e,o)=>o*3,qualifies:(e,o)=>o>=n.minJsxTokens,reason:(e,o)=>`${o} JSX structure token(s)`},{axis:"hook-behavior",value:e=>e.behaviorTokens.size,weightedValue:(e,o)=>o*4,qualifies:(e,o)=>o>=n.minBehaviorTokens,reason:(e,o)=>`${o} behavior token(s)`}]}function b(n){let e=n.file.split(/[\\/]+/).filter(Boolean),o=e.slice(0,-1).map(r=>r.toLowerCase()),i=(e.at(-1)??n.name).replace(/\.[^.]+$/,""),s=o.findIndex(r=>k.has(r))>=0,a=o.some(r=>h.has(r));if(L(i)||L(n.name))return"component";let c=T.has(i.toLowerCase()),p=/(?:Page|Route|Screen)$/.test(n.name),l=s&&/View$/.test(n.name),t=!a&&i.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()===n.name.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()&&/(?:Page|Route|Screen|View)$/.test(i);return c||p||l||t?"route-page":"component"}function L(n){let e=n.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return e.at(-1)&&g.has(e.at(-1))?!0:[...g].some(o=>n.endsWith(P(o)))}function R(n,e,o){return n==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":e.includes("hook-behavior")?"behavior-extraction":e.includes("jsx-structure")?"jsx-decomposition":e.includes("file")?"file-decomposition":n==="jsx-structure"?"jsx-decomposition":n==="file"&&!e.includes("component")?"file-decomposition":"component-decomposition"}function v(n,e){switch(n){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return e==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),g=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),k=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),T=new Set(["page","route","screen"]);function P(n){return n.charAt(0).toUpperCase()+n.slice(1)}export{S as a};
2
+ //# sourceMappingURL=chunk-7NVGT435.js.map
@@ -0,0 +1,2 @@
1
+ import{e as M}from"./chunk-T3DGWPXM.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{o as I}from"./chunk-6CS3UQTN.js";import{d as D}from"./chunk-SGX43S2L.js";import{d as b,j as h,p as x,q as y,u as L}from"./chunk-FETNQCFO.js";import{a as g,e as S}from"./chunk-O6QTXQPJ.js";import{u as d}from"./chunk-BMYOV5GP.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
2
+ //# sourceMappingURL=chunk-7XAN6GKB.js.map
@@ -0,0 +1,2 @@
1
+ import{constants as t,setPriority as s}from"os";var n="CODEBASEIQ_PROCESS_PRIORITY";function P(o=process.env){let r=o[n]?.trim().toLowerCase();return r==="low"||r==="idle"?r:null}function l(o=process.env,r=s){let e=P(o);if(e===null)return null;let i=e==="idle"?t.priority.PRIORITY_LOW:t.priority.PRIORITY_BELOW_NORMAL;try{r(i)}catch{}return e}export{l as a};
2
+ //# sourceMappingURL=chunk-AAQQPKCU.js.map
@@ -0,0 +1,21 @@
1
+ import{e as F,f as X,g as L,h as _e,i as Le,j as Fe,p as Pe,q as y,r as Ee,t as Ae,u as g,v as we}from"./chunk-BMYOV5GP.js";import{H,c as v}from"./chunk-NNJ2KZZG.js";import{basename as Re}from"path";var $t=F("indexed-document-paths",{clearGroups:["whole-project"]});function O(e,t={}){let n=Ot(t);return[...$t.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${e.pathExclusionsFor("documents")}
5
+ ${o}
6
+ ${s}
7
+ ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function Ot(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function Uo(e,t,n){let r=Ve(t);if(!r)return[];let o=e.all(`SELECT relative_path
8
+ FROM documents
9
+ WHERE relative_path = ?
10
+ ${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Ie(c.relative_path,r)}));if(o.length>0)return o;let s=O(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Ie(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Ie(e,t){let n=Ve(e),r=Re(n),o=Re(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Ve(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as je}from"path";var Dt={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function D(e){return Dt[je(e).toLowerCase()]??null}function ce(e){return je(e).toLowerCase()===".vue"}import{createRequire as Wt}from"module";var d=Wt(import.meta.url),J=null,Be=!1;function Ut(){if(Be)return null;if(J)return J;try{return J=d("tree-sitter"),J}catch{return Be=!0,null}}var $e=new Map,Z=new Set;function Mt(e){if(Z.has(e))return null;let t=$e.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Z.add(e),null}}catch{return Z.add(e),null}return $e.set(e,n),n}var Oe=new Map;function zt(e){let t=Oe.get(e);if(t)return t;let n=Mt(e);if(!n)return null;let r=Ut();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return Z.add(e),null}return Oe.set(e,o),o}function qt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function P(e,t){let n=zt(e);if(!n)return null;try{return qt(n,t)}catch{return null}}import{posix as le}from"path";import{parse as Ht}from"@vue/compiler-sfc";var Xt=L("vue-sfc-units");function R(e,t){let n=Ue(t),r=g(e,n);return Xt.get(e,n,r,()=>ue(e,n,r))}function Ue(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Jt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function E(e){return!e||e.body.length===0?0:e.body.split(`
11
+ `).length}function ue(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Ht(n,{filename:t})}catch(i){return r.errors.push(We(i)),r}r.errors.push(...o.errors.map(We));let{descriptor:s}=o;return s.template&&(r.template=G(e,t,"template",s.template)),s.script&&r.scripts.push(De(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(De(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>G(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>G(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function De(e,t,n,r){let o=G(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Jt(o.lang)}}function G(e,t,n,r){let o=Gt(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=Zt(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
12
+ `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Zt(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Ue(le.normalize(le.join(le.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Gt(e){return{...e}}function We(e){return e instanceof Error?e.message:String(e)}function pe(e,t,n){let o=ue(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
13
+ `.repeat(i.startLine)}${i.body}`).join(`
14
+ `),startLine:0,language:s}:null}var Me=_e("ast-trees",{clearGroups:["whole-project","source-file"]});function ze(e,t){if(ce(t))return Kt(e,t);let n=D(t);if(!n)return null;let r=g(e,t);return r?Me.get(e,t,r,()=>P(n,r)):null}function is(e,t,n){if(ce(t)){let s=pe(e,t,n);if(!s)return null;let i=P(s.language,`
15
+ `.repeat(s.startLine)+s.body);return i?{tree:i,language:s.language}:null}let r=D(t);if(!r)return null;let o=P(r,n);return o?{tree:o,language:r}:null}function Kt(e,t){let n=g(e,t);return n?Me.get(e,t,n,()=>{let r=pe(e,t,n);if(!r)return null;let o=`
16
+ `.repeat(r.startLine)+r.body;return P(r.language,o)}):null}import{readdirSync as Qt}from"fs";import{execFileSync as Yt}from"child_process";import{extname as K,join as en}from"path";var tn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],ms=[".vue"],qe=[".tsx",".jsx"],He=[".vue"],nn=[...qe,...He],rn=new Set(qe),on=new Set(He),Xe=new Set(tn.map(e=>e.toLowerCase())),sn=[...Xe].sort().join(","),Je=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function W(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):Xe,i=o?[...s].sort().join(","):sn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return an.get(e,a,()=>{let c=new Set;if(n)for(let l of O(e,{includeIgnored:!1}))s.has(K(l).toLowerCase())&&c.add(l);if(r)for(let l of cn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function ds(e,t={}){let n=!1,r=!1;for(let o of W(e,{extensions:nn})){if(t.scope&&!o.includes(t.scope))continue;let s=K(o).toLowerCase();if(n||=rn.has(s),r||=on.has(s),n&&r)break}return{react:n,vue:r}}var an=F("source-files",{clearGroups:[]});function cn(e,t){return ln(e,t)??pn(e,t)}function ln(e,t){try{let n=Yt("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Set;for(let o of n.split(`
17
+ `)){let s=o.trim();s&&(un(s)||t.has(K(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function un(e){return e.split("/").some(t=>Je.has(t))}function pn(e,t){let n=new Set,r=o=>{let s=o?en(e,o):e,i;try{i=Qt(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!Je.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(K(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as hn}from"path";function Y(e,t){let n=mn(e,t);if(!n)return null;let r=Q(n);if(!r)return null;let o=dn(n);return{calleeLeaf:r,calleeQualifier:o?fn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function fn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function mn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function dn(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Q(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Q(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"super":case"self":case"this":return null;default:return null}}var gn=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function ee(e){return e.length<=2||gn.has(e)}var Sn=[".tsx",".jsx"],Ze=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),yn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),xn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),vn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Nn=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Cn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),bn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),kn=L("react-component-behavior-profiles"),Ge=Ee({kind:"react-component-behavior-profiles",invalidation:Ae("react-component-behavior-profiles"),serialize:Fn,deserialize:Pn});function et(e,t={}){let n=W(e,{extensions:Sn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>me(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function me(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return kn.get(e,n,r,()=>Tn(e,n,r)).map(Ln)}function Tn(e,t,n){let r=Fe(e,t,n),o=Ge.read(e,t,r);if(o)return o;let s=_n(e,t);return Ge.write(e,t,r,s),s}function _n(e,t){let n=An(t);if(!n)return[];let r=ze(e,t);if(!r)return[];let o=we(e,t).length;return wn(r.rootNode,n).filter(i=>i.kind==="hook"||de(i.bodyNode)).map(i=>{let a=On(i.bodyNode),c=zn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function Ln(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Fn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Pn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=En(r);if(!o)return null;n.push(o)}return n}catch{return null}}function En(e){if(!Pe(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:B,hookNames:ie,requestNames:ae,stateNames:m,effectNames:C,handlerNames:$}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!te(o)||!te(s)||!te(i)||!te(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(ie),requestNames:y(ae),stateNames:y(m),effectNames:y(C),handlerNames:y($)};return Object.values(S).some(Bt=>Bt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function te(e){return typeof e=="number"&&Number.isFinite(e)}function An(e){let t=hn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:D(e)}function wn(e,t){let n=[],r=new Set,o=s=>{let i=Rn(s);if(i&&(!Bn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function Rn(e){if(e.type==="class_declaration"){let s=fe(e);if(!s||!/^[A-Z]/.test(s))return null;let i=In(e);return!i||!Vn(e)&&!de(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=fe(e);return!s||!Ke(s)?null:{name:s,kind:Qe(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=U(t);if(!r||!n||!Ke(r))return null;let o=jn(n);return o?{name:r,kind:Qe(r),node:e,bodyNode:o}:null}function In(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Vn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Ke(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function Qe(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function jn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=$n(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Bn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function fe(e){return U(e.childForFieldName("name")??e.namedChild(0))}function $n(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function de(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(de)}function On(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?Dn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Wn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function Dn(e,t){let n=Un(e),r=!1;if(n){let o=Ye(n),s=o==="Fragment"||o==="React.Fragment";r=Zn(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=Mn(o);if(!s)continue;let i=Ye(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else bn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(tt(o))}function Wn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(tt(e)),nt(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Gn(n))ee(r)||t.tokens.add(`binding:${r}`)}function tt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function nt(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(nt)}function Un(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function Mn(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function zn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=Y(o,t);s&&qn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")Xn(o,n);else if(o.type==="function_declaration"){let s=fe(o);s&&rt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function qn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Ze.has(e)&&!vn.has(e)&&t.tokens.add(`hook:${e}`)),Ze.has(e)&&t.tokens.add(`react-hook:${e}`),yn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),xn.has(e)&&t.tokens.add(`state-hook:${e}`),Hn(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function Hn(e){if(Nn.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Xn(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>U(a)),i=U(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=U(n);o&&rt(o,t)}function rt(e,t){let n=Jn(e);!n||!Cn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Jn(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Zn(e){return/^[A-Z]/.test(e)||e.includes(".")}function Ye(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function U(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Gn(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}function M(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Kn=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),ot=new Set(["arrow_function","function_expression","generator_function"]);function ut(e,t){let n=Yn(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:ct(n.functionNode),params:st(n.functionNode),paramsEndLine:it(n.functionNode),isLiteralPassthrough:lt(n.functionNode,t)};if(!Qn(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:ct(e),params:st(e),paramsEndLine:it(e),isLiteralPassthrough:lt(e,t)}:null}function pt(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function st(e){let t=pt(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(M(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function it(e){let t=pt(e);return t?t.endPosition.row:e.startPosition.row}function Qn(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?Kn.has(e):!1}function Yn(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=at(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=at(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function at(e){if(ot.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>ot.has(o.type));return r.length===1?r[0]:null}function ct(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)M(r)||(n+=1);return n}function lt(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!M(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!M(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}var er=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),tr=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),nr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),rr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),or=new Set(["catch","for","function","if","return","switch","while"]);function re(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=E(n),n.external&&(t.externalLineCount+=E(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...cr(n));let r=P(n.astLanguage,n.body);r?ir(n,r.rootNode,t):ar(n,t)}return sr(t),t.externalScriptPaths=mt(t.externalScriptPaths),t}function sr(e){e.composables=I(e,"composable"),e.stores=I(e,"store"),e.reactivity=I(e,"reactivity"),e.lifecycle=I(e,"lifecycle"),e.requests=I(e,"request"),e.macros=I(e,"macro")}function I(e,t){return mt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function ir(e,t,n){let r=new Set,o=new Set,s=i=>{let a=ut(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Y(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:ft(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function ar(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||or.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+ne(e.body,n.index??0),categories:ft(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function cr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+ne(e.body,n.index??0);for(let i of lr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function lr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function ft(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),er.has(e)&&t.push("reactivity"),tr.has(e)&&t.push("lifecycle"),nr.has(e)&&t.push("request"),rr.has(e)&&t.push("macro"),t}function ne(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function mt(e){return[...new Set(e)].sort()}import{ElementTypes as ur,NodeTypes as ge,parse as pr}from"@vue/compiler-dom";import{parse as Ws}from"@vue/compiler-sfc";function dt(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var fr=L("vue-template-facts"),mr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),dr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),gr=new Set(["div","span","template"]),hr=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function oe(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return fr.get(e,n,r,()=>Sr(n,R(e,n).template))}function Sr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=pr(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return ht(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function ht(e,t,n,r){for(let o of e)if(o.type===ge.ELEMENT)yr(o,t,n,r),ht(o.children,t,n,r);else if(o.type===ge.INTERPOLATION){r("interpolation");let s=he(o.content);s&&St(s,t,o.loc.start.line,n,r)}}function yr(e,t,n,r){let o=Tr(e.tag),s={tag:e.tag,normalized:o,kind:kr(e),startLine:V(t,e.loc.start.line),endLine:V(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),gr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)xr(i,t,n,r)}function xr(e,t,n,r){if(e.type===ge.ATTRIBUTE){let a=e.value?.content??null,c=gt("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Nr(e),s=he(e.exp),i=gt(vr(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&St(s,t,e.loc.start.line,n,r)}function gt(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:V(r,o),endLine:V(r,s)}}function vr(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Nr(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function St(e,t,n,r,o){for(let s of Cr(e)){let i={name:s,startLine:V(t,n),endLine:V(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function Cr(e){let t=new Set,n=br(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];hr.has(s)||ee(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function br(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function kr(e){let t=e.tag;return e.tagType===ur.COMPONENT?"component":mr.has(t)?"builtin":dr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Tr(e){return dt(e,/[-_:]/)}function V(e,t){return e+Math.max(0,t-1)}import{createRequire as jr}from"module";import{existsSync as w}from"fs";import{basename as xt,dirname as h,extname as k,join as x,relative as A,resolve as f,sep as Br}from"path";import{existsSync as ye,readdirSync as _r,statSync as Lr}from"fs";import{join as j,relative as Fr}from"path";function yt(e){let t=Pr(e)??Rr(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Ir(e,o)){if(r.has(s))continue;r.add(s);let i=Vr(e,s);i&&n.push(i)}return n}function Pr(e){let t=j(e,"pnpm-workspace.yaml");if(!ye(t))return null;try{return Er(H(t,"pnpm workspace manifest"))}catch{return null}}function Er(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Ar(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=wr(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Ar(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function wr(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Rr(e){let t=j(e,"package.json");if(!ye(t))return null;try{let n=JSON.parse(H(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Ir(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=j(e,t);return Se(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=j(e,r||".");return Se(s)?_r(s).map(i=>j(s,i,o)).filter(Se):[]}function Se(e){try{return Lr(e).isDirectory()}catch{return!1}}function Vr(e,t){let n=j(t,"package.json");if(!ye(n))return null;try{let r=JSON.parse(H(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Fr(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var $r=X("indexed-paths",{clearGroups:[]}),Or=X("indexed-path-digest",{clearGroups:[]}),Dr=F("tsconfig-alias-config",{clearGroups:["whole-project"]}),Wr=F("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Ur=jr(import.meta.url),z;function Mr(){if(z!==void 0)return z;try{z=Ur("typescript")}catch{z=null}return z}var zr=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],qr=X("workspace-packages",{clearGroups:["whole-project"]}),q=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],vt=[".py",".pyi"],Nt=[".java",".scala",".kt",".kts"],Ct=[".rs"],bt=[".rb"],kt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Tt=[".cs",".vb"],_t=[".dart"],Lt=[".php"],se=[".clj",".cljs",".cljc"],Hr=new Set(q),xe=new Set(vt),Ft=new Set(Nt),ve=new Set(Ct),Ne=new Set(bt),Pt=new Set(kt),Et=new Set(Tt),Ce=new Set(_t),At=new Set(Lt),wt=new Set(se),Xr=[{extensions:q,lookup:Hr},{extensions:vt,lookup:xe},{extensions:Nt,lookup:Ft},{extensions:Ct,lookup:ve},{extensions:bt,lookup:Ne},{extensions:kt,lookup:Pt},{extensions:Tt,lookup:Et},{extensions:_t,lookup:Ce},{extensions:Lt,lookup:At},{extensions:se,lookup:wt}];function T(e,t){return t.has(k(e).toLowerCase())}function Jr(e){return T(e,xe)}function Zr(e){return T(e,Ft)}function Gr(e){return T(e,ve)}function Kr(e){return T(e,Ne)}function Qr(e){return T(e,Pt)}function Yr(e){return T(e,Et)}function ii(e){return k(e).toLowerCase()===".vb"}function eo(e){return T(e,Ce)}function to(e){return T(e,At)}function no(e){return T(e,wt)}function ro(e){let t=k(e).toLowerCase();for(let n of Xr)if(n.lookup.has(t))return n.extensions;return q}function oo(e){return Zr(e)||Yr(e)||to(e)}function Rt(e,t,n){return Jr(t)?yo(e,t,n):Gr(t)?xo(e,t,n):Kr(t)?vo(e,t,n):Qr(t)?No(e,t,n):oo(t)?Co(e,n.replace(/\\/g,"."),ro(t)):eo(t)?bo(e,t,n):no(t)?ko(e,n):so(e,t,n)}function so(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return io(e,t,n)??co(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of ke(o)){let a=v(A(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(A(e.config.projectRoot,o))}function io(e,t,n){let r=go(e,t);if(!r)return null;let o=_(e);for(let s of ao(r,n)){let i=f(r.baseUrl,s);for(let a of ke(i)){let c=v(A(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function ao(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function co(e,t){let n=uo(lo(e),t);if(!n)return null;let r=_(e);for(let o of po(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of ke(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function lo(e){return qr.get(e,()=>yt(e.config.projectRoot))}function uo(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function po(e){let t=[],n=fo(e.pkg.exports,e.subpath);if(n){let r=mo(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function fo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return It(e[n])}function It(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=It(t[n]);if(r)return r}return null}function mo(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function go(e,t){let n=v(h(t));return Wr.get(e,n,()=>ho(e,n))}function ho(e,t){let n=Mr();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+Br);){for(let i of zr){let a=x(o,i);if(!w(a))continue;let c=Dr.get(e,a,()=>So(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function So(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function yo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of To(o)){let i=v(A(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function xo(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),be(e,_o(s))}function vo(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return be(e,Lo(o))}function No(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return be(e,o)}function Co(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>xt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function bo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Fo(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function ko(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of se){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of se){let s=[...r].find(i=>xt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function To(e){let t=k(e);return xe.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function be(e,t){let n=_(e);for(let r of t){let o=v(A(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function _o(e){let t=k(e);return ve.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Lo(e){let t=k(e);return Ne.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Fo(e){let t=k(e);return Ce.has(t)?[e]:[`${e}.dart`,e]}function ke(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of q)n.add(e.slice(0,-t.length)+r)}else for(let r of q)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return $r.get(e,()=>new Set(O(e,{includeIgnored:!1}).map(v)))}function ai(e){return Or.get(e,()=>Le([..._(e)].sort().join(`
18
+ `)))}var Po=new Set(["in","key","of"]),Eo=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Ao=L("vue-component-behavior-profiles");function Vt(e,t={}){let n=W(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Te(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=Ao.get(e,n,r,()=>wo(e,n,r));return Io(o)}function wo(e,t,n){let r=R(e,t),o=oe(e,t),s=re(r),i=Bo(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,$)=>$.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,$)=>$.indexOf(m)===C).sort(),l=n?n.split(`
19
+ `).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ie,paths:ae}=Ro(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:jo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ie,delegatedComposablePaths:ae}}function Ro(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Rt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
20
+ `).length:0)},0),paths:o}}function Io(e){let t=Vo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function Vo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function jo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Eo.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Bo(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of $o(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of jt(n.value))t.add(r);return[...t].sort()}function $o(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?jt(t[1]??""):[]}function jt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Po.has(r)||t.push(r)}return t}function Ci(e){return{capability:(t,n)=>Oo(t,n),reactProfiles:(t={})=>et(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>Vt(e,t),vueProfileForFile:t=>Te(e,t),vueTemplateFacts:t=>oe(e,t),vueScriptFacts:t=>re(R(e,t))}}function Oo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{O as a,Uo as b,yt as c,Ir as d,q as e,vt as f,Nt as g,Ct as h,bt as i,kt as j,Tt as k,_t as l,Lt as m,se as n,ii as o,ro as p,Rt as q,yo as r,xo as s,vo as t,No as u,Co as v,bo as w,ko as x,ai as y,D as z,ce as A,pe as B,ze as C,is as D,Y as E,Q as F,ut as G,dt as H,ms as I,Je as J,W as K,ds as L,Ci as M};
21
+ //# sourceMappingURL=chunk-ADTBPVUZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-GW6Z3WGY.js";import{a as t}from"./chunk-GTXSJDCO.js";function a(e,o){let r=t(e,o);return r?i(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=t(e,o);return r?i(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
2
+ //# sourceMappingURL=chunk-AKB7V7TV.js.map
@@ -0,0 +1,11 @@
1
+ import{a as F}from"./chunk-GTXSJDCO.js";import{c as w}from"./chunk-7FND7D7N.js";import{k as E}from"./chunk-6CS3UQTN.js";import{a as S,b as y,j as _}from"./chunk-C7QOQX32.js";import{a as x}from"./chunk-TIIC3ZE7.js";import{d as k}from"./chunk-FETNQCFO.js";import{f as v,g as R}from"./chunk-CWONGW6P.js";import{c as p}from"./chunk-NNJ2KZZG.js";function L(e,t){let a=p(t),n=[],r="complete",i=x(a);i==="entry"&&s(n,"operational-root","structural entrypoint path"),i==="worker"&&s(n,"operational-root","worker launch convention"),_(a)&&s(n,"operational-root","framework-discovered entrypoint"),M(e,a)&&s(n,"operational-root","configured entry root");let l=!1;try{l=S(e,a),l&&s(n,"published-api","package manifest export");for(let o of y(e,a))s(n,"operational-root",o)}catch(o){r="partial",s(n,"metadata-unavailable",`package metadata unavailable: ${I(o)}`)}try{let o=v(e.config.projectRoot,a,{maxBytes:8388608,inputKind:"change-surface source"});N(o)&&s(n,"operational-root","module contains a direct-execution process guard")}catch(o){r="partial",s(n,"metadata-unavailable",R(o)?"indexed source file is unavailable on disk":`source metadata unavailable: ${I(o)}`)}return{operationalRoot:n.some(o=>o.kind==="operational-root"),publishedApi:l,coverage:r,reasons:n}}function M(e,t){let a=e.config.entryRoots;return a?a.files?.some(n=>p(n)===t)?!0:a.pathPrefixes?.some(n=>t.startsWith(p(n)))??!1:!1}function N(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,t,a){e.some(n=>n.kind===t&&n.detail===a)||e.push({kind:t,detail:a})}function I(e){return e instanceof Error?e.message:String(e)}function V(e,t,a={}){let n=F(e,t);if(!n)return null;let r=T(e,n);if(!r||e.isIgnored(r.relative_path))return null;let i=[],l=0,o=!0,h=j(e,r.relative_path),f=L(e,r.relative_path),b=a.semantic===!1?{callers:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set}:E(e,h);for(let u of h){let c=O(e,r,u,b.callers.get(u.symbolId)??new Set);l+=c;let m=P(a.semantic!==!1,u.symbolId,b),d=m==="complete"||m==="disabled";d||(o=!1);let g=d?c:null,C=g===null?void 0:$(g),D=[...f.reasons,...c>0?[{kind:"external-consumers",detail:`${c} known external consumer${c===1?"":"s"}`}]:[],...d?[]:[{kind:"semantic-consumer-coverage",detail:`compiler-resolved consumer evidence is ${m}`}]];i.push({symbol:u.symbol,shortName:k(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:g,knownExternalConsumers:c,consumerCoverage:m,externalConsumerRiskLevel:C,riskLevel:A(C,f,!d),riskReasons:D})}return{file:r.relative_path,symbols:i,totalExternalConsumers:o?l:null,knownTotalExternalConsumers:l,fileRisk:f}}function P(e,t,a){if(!e)return"disabled";let n=a.incompleteSymbolIds.has(t),r=a.unavailableSymbolIds.has(t);return n&&r?"incomplete-and-unavailable":n?"incomplete":r?"unavailable":"complete"}function T(e,t){return e.get(`SELECT id, relative_path FROM documents
2
+ WHERE relative_path = ?
3
+ ${e.pathExclusionsFor("documents")}
4
+ LIMIT 1`,t)??null}function j(e,t){return new w(e).definitionsForFile(t).sort((a,n)=>a.startLine-n.startLine||a.endLine-n.endLine)}function O(e,t,a,n){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents consumer_d ON consumer_d.id = c.document_id
8
+ WHERE m.symbol_id = ?
9
+ AND m.role != 1
10
+ AND c.document_id != ?`,a.symbolId,t.id);return new Set([...r.map(i=>i.relative_path),...[...n].filter(i=>i!==t.relative_path)]).size}function $(e){return e>10?"high":e>0?"medium":"low"}function A(e,t,a){return e==="high"?"high":a||e==="medium"||t.operationalRoot||t.publishedApi||t.coverage==="partial"?"medium":"low"}export{V as a};
11
+ //# sourceMappingURL=chunk-ANFVSJWQ.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ var u={exact:"Direct compiler or source evidence establishes this relationship within the provider's reported coverage.",derived:"A deterministic analysis computed this relationship from reported input facts; it was not directly observed.",candidate:"Ambiguous or heuristic evidence identifies a lead that requires exact graph or source confirmation.",mixed:"The relationship combines evidence of different strengths; its constituent methods and strengths remain disclosed.",unknown:"The relationship has no calibrated evidence strength and cannot support a stronger claim than its raw observation."},a=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function s(t){let n=new Set(t);return a.filter(o=>o.families.some(r=>n.has(r)))}function m(t){return s(t).map(n=>`[${n.id}] ${n.capability} ${n.consequence} Recover selected paths with: ${n.recoverWith.map(o=>`codebaseiq ${o}`).join(", ")}.`)}var c=["incoming","outgoing","both"];function e(t,n,o,r={}){return{family:t,subtype:n,...r.match?{match:r.match}:{},directions:c,evidenceStrengths:r.strengths??["exact","derived","mixed"],supportCeiling:r.supportCeiling??"partial",establishes:o,nonClaims:r.nonClaims??[],recoverWith:r.recoverWith??["inspect","code"]}}var l=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],d=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],p=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],h=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[e("execution","call","The source construct may call the resolved target.",{nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime."],recoverWith:["call-graph","inspect","code"]}),e("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),e("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),e("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","trace","inspect"]}),e("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),e("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),e("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[e("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),e("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),e("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),e("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...l.map(t=>e("execution",t,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),e("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),e("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:[...["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(t=>e("dataflow",t,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))]},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[e("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),e("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...d.map(t=>e("dataflow",t,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(t=>e("state",t,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...p.map(t=>e("temporal",t,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function g(t,n){let o=h.flatMap(r=>r.relations.filter(i=>i.family===t&&(i.match==="prefix"?n.startsWith(i.subtype):n===i.subtype)).map(i=>({provider:r,relation:i})));if(o.length>1)throw new Error(`Ambiguous graph relation provider for ${t}/${n}: ${o.map(r=>r.provider.id).join(", ")}`);return o[0]??null}var f=["execution","runtime","dataflow","state","temporal","contract","identity","ownership","dependencies"];export{u as a,a as b,m as c,h as d,g as e,f};
3
+ //# sourceMappingURL=chunk-B2OB55RR.js.map
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{b as m}from"./chunk-362QOSFD.js";var p=new Set(m),d=new Map(m.map((n,e)=>[n,e])),c=new Set(["Navigation","Graph","Impact","Exploration"]),u=new Set(["Cleanup","Health"]),y=new Set(["Indexing","Core","Maintenance"]);function h(n){if(n.hidden||n.agent?.semantic?.compatibility==="deprecated")return"compatibility";if(p.has(n.id))return"primary-exploration";let e=n.docs?.category;if(e&&c.has(e))return"specialized-analysis";if(e&&u.has(e))return"quality-cleanup";if(e&&y.has(e))return"maintenance";if(e==="Formal Models")return"formal-modeling";throw new Error(`Visible command ${n.id} has no cockpit panel (docs category: ${e??"missing"}).`)}function f(n,e={}){return[{id:"primary-exploration",title:"Primary exploration",purpose:"Locate exact referents, project chosen relationships, and read only named implementation gaps."},{id:"specialized-analysis",title:"Specialized analysis",purpose:"Run a named graph, impact, or structural analysis when that exact analysis answers the task."},{id:"quality-cleanup",title:"Quality and cleanup",purpose:"Evaluate repository quality, cleanup candidates, and configured architecture findings."},{id:"maintenance",title:"Maintenance",purpose:"Build, inspect, configure, and maintain the project index and local integrations."},{id:"formal-modeling",title:"Formal modeling",purpose:"Create, verify, and check explicit state-machine models and traces."},{id:"compatibility",title:"Compatibility and deprecated controls",purpose:"Preserved invocation surfaces for existing consumers; do not choose these for new workflows."}].map(i=>({...i,commands:n.filter(t=>h(t)===i.id).sort((t,a)=>i.id==="primary-exploration"?(d.get(t.id)??Number.MAX_SAFE_INTEGER)-(d.get(a.id)??Number.MAX_SAFE_INTEGER):0)})).filter(i=>i.commands.length>0&&(e.includeCompatibility||i.id!=="compatibility"))}function C(n,e,s={}){let o=[`Usage: ${n.name()} [options] [command]`,"",n.description(),"","Options:"],i=n.options.map(a=>a.flags),t=Math.max(...i.map(a=>a.length),0);for(let a of n.options)o.push(` ${a.flags.padEnd(t)} ${a.description}`);o.push(` ${"-h, --help".padEnd(t)} Display this grouped command help`);for(let a of f(e,s)){o.push("",`${a.title}:`,` ${a.purpose}`);let l=Math.max(...a.commands.map(r=>r.command.length),0);for(let r of a.commands)o.push(` ${r.command.padEnd(l)} ${r.description}`)}return s.includeCompatibility||o.push("","Run `codebaseiq --help-all` to include compatibility and deprecated controls."),o.push("Run `codebaseiq <command> --help` for one control's options and examples.",""),o.join(`
3
+ `)}export{h as a,f as b,C as c};
4
+ //# sourceMappingURL=chunk-B3UYV66Z.js.map
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-BGBBVSH4.js";function u(n,e){return o(n)-o(e)||n.relativePath.localeCompare(e.relativePath)}function d(n,e){return typeof e!="number"||e<=0||n.length<=e?n:n.slice(0,e)}function l(n){let e=new Set,i=[];for(let t of n){let r=`${t.symbol}|${t.file}`;e.has(r)||(e.add(r),i.push(t))}return i}export{u as a,d as b,l as c};
2
+ //# sourceMappingURL=chunk-B75HZHUP.js.map
@@ -0,0 +1,2 @@
1
+ import{K as c}from"./chunk-ADTBPVUZ.js";import{f as a,u,w as p}from"./chunk-BMYOV5GP.js";var g=a("suppression-inventory",{clearGroups:["whole-project"]});function b(t){return g.get(t,()=>y(t))}function y(t){let e={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},n=new Map,o=0;for(let r of c(t)){let i=u(t,r);if(!(!i||!i.includes("codebaseiq")))for(let f of i.split(/\r?\n/)){let s=p(f);if(s===null)continue;o+=1,n.set(r,(n.get(r)??0)+1);let d=l(s);e[d]+=1}}for(let r of t.config.suppressions??[])r.expiresAt&&Date.parse(r.expiresAt)<=Date.now()||(o+=1,r.file&&n.set(r.file,(n.get(r.file)??0)+1),e[l(r.check)]+=1);return{total:o,byCategory:e,byFile:n}}function l(t){if(!t)return"uncategorized";let e=t.toLowerCase();return e==="dead-code"||e==="new-dead"?"dead":e.includes("twin")?"twin":e.includes("similar")||e.includes("duplicate")?"similar":e.includes("wrapper")?"wrapper":e.includes("passthrough")?"passthrough":e.includes("drift")?"drift":e.includes("extract")?"extract":e.includes("stale")?"stale":"uncategorized"}export{b as a};
2
+ //# sourceMappingURL=chunk-BFFZDZQV.js.map
@@ -0,0 +1,2 @@
1
+ function n(e){return e.endLine-e.startLine+1}export{n as a};
2
+ //# sourceMappingURL=chunk-BGBBVSH4.js.map
@@ -0,0 +1,2 @@
1
+ import{b as i}from"./chunk-UDS562V4.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-BH5F2Q4O.js.map
@@ -0,0 +1,2 @@
1
+ import{v as c,w as l}from"./chunk-BMYOV5GP.js";function h(e,a,i,r,n,o){let t=new Set;d(e,a,i,r)&&t.add(n);for(let s of o)s.value&&p(t,s.label,s.value);return[...t].slice(0,6)}function p(e,a,i){let r=u(i);a.endsWith("name")&&y(r)&&e.add(`${a} has type-guard boundary shape`);for(let n of r){let o=f.get(n);o&&e.add(`${a} has ${o} term: ${n}`)}}function d(e,a,i,r){if(i<=0)return!1;let n=c(e,a);if(n.length===0)return!1;for(let o=i-1;o>=0&&o>=i-5;o-=1){let t=(n[o]??"").trim();if(t!==""){if(l(t)===r)return!0;if(!t.startsWith("//")&&!t.startsWith("*")&&!t.startsWith("/*")&&!t.startsWith("@")&&!t.startsWith("#"))return!1}}return!1}function u(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function y(e){return e.some(a=>g.has(a))&&e.some(a=>m.has(a))}var f=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),g=new Set(["can","has","is","should"]),m=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{h as a};
2
+ //# sourceMappingURL=chunk-BJ6SQAEN.js.map
@@ -0,0 +1,77 @@
1
+ import{f as w,g as P}from"./chunk-CWONGW6P.js";import{a as T,b as S,d as _}from"./chunk-3LCDIREB.js";import{v as R}from"./chunk-NNJ2KZZG.js";var F=[],L=[];function y(t){t.groups.length>0&&F.push(t)}function O(t){L.push(t)}function pe(t){let n=[];for(let e of L)try{e.close(t)}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Multiple database-owned resources failed to close.")}function ue(t,n){let e=new Set(n.groups);for(let a of F)a.groups.some(r=>e.has(r))&&(n.file!==void 0&&a.clearFile?a.clearFile(t,n.file):a.clearAll(t))}function A(){let t=new WeakMap;return{cache:t,ensure(n){let e=t.get(n);return e||(e=new Map,t.set(n,e)),e}}}function h(t,n){let{cache:e,ensure:a}=A(),r={get(i,s,o){let c=a(i);if(c.has(s))return c.get(s);let d=o();return c.set(s,d),d},invalidate(i,s){e.get(i)?.delete(s)},invalidateAll(i){e.delete(i)},size(i){return e.get(i)?.size??0}};return y({name:t,groups:n.clearGroups,clearAll:i=>r.invalidateAll(i),clearFile:(i,s)=>r.invalidate(i,s)}),r}function he(t,n){let e=new WeakMap,a={get(r,i){let s=e.get(r);if(s)return s.value;let o=i();return e.set(r,{value:o}),o},invalidate(r){e.delete(r)},has(r){return e.has(r)}};return y({name:t,groups:n.clearGroups,clearAll:r=>a.invalidate(r)}),a}var $={clearGroups:["whole-project","source-file"]};function ve(t){return G(t,$)}function G(t,n){let{cache:e,ensure:a}=A(),r={get(i,s,o,c){let d=a(i),D=d.get(s);if(D&&D.source===o)return D.value;let N=c();return d.set(s,{source:o,value:N}),N},invalidate(i,s){e.get(i)?.delete(s)},invalidateAll(i){e.delete(i)}};return y({name:t,groups:n.clearGroups,clearAll:i=>r.invalidateAll(i),clearFile:(i,s)=>r.invalidate(i,s)}),r}import{createHash as Y}from"crypto";import{existsSync as De,mkdirSync as z}from"fs";import{dirname as k,join as q}from"path";import x from"better-sqlite3";var J="evidence.db";var Q=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],C=new Set(Q);var Ne=512*1024*1024,Z=6e4,f=new WeakMap;O({name:"evidence-connections",close:V});var ee=h("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),te=h("evidence-project-fingerprint",{clearGroups:["whole-project"]}),p="evidence-v1",v="version NOT LIKE 'evidence-%'";function I(t){return Y("sha256").update(t).digest("hex")}function Re(t,n,e){return ee.get(t,n,()=>I(e))}function j(t){return te.get(t,"current",()=>{try{if(!t.generation.metadataRaw)return null;let n=R(t.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let e=n.metadata,a=[...e.indexedLanguages??[]].sort();return I(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(n){return E("project fingerprint unavailable",n),null}})}function E(t,n){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${t}: ${n instanceof Error?n.message:String(n)}`)}function u(t){if(f.has(t))return f.get(t)??null;let n=null;try{let e=new x(q(k(t.config.dbPath),J));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `),n={evidence:e,shared:ne(t.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${v}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.prepare(`SELECT payload FROM project_evidence
39
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${v}
40
+ ORDER BY version DESC
41
+ LIMIT 1`),writeProjectEvidence:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
42
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
43
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${v}
44
+ ORDER BY version DESC
45
+ LIMIT 1`),readCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
46
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
47
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${v}
48
+ ORDER BY symbol, version DESC`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
49
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
50
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
51
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${v}
52
+ ORDER BY version DESC
53
+ LIMIT 1`),readReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
54
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
55
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${v}
56
+ ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
57
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){E("disabled (open failed)",e)}return f.set(t,n),n}function g(t,n,e){E(`disabled (${n})`,e);try{V(t)}catch(a){E("close failed while disabling",a)}f.set(t,null)}function V(t){let n=f.get(t);if(f.delete(t),!n)return;let e,a;try{n.shared?.evidence.close()}catch(r){e=r}try{n.evidence.close()}catch(r){a=r}if(e!==void 0&&a!==void 0)throw new AggregateError([e,a],"Shared and project evidence connections failed to close.");if(e!==void 0)throw e;if(a!==void 0)throw a}function ne(t){if(!t)return null;try{z(k(t),{recursive:!0});let n=new x(t);return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
58
+ CREATE TABLE IF NOT EXISTS file_evidence (
59
+ kind TEXT NOT NULL,
60
+ relative_path TEXT NOT NULL,
61
+ content_hash TEXT NOT NULL,
62
+ version TEXT NOT NULL,
63
+ payload TEXT NOT NULL,
64
+ last_accessed_at INTEGER NOT NULL,
65
+ PRIMARY KEY (kind, relative_path, content_hash, version)
66
+ );
67
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
+ `),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
+ VALUES (?, ?, ?, ?, ?, ?)
71
+ ON CONFLICT(kind, relative_path, content_hash, version)
72
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
73
+ SET last_accessed_at = ?
74
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
+ AND last_accessed_at < ?`)}}catch(n){return E("shared cache disabled (open failed)",n),null}}function b(t,n,e){E(`shared cache disabled (${n})`,e);try{t.shared?.evidence.close()}catch{}t.shared=null}function M(t,n,e,a){let r=u(t);if(!r)return null;try{let i=r.readFileEvidence.get(n,e,a,p)??r.readLegacyFileEvidence.get(n,e,a);if(i?.payload!==void 0)return i.payload;if(!C.has(n)||!r.shared)return null;try{let s=r.shared.readFileEvidence.get(n,e,a,p);return s?.payload!==void 0&&re(r.shared,n,e,a),s?.payload??null}catch(s){return b(r,"file_evidence read",s),null}}catch(i){return g(t,"file_evidence read",i),null}}function re(t,n,e,a){let r=Date.now();try{t.touchFileEvidence.run(r,n,e,a,p,r-Z)}catch(i){E("shared file_evidence recency touch skipped",i)}}function K(t,n,e,a,r){let i=u(t);if(i)try{if(i.writeFileEvidence.run(n,e,a,p,r),C.has(n)&&i.shared)try{i.shared.writeFileEvidence.run(n,e,a,p,r,Date.now())}catch(s){b(i,"file_evidence write",s)}}catch(s){g(t,"file_evidence write",s)}}function H(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{for(let r of n)e.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload)})();let a=n.filter(r=>C.has(r.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let r of a)e.shared.writeFileEvidence.run(r.kind,r.relativePath,r.contentHash,p,r.payload,Date.now())})()}catch(r){b(e,"file_evidence batch write",r)}}catch(a){g(t,"file_evidence batch write",a)}}function U(t,n,e,a){let r=u(t);if(!r)return null;try{return(r.readProjectEvidence.get(n,e,a,p)??r.readLegacyProjectEvidence.get(n,e,a))?.payload??null}catch(i){return g(t,"project_evidence read",i),null}}function X(t,n,e,a,r){let i=u(t);if(i)try{i.writeProjectEvidence.run(n,e,a,p,r)}catch(s){g(t,"project_evidence write",s)}}function we(t,n,e,a){let r=u(t);if(!r)return new Map;try{let i=r.readCalleesForFile.all(n,e,a,p),s=r.readLegacyCalleesForFile.all(n,e,a);return B([...s,...i])}catch(i){return g(t,"semantic_callees bulk read",i),new Map}}function Pe(t,n,e){let a=u(t);if(!a)return new Map;try{let r=a.readReferencesForFile.all(n,e,p),i=a.readLegacyReferencesForFile.all(n,e);return B([...i,...r])}catch(r){return g(t,"semantic_references bulk read",r),new Map}}function B(t){let n=new Map;for(let e of t)n.set(e.symbol,e.payload);return n}function Fe(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of n){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,p,r.payload)}})()}catch(a){g(t,"semantic_callees write",a)}}function Le(t,n){if(n.length===0)return;let e=u(t);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of n){let i=`${r.relativePath}\0${r.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(r.relativePath,r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,p,r.payload)}})()}catch(a){g(t,"semantic_references write",a)}}function Ae(t){return typeof t=="object"&&t!==null}function ke(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")?t:null}var ae=[l("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),l("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),l("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),l("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),l("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),l("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),l("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),l("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),l("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),l("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),l("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),l("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),l("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),m("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),m("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Ke(t){let n=new Map;return{kind:t.kind,read(e,a,r){let i=!1,s=0,o;if(T()){let c=j(e);if(c){let d=`${c}\0${a}\0${r}`;o=n.get(d),o||(o=S(["evidence-product-file-read-v1",t.kind,c,a,r]),n.set(d,o))}}return _("evidence-product.file.read",()=>{let c=M(e,t.kind,a,r);if(c===null)return null;s=c.length;try{let d=t.deserialize(c);return i=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:t.kind,available:!0,hit:i,payloadBytes:s}))},write(e,a,r,i){K(e,t.kind,a,r,t.serialize(i))},writeBatch(e,a){H(e,a.map(r=>({kind:t.kind,relativePath:r.relativePath,contentHash:r.contentHash,payload:t.serialize(r.value)})))}}}function He(t){let n=new Map;return{kind:t.kind,read(e,a,r){let i=!1,s=0,o;if(T()){let c=`${r}\0${a}`;o=n.get(c),o||(o=S(["evidence-product-project-read-v1",t.kind,r,a]),n.set(c,o))}return _("evidence-product.project.read",()=>{let c=U(e,t.kind,a,r);if(c===null)return null;s=c.length;try{let d=t.deserialize(c);return i=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:t.kind,available:!0,hit:i,payloadBytes:s}))},write(e,a,r,i){X(e,t.kind,a,r,t.serialize(i))}}}function Ue(t){let n=ae.find(e=>e.kind===t);if(!n)throw new Error(`missing evidence product manifest entry for ${t}`);return n.invalidation}function l(t,n){return{scope:"file",kind:t,invalidation:{scope:"file",...n}}}function m(t,n){return{scope:"project",kind:t,invalidation:{scope:"project",...n}}}var ie=h("source-text",{clearGroups:["whole-project","source-file"]}),se=h("source-lines",{clearGroups:["whole-project","source-file"]});function oe(t,n){let e=n.replace(/\\/g,"/");return ie.get(t,e,()=>{try{return w(t.config.projectRoot,e,{inputKind:"indexed source file"})}catch(a){if(P(a))return"";throw a}})}function ce(t,n){let e=n.replace(/\\/g,"/");return se.get(t,e,()=>{let a=oe(t,e);return a?a.split(`
76
+ `):[]})}var de=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function le(t){let n=de.exec(t);return n?n[1]??"":null}function $e(t,n,e){return W(t,n,e).length>0}function Ge(t,n,e,a){let r=a.toLowerCase();return W(t,n,e).some(i=>i.toLowerCase()===r)}function W(t,n,e){if(e<=0)return[];let a=ce(t,n);if(a.length===0)return[];let r=[];for(let i=e-1;i>=0&&i>=e-5;i-=1){let s=(a[i]??"").trim();if(s==="")continue;let o=le(s);if(o!==null){r.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return r}return r}export{y as a,O as b,pe as c,ue as d,h as e,he as f,ve as g,G as h,I as i,Re as j,j as k,we as l,Pe as m,Fe as n,Le as o,Ae as p,ke as q,Ke as r,He as s,Ue as t,oe as u,ce as v,le as w,$e as x,Ge as y};
77
+ //# sourceMappingURL=chunk-BMYOV5GP.js.map
@@ -0,0 +1,7 @@
1
+ import{b as k}from"./chunk-OZYRSMSH.js";import{c as D}from"./chunk-7FND7D7N.js";import{m as S}from"./chunk-CVYSU6BX.js";import{f as v,h as L}from"./chunk-C7QOQX32.js";import{d as h,t as y}from"./chunk-FETNQCFO.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
+ FROM global_symbols gs
3
+ JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
+ JOIN documents d ON d.id = der.document_id
5
+ WHERE gs.symbol = ?
6
+ LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
+ //# sourceMappingURL=chunk-BVAJLC5A.js.map
@@ -0,0 +1,4 @@
1
+ import{a as L}from"./chunk-DGXRDLV5.js";import{c as M}from"./chunk-OL6KJP3N.js";import{c as w}from"./chunk-7FND7D7N.js";import{a as I}from"./chunk-JOIRNPPY.js";import{f as E}from"./chunk-6CS3UQTN.js";import{f as x}from"./chunk-J77SU6VA.js";import{d as f}from"./chunk-SGX43S2L.js";import{d as C}from"./chunk-FETNQCFO.js";import{f as h}from"./chunk-O6QTXQPJ.js";var H=new Set(f());function U(e,t){return P(e,t).rows}function P(e,t){let{scope:l,minLoc:o=10,limit:s=30,scanLimit:a}=t??{},c=new w(e),r=t?.semantic!==!1,u=B(r,new Set,new Set);return{rows:L({candidates:()=>c.productionCallableDefinitions({scope:l,minLoc:o,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,filterCandidate:R,profile:{name:"complexity-hotspots"},prepare:n=>{let i=z(e,n);(r?E(e):null)?.materializeReferences(n,{prefetchCallees:!0});let m=x(e,n,{semantic:r,semanticEvidence:I}),y=c.calleeEvidenceMap(n,{semantic:r}),g=new Set([...m.incompleteSymbolIds,...y.incompleteSymbolIds]),v=new Set([...m.unavailableSymbolIds,...y.unavailableSymbolIds]);u=B(r,g,v);let D=new Map(n.map(p=>[p.symbolId,p]));return{callerMap:new Map([...m.rows].map(([p,F])=>[p,new Set(F.filter(d=>d.file!==D.get(p)?.relativePath).map(d=>d.file))])),calleeMap:y.rows,incompleteSymbolIds:g,unavailableSymbolIds:v,languageByFile:i,clojureCallableIds:k(e,n,i),branchEstimates:M(e,n)}},evaluate:(n,i)=>i.incompleteSymbolIds.has(n.symbolId)||i.unavailableSymbolIds.has(n.symbolId)?null:j(n,i,o),orderResults:(n,i)=>i.score-n.score||i.loc-n.loc,limit:s}),coverage:u}}function B(e,t,l){let o=new Set([...t,...l]).size,s=e?t.size>0&&l.size>0?"incomplete-and-unavailable":t.size>0?"incomplete":l.size>0?"unavailable":"complete":"disabled";return{semanticEvidence:{enabled:e,status:s,incompleteSymbolCount:t.size,unavailableSymbolCount:l.size,excludedSymbolCount:o}}}function R(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&H.has(e.kind):!0}function j(e,t,l){if(t.languageByFile.get(e.relativePath)==="clojure"&&!t.clojureCallableIds.has(e.symbolId))return null;let o=e.endLine-e.startLine+1;if(o<l)return null;let s=t.callerMap.get(e.symbolId)?.size??0,a=t.calleeMap.get(e.symbolId)??[],c=new Set,r=new Set;for(let b of a){let m=`${b.symbol}|${b.file}`;c.add(m),b.file!==e.relativePath&&r.add(m)}let u=r.size,S=c.size,n=t.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},i=n.branches+1;return{symbol:e.symbol,shortName:C(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:s,fanOut:u,calleeCount:S,branches:n.branches,estimateBasis:n.estimateBasis,score:Math.round(o/50*(s/5)*Math.max(u/5,1)*Math.max(i/5,1)*100)/100}}function z(e,t){let l=[...new Set(t.map(a=>a.relativePath))];if(l.length===0)return new Map;let o=l.map(()=>"?").join(", "),s=e.all(`SELECT relative_path, language
2
+ FROM documents
3
+ WHERE relative_path IN (${o})`,...l);return new Map(s.map(a=>[a.relative_path,a.language?.toLowerCase()??null]))}function k(e,t,l){let o=new Set,s=new Map;for(let a of t){if(l.get(a.relativePath)!=="clojure")continue;let c=s.get(a.relativePath);c||(c=new Set((h(e,a.relativePath)?.callables??[]).map(r=>`${r.name}:${r.startLine}`)),s.set(a.relativePath,c)),c.has(`${a.leaf}:${a.startLine}`)&&o.add(a.symbolId)}return o}export{U as a,P as b};
4
+ //# sourceMappingURL=chunk-C6SBF2WH.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(t){if(t[2]!=="evidence")return;let i=t[3];if(!i||i.startsWith("-"))return;if(t.slice(4).some(e=>c.some(r=>e===r||e.startsWith(`${r}=`)))){t.splice(3,1,"--symbol",i);return}t[2]="evidence-source"}function a(t){return t!==void 0&&s.has(t)}async function p(t){if(t==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-65J5IP3O.js");return[n]}if(a(t)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-DP4LVMRX.js"),o=n.find(e=>e.id===t);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${t}`);return[o]}let{commandDescriptors:i}=await import("./command-descriptors-6AOUKWW7.js");return i}export{d as a,a as b,p as c};
3
+ //# sourceMappingURL=chunk-C74PPYLA.js.map
@@ -0,0 +1,8 @@
1
+ import{a as p}from"./chunk-TIIC3ZE7.js";import{a as w}from"./chunk-OANDYLJQ.js";import{a as O}from"./chunk-NNOKTMZT.js";import{a as A,e as b,t as D}from"./chunk-FETNQCFO.js";import{o as _}from"./chunk-O6QTXQPJ.js";import{a as S}from"./chunk-ADTBPVUZ.js";import{f as u,v as j}from"./chunk-BMYOV5GP.js";import{f as m,g as R,h as T}from"./chunk-CWONGW6P.js";import{c as l}from"./chunk-NNJ2KZZG.js";import{existsSync as h,readdirSync as M}from"fs";import{join as d}from"path";var et={files:new Set,pathPrefixes:[]},nt={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,rt=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,$=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],st=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),it=4,at=u("package-surface",{clearGroups:["whole-project"]}),ot=u("package-operational-surface",{clearGroups:["whole-project"]});function C(t){return at.get(t,()=>ut(t.config.projectRoot))}function x(t,e){let n=C(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function N(t,e){return C(t).files.has(e)}function ct(t){return ot.get(t,()=>ft(t.config.projectRoot))}function ne(t,e){return ct(t).reasonsByFile.get(e)??[]}function ut(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of lt(r))X(t,s,i,e,n);return e.size===0&&n.length===0?et:{files:e,pathPrefixes:n}}function ft(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=gt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of pt(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?nt:{reasonsByFile:e}}function L(t){let e=[],n=V(t,"");return n&&e.push({manifest:n,packageRoot:""}),I(t,"",e,0),e}function I(t,e,n,r){if(r>=it)return;let s=d(t,e);if(h(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||st.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=V(t,a);o&&n.push({manifest:o,packageRoot:a}),I(t,a,n,r+1)}}function V(t,e){let n;try{n=m(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!R(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function lt(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function gt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function pt(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;X(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function X(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(rt,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of $)dt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function dt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||h(d(t,s)))return;let i=$.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);St(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function St(t,e,n,r,s){let i=f(n,`${r}/index${s}`);h(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!h(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as mt}from"fs";import{dirname as bt,join as k}from"path";var ht={rootFiles:new Set,sourcePrefixes:[]},yt=new Set([".git",".codebaseiq","node_modules","target"]),Pt=6,xt=u("rust-library-surface",{clearGroups:["whole-project"]});function U(t,e,n){if(!n.endsWith(".rs")||!wt(Et(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Rt(j(t,n)[r.startLine]??""):!1}function Et(t){return xt.get(t,()=>kt(t.config.projectRoot))}function kt(t){let e=new Set,n=new Set;for(let r of Tt(t)){let s=m(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=jt(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!_t(s)&&T(t,a)?a:null;if(!o)continue;e.add(o);let c=bt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?ht:{rootFiles:e,sourcePrefixes:[...n].sort()}}function wt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:Ot(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Rt(t){return/^\s*pub\s+(?!\()/.test(t)}function Tt(t){if(!E(t))return[];let e=[];return W(t,"",e,0),e}function W(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Pt)))for(let i of mt(s,{withFileTypes:!0})){if(!i.isDirectory()||yt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;W(t,a,n,r+1)}}function jt(t){let e=!1;for(let n of t.split(`
2
+ `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function _t(t){let e=!1;for(let n of t.split(`
3
+ `)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function Ot(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function At(t){return p(t)==="barrel"}function K(t){return Dt.get(t,()=>{let n=S(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=O(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Dt=u("live-barrels",{clearGroups:["whole-project"]});function vt(t,e){return K(t).has(l(e))}function ke(t){let e=K(t);return S(t,{includeIgnored:!1}).filter(n=>At(n)&&!e.has(n)&&!Ft(t,n))}function Ft(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
4
+ FROM defn_enclosing_ranges der
5
+ JOIN documents d ON d.id = der.document_id
6
+ WHERE d.relative_path = ?
7
+ AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function we(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||qt(n)||vt(t,n)}function Mt(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Nt(t,e,r)&&s.push("transitive-package-surface"),U(t,e,r)&&s.push("rust-public-library"),Kt(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>Jt(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return w(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function Re(t,e,n){return Mt(t,e,n).length>0}var $t=u("package-surface-reachability",{clearGroups:["whole-project"]}),Ct=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Nt(t,e,n){let r=Lt(t).get(n);return r===void 0?!1:r===null||r.has(b(e))}function Te(t,e,n){let r=It(t).get(n);return r===void 0?!1:r===null||r.has(b(e))}function Lt(t){return $t.get(t,()=>q(t,e=>x(t,e)))}function It(t){return Ct.get(t,()=>q(t,e=>N(t,e)))}function q(t,e){let n=new Map,r=[];for(let s of S(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of _(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Vt(i,a);o!==void 0&&Bt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Vt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Bt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Y=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Xt=new Set(["default","generateMetadata","generateStaticParams"]),Gt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),Ut=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Wt=new Set(["load","actions","entries",...Y]),Ht=new Set(["default"]);function Kt(t,e){let n=b(t);return n===""?!1:Z(e)?Y.has(n):J(e)?Xt.has(n):Q(e)?Gt.has(n):z(e)?Ut.has(n):tt(e)?Wt.has(n):Zt(e)?Ht.has(n):!1}function qt(t){return Z(t)||J(t)||Q(t)||Yt(t)||z(t)||tt(t)}function Z(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Yt(t){let e="(?:middleware|proxy|instrumentation)\\.(?:ts|js|mts|mjs)";return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function z(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function Zt(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Jt(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(H(r)+"/")&&t.includes(H(s)+".")}function H(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ne as b,At as c,vt as d,ke as e,we as f,Mt as g,Re as h,Te as i,qt as j};
8
+ //# sourceMappingURL=chunk-C7QOQX32.js.map
@@ -0,0 +1,7 @@
1
+ import{a as A}from"./chunk-BJ6SQAEN.js";import{a as T,b,c as W}from"./chunk-SELM5MER.js";import{a as R}from"./chunk-DGXRDLV5.js";import{a as N}from"./chunk-B75HZHUP.js";import{b as C,c as j}from"./chunk-7FND7D7N.js";import{a as _}from"./chunk-BGBBVSH4.js";import{b as E}from"./chunk-CVYSU6BX.js";import{A as P,d,e as w,k}from"./chunk-FETNQCFO.js";import{i as L}from"./chunk-O6QTXQPJ.js";import{d as x}from"./chunk-3LCDIREB.js";import{basename as m,extname as I}from"path";function ce(t,n){let{scope:e,maxLoc:i=15,limit:r=30,scanLimit:o}=n??{},a=new j(t),l=K(a.fileDependencyGraph(e));return R({candidates:()=>z(t,a,e,i),orderCandidates:N,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:c=>({...J(t,a,c,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(c,u)=>q(t,a,c,u),orderResults:(c,u)=>u.callerFanIn-c.callerFanIn||u.loc-c.loc,limit:r})}function J(t,n,e,i){let r=T(t,n),o=b(r.forDefinitions(e,{semantic:!1,sourceFallback:!1})),a=[];i.semantic&&x("wrapper.semantic-candidates",()=>{a=e.filter(s=>y(t,n,s,o).length<=1)},()=>({symbols:e.length,semanticCandidates:a.length}));let l=r.forDefinitions(a,{semantic:!0,sourceFallback:!1}),c=b(l),u=new Set([...l.values()].filter(s=>s.semanticIncomplete).map(s=>s.definition.symbolId)),f=new Set([...l.values()].filter(s=>s.semanticUnavailable).map(s=>s.definition.symbolId)),g=c.size===0?o:C(o,c),h=new Map(e.map(s=>[s.symbolId,s])),S=new Map;for(let s of e){let F=y(t,n,s,g);if(F.length>1||(S.set(s.symbolId,s),F.length!==1))continue;let D=F[0],v=O(t,s.symbolId,D);if(!v)continue;let p=B(n,t,D,s.symbol,v);p?.isFunctionLike&&h.has(p.symbolId)&&S.set(p.symbolId,h.get(p.symbolId))}let M=[...S.values()];return{callerFileMap:M.length===0?g:C(g,b(r.forDefinitions(M,{semantic:!1,sourceFallback:!0}))),incompleteSymbolIds:u,unavailableSymbolIds:f}}function q(t,n,e,i){if(i.incompleteSymbolIds.has(e.symbolId)||i.unavailableSymbolIds.has(e.symbolId))return null;let r=y(t,n,e,i.callerFileMap);if(r.length!==1)return null;let o=r[0],a=O(t,e.symbolId,o);if(!a)return null;let l=B(n,t,o,e.symbol,a);if(l&&k(l.symbol))return null;let{fanIn:c,source:u}=G(i.callerFileMap,i.reverseFanIn,o,l);if(u==="function"?c<=3:c<=5)return null;let f=Q(t,e,o,l);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:_(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?d(l.symbol):m(o),callerFanIn:c,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function z(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(r=>!L(t,r))}function y(t,n,e,i){let r=m(e.relativePath,I(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(a=>a!==e.relativePath).filter(a=>m(a,I(a))!==r).filter(a=>{let l=n.fileKind(a);return l!=="barrel"&&l!=="entry"&&l!=="test"});return W(t,e,o).realConsumers}function O(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d ON c.document_id = d.id
5
+ WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
+ LIMIT 1`,n,e)}function B(t,n,e,i,r){let o=t.definitionsForFile(e),a=H(n,e,i,r.start_line,r.end_line);return P(o,a)}function G(t,n,e,i){if(i?.isFunctionLike){let r=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(r.length>0)return{fanIn:r.length,source:"function"}}return{fanIn:U(n,e),source:"file"}}function H(t,n,e,i,r){let o=w(e);if(!o)return i;let a=E(t,n).get(o);if(!a||a.length===0)return i;for(let l of a)if(l>=i&&l<=r)return l;return i}function K(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let r of i)n.set(r,(n.get(r)??0)+1)}return n}function U(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,I(n)),r=0;for(let[o,a]of t)o!==n&&m(o,I(o))===i&&a>r&&(r=a);return r}function Q(t,n,e,i){return A(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ce as a};
7
+ //# sourceMappingURL=chunk-CAUCPUOF.js.map
@@ -0,0 +1,2 @@
1
+ import{a as c}from"./chunk-NNOKTMZT.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
2
+ //# sourceMappingURL=chunk-CO5R3UNA.js.map
@@ -0,0 +1,7 @@
1
+ import{b as B}from"./chunk-YSNONTJ2.js";import{c as K}from"./chunk-XLQ3GLWZ.js";import{a as O}from"./chunk-TIIC3ZE7.js";import{a as M}from"./chunk-OANDYLJQ.js";import{A as R,d as I,i as P,t as _}from"./chunk-FETNQCFO.js";import{f as E}from"./chunk-O6QTXQPJ.js";function re(e,n,t){let r=[],i=[],a=new Map;for(let l of[...e].sort(t)){let s=l.channel??"default",c=n[s]??Number.MAX_SAFE_INTEGER,u=a.get(s)??0;if(u>=c){i.push(l);continue}r.push(l),a.set(s,u+1)}return{selected:r,omitted:i}}function H(e,n,t,r,i=!1){let a=[...e],l=[],s=new Set,c=0;for(;a.length>0&&l.length<n;){let u=a.filter(h=>c+h.evidenceCharacters<=t||i&&l.length===0);if(u.length===0)break;let g=u.filter(h=>h.roles.includes("location")||h.roles.includes("definition")).sort(r);u.sort((h,S)=>N(S,s)-N(h,s)||r(h,S));let p=g[0]??u[0];l.push(p),c+=p.evidenceCharacters;for(let h of $(p))s.add(h.key);a.splice(a.indexOf(p),1)}return{selected:l,omitted:a.sort(r)}}function N(e,n){let t=$(e).reduce((a,l)=>a+(n.has(l.key)?0:l.weight),0),r=Math.max(0,8-e.priority)*20,i=Math.min(500,Math.ceil(e.evidenceCharacters/160));return t+r-i}function $(e){return[...e.reasons.map(X),...e.roles.map(n=>({key:`role:${n}`,weight:Y(n)})),{key:`file:${e.relativePath}`,weight:180},{key:`scope:${J(e.relativePath)}`,weight:120},{key:`kind:${e.fileKind}`,weight:40},...e.symbols.map(n=>({key:`symbol:${n}`,weight:100})),...e.behaviorSignals.map(n=>({key:`behavior:${n}`,weight:70}))]}function X(e){let n=e.indexOf(":"),t=n<0?e:e.slice(0,n);return t==="dependency"||t==="consumer"?{key:`reason:${t}`,weight:220}:{key:`reason:${e}`,weight:t==="location"||t==="definition"?1400:800}}function Y(e){switch(e){case"location":return 1200;case"definition":return 1100;case"reference":return 600;case"caller":case"callee":return 550;case"dependency":case"consumer":return 500;case"search":return 400;default:return 300}}function J(e){let n=e.lastIndexOf("/");return n<0?e:e.slice(0,n)}var j=64,A=12;function de(e,n,t={}){if(n.length===0)throw new Error("The source search pattern must not be empty.");let r=t.context??6;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`context must be a non-negative safe integer; received ${r}`);let i=t.limit??12;if(!Number.isSafeInteger(i)||i<=0)throw new RangeError(`limit must be a positive safe integer; received ${i}`);let a=t.regexp?M(n,"source search pattern",t.ignoreCase?"iu":"u"):null,l=t.ignoreCase?n.toLocaleLowerCase():n,s=K(e,{scope:t.scope}),c=[],u=[];for(let o of s.files){let m=o.relativePath,b=Z(o.text);if(b.length===0)continue;let z=o.freshness.semantic.state!=="stale"&&o.freshness.semantic.basis!=="no-compiler-document"?_(e,m):[],U=E(e,m)?.callables??[],C=0;for(let d=0;d<b.length;d+=1){let x=b[d]??"",w=x.endsWith("\r")?x.slice(0,-1):x;if(!(a?a.test(w):(t.ignoreCase?w.toLocaleLowerCase():w).includes(l)))continue;C+=1;let f=R(z,d),F=Q(U,d),y=f&&!P(f.symbol)?f:null,G=y?.startLine??F?.startLine??f?.startLine??d,q=y?.endLine??F?.endLine??f?.endLine??d,k=B(e,m,d,G,q);c.push({relativePath:m,focusLine:d,ownerSymbol:y?.symbol??null,ownerShort:y?I(y.symbol):F?.name??(f?I(f.symbol):null),ownerStartLine:k.startLine,ownerEndLine:k.endLine,fileKind:O(m),freshness:o.freshness})}C>0&&u.push({relativePath:m,matchingLines:C,returnedMatches:0,freshness:o.freshness})}c.sort(W);let g=c.length>j?D(c,j):c,p=i===Number.MAX_SAFE_INTEGER?c:t.ranking?D(c,i):c.slice(0,i),h=new Map(s.files.map(o=>[o.relativePath,o.text])),S=p.flatMap(o=>{let m=h.get(o.relativePath),b=m===void 0?null:V(o.relativePath,m,o.focusLine,r);return b?[{...b,...o}]:[]}),v=new Map;for(let o of S)v.set(o.relativePath,(v.get(o.relativePath)??0)+1);for(let o of u)o.returnedMatches=v.get(o.relativePath)??0;let T=ee(u);return{pattern:n,mode:t.regexp?"regexp":"literal",identities:c,...g.length<c.length?{identityManifest:g}:{},identityCoverage:{mode:g.length===c.length?"complete":"bounded",returned:g.length,total:c.length,omitted:c.length-g.length},matches:S,matchingLines:c.length,matchingFiles:u.length,omittedMatches:Math.max(0,c.length-S.length),fileCoverage:u,scopeHints:T.slice(0,A),omittedScopeHints:Math.max(0,T.length-A),scannedFiles:s.files.length,textCoverage:{basis:"current-project-text-files",candidateFiles:s.candidateFiles,scannedTextFiles:s.files.length,scannedBytes:s.scannedBytes,skippedBinaryPaths:s.skippedBinaryPaths,skippedUnreadablePaths:s.skippedUnreadablePaths,skippedOversizedPaths:s.skippedOversizedPaths,semanticFiles:{aligned:s.files.filter(o=>o.freshness.semantic.state==="aligned").length,stale:s.files.filter(o=>o.freshness.semantic.state==="stale").length,unavailable:s.files.filter(o=>o.freshness.semantic.state==="unavailable").length}}}}function Q(e,n){return e.filter(t=>t.startLine<=n&&t.endLine>=n).sort((t,r)=>t.endLine-t.startLine-(r.endLine-r.startLine)||t.startLine-r.startLine)[0]??null}function V(e,n,t,r){let i=n.split(`
2
+ `),a=n.endsWith(`
3
+ `)?i.length-1:i.length;if(t<0||t>=a)return null;let l=Math.max(0,t-r),s=Math.min(a-1,t+r);return{relativePath:e,startLine:l,endLine:s,focusLine:t,source:i.slice(l,s+1).join(`
4
+ `)}}function Z(e){if(e.length===0)return[];let n=e.split(`
5
+ `);return e.endsWith(`
6
+ `)&&n.pop(),n}function ee(e){let n=new Map;for(let t of e){let r=ne(t.relativePath),i=n.get(r)??{matchingLines:0,matchingFiles:0};i.matchingLines+=t.matchingLines,i.matchingFiles+=1,n.set(r,i)}return[...n.entries()].map(([t,r])=>({scope:t,...r})).sort((t,r)=>r.matchingLines-t.matchingLines||r.matchingFiles-t.matchingFiles||t.scope.localeCompare(r.scope))}function ne(e){let n=e.lastIndexOf("/");return n<0?e:e.slice(0,n)}function D(e,n){let t=e.map((i,a)=>({...i,priority:L(i.fileKind),sequence:a,evidenceCharacters:1,roles:["search"],reasons:["search"],symbols:i.ownerSymbol?[i.ownerSymbol]:[],behaviorSignals:[]})),r=[];for(let i of[0,1,2]){let a=n-r.length;if(a===0)break;let l=t.filter(s=>L(s.fileKind)===i);r.push(...H(l,a,Number.MAX_SAFE_INTEGER,W).selected)}return r.map(({priority:i,sequence:a,evidenceCharacters:l,roles:s,reasons:c,symbols:u,behaviorSignals:g,...p})=>p)}function W(e,n){return L(e.fileKind)-L(n.fileKind)||+(n.ownerSymbol!==null)-+(e.ownerSymbol!==null)||e.relativePath.localeCompare(n.relativePath)||e.focusLine-n.focusLine}function L(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}export{re as a,H as b,de as c};
7
+ //# sourceMappingURL=chunk-CQP3THUZ.js.map