scip-query 0.22.0 → 0.24.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 (470) hide show
  1. package/CHANGELOG.md +500 -0
  2. package/README.md +13 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-H3P6BR5G.js +2 -0
  5. package/dist/call-graph-VTG2CUOQ.js +2 -0
  6. package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
  7. package/dist/chunk-2BMSSRBH.js +2 -0
  8. package/dist/{chunk-TAYD3AE7.js → chunk-2GJSD5GY.js} +2 -2
  9. package/dist/{chunk-TUQIPUDS.js → chunk-2M2LSIMY.js} +3 -3
  10. package/dist/{chunk-GIQ6CSL4.js → chunk-2N6WBNDC.js} +2 -2
  11. package/dist/{chunk-JHH5SCZ3.js → chunk-2OOY75BW.js} +2 -2
  12. package/dist/{chunk-EELPBR7E.js → chunk-2USA3S3P.js} +2 -2
  13. package/dist/chunk-2VAHDDLM.js +133 -0
  14. package/dist/chunk-2XWIUW5Z.js +455 -0
  15. package/dist/{chunk-57N6LN2A.js → chunk-3AF4TUFK.js} +2 -2
  16. package/dist/chunk-3D4BOXW6.js +20 -0
  17. package/dist/{chunk-FFJQZG6J.js → chunk-3LO4FST5.js} +2 -2
  18. package/dist/{chunk-HXOU4XNH.js → chunk-3WTY4LP2.js} +2 -2
  19. package/dist/{chunk-DPWKKNKI.js → chunk-3Z5AMSK6.js} +2 -2
  20. package/dist/{chunk-F24G5NBE.js → chunk-44IETFOU.js} +2 -2
  21. package/dist/chunk-4FR6GQIT.js +2 -0
  22. package/dist/chunk-4KBTHJLP.js +2 -0
  23. package/dist/chunk-5BIKR67W.js +2 -0
  24. package/dist/{chunk-DJAO2OZJ.js → chunk-5PROPLHI.js} +2 -2
  25. package/dist/chunk-5V7EPTII.js +2 -0
  26. package/dist/{chunk-VZ7NXSHV.js → chunk-62LPZCBQ.js} +2 -2
  27. package/dist/{chunk-LXQUF2RP.js → chunk-64O2JHQA.js} +2 -2
  28. package/dist/chunk-6D4F5VWG.js +10 -0
  29. package/dist/{chunk-NEIQPFBI.js → chunk-6ERFBC3X.js} +2 -2
  30. package/dist/{chunk-4HE7MVWD.js → chunk-6ILKOOGH.js} +2 -2
  31. package/dist/chunk-6MFXCMZC.js +2 -0
  32. package/dist/chunk-6O7FACKB.js +2 -0
  33. package/dist/{chunk-R6M456QG.js → chunk-6TS3KOXR.js} +2 -2
  34. package/dist/{chunk-7U2YQSDE.js → chunk-76QOU4PK.js} +2 -2
  35. package/dist/{chunk-25GWKRUZ.js → chunk-7DUI77BN.js} +2 -2
  36. package/dist/chunk-7F45LJKI.js +2 -0
  37. package/dist/{chunk-DEAB5TGT.js → chunk-7F7T6DCR.js} +2 -2
  38. package/dist/chunk-7H6VHWWJ.js +2 -0
  39. package/dist/chunk-7HXT6YLU.js +5 -0
  40. package/dist/{chunk-KZYID5KV.js → chunk-7R4V5ES6.js} +4 -4
  41. package/dist/chunk-7RIRIADH.js +7 -0
  42. package/dist/chunk-7ZLWLOGT.js +2 -0
  43. package/dist/{chunk-WHADK6OS.js → chunk-A4WEAK35.js} +2 -2
  44. package/dist/chunk-AADQLOQ4.js +38 -0
  45. package/dist/{chunk-XFMVKFSF.js → chunk-AN76MGUE.js} +2 -2
  46. package/dist/chunk-ANLNLY66.js +2 -0
  47. package/dist/chunk-ATXPTSEI.js +81 -0
  48. package/dist/{chunk-EELG7D3Q.js → chunk-AX7IDVFT.js} +2 -2
  49. package/dist/chunk-B3PYOSCX.js +2 -0
  50. package/dist/chunk-B7MPDEAK.js +3 -0
  51. package/dist/chunk-BBB5FBX4.js +2 -0
  52. package/dist/{chunk-Y2VM4CJC.js → chunk-BHKK5RJY.js} +2 -2
  53. package/dist/chunk-BJWFVAA5.js +2 -0
  54. package/dist/chunk-BKVWUP7Y.js +2 -0
  55. package/dist/{chunk-7XA3OM44.js → chunk-BKZYTLGE.js} +2 -2
  56. package/dist/chunk-BL6DCHQP.js +2 -0
  57. package/dist/chunk-BOW7SSQH.js +43 -0
  58. package/dist/{chunk-KQHJEU6V.js → chunk-C4RHHCKL.js} +2 -2
  59. package/dist/chunk-C7C6AKAT.js +117 -0
  60. package/dist/chunk-CD6M6LS2.js +16 -0
  61. package/dist/chunk-CFE6PSG6.js +2 -0
  62. package/dist/{chunk-GPGRZJ3R.js → chunk-CFNIGQMT.js} +2 -2
  63. package/dist/{chunk-K3XFWJI2.js → chunk-CKBUBRYD.js} +2 -2
  64. package/dist/chunk-CZW5MZ5B.js +2 -0
  65. package/dist/chunk-DBBZ63ZX.js +2 -0
  66. package/dist/chunk-DBN7DMJB.js +18 -0
  67. package/dist/{chunk-CKRWA452.js → chunk-DUULLZHZ.js} +2 -2
  68. package/dist/{chunk-6HRZQLOI.js → chunk-DV5Y5NOS.js} +2 -2
  69. package/dist/chunk-DZOIKCTM.js +3 -0
  70. package/dist/chunk-E4PKTOL3.js +2 -0
  71. package/dist/{chunk-GVOMSPGL.js → chunk-E65ELFKU.js} +2 -2
  72. package/dist/{chunk-VXJJTQYE.js → chunk-E7QR35ST.js} +2 -2
  73. package/dist/{chunk-2RE5OCHZ.js → chunk-EFSXAINW.js} +2 -2
  74. package/dist/{chunk-GY7CCCEZ.js → chunk-EHVEIEQN.js} +2 -2
  75. package/dist/{chunk-BVFYEEBH.js → chunk-EHYDXE3Z.js} +2 -2
  76. package/dist/{chunk-HISEUIL2.js → chunk-EP63Y6LD.js} +2 -2
  77. package/dist/chunk-EPX6NQN6.js +4 -0
  78. package/dist/chunk-ETC674NS.js +5 -0
  79. package/dist/{chunk-5H5WTJSD.js → chunk-F5GSBHC6.js} +2 -2
  80. package/dist/chunk-FH3DGXC6.js +2 -0
  81. package/dist/{chunk-2XCGSDIT.js → chunk-FI7VGOR4.js} +2 -2
  82. package/dist/chunk-FJF6VO2P.js +2 -0
  83. package/dist/{chunk-FELGD32K.js → chunk-FLMTCX5R.js} +2 -2
  84. package/dist/chunk-FVFDOIM3.js +2 -0
  85. package/dist/{chunk-AQ2PORIO.js → chunk-G2HU5WRN.js} +2 -2
  86. package/dist/{chunk-7YQOCABQ.js → chunk-G4ALYS4J.js} +2 -2
  87. package/dist/{chunk-SWK4XPUS.js → chunk-G56I7K4W.js} +2 -2
  88. package/dist/{chunk-JFQBRL3J.js → chunk-GC4DG2V5.js} +2 -2
  89. package/dist/chunk-GG45PK4S.js +4 -0
  90. package/dist/{chunk-XN22RGSR.js → chunk-GHNPACNP.js} +2 -2
  91. package/dist/{chunk-XU75YQN4.js → chunk-GINH3YQU.js} +2 -2
  92. package/dist/chunk-GTZZVLKJ.js +2 -0
  93. package/dist/chunk-GXXW5ZHH.js +2 -0
  94. package/dist/{chunk-RNKPYYYE.js → chunk-HAXXKRTD.js} +2 -2
  95. package/dist/chunk-HEZWBAZY.js +2 -0
  96. package/dist/chunk-HMEWLMML.js +2 -0
  97. package/dist/{chunk-2KVU55CW.js → chunk-HOBOVYPO.js} +2 -2
  98. package/dist/{chunk-2YC7YNKT.js → chunk-HRFQ6GW5.js} +2 -2
  99. package/dist/{chunk-RYOYJMGF.js → chunk-HX4X7KG3.js} +2 -2
  100. package/dist/{chunk-AZS7YPCB.js → chunk-HYT2R7LX.js} +2 -2
  101. package/dist/chunk-IKQVBVQL.js +40 -0
  102. package/dist/chunk-J6GLBBRK.js +4 -0
  103. package/dist/{chunk-TNG2FYS5.js → chunk-J7A4PWFX.js} +2 -2
  104. package/dist/chunk-JCSAZ35V.js +2 -0
  105. package/dist/{chunk-EWWY2ZFL.js → chunk-JDU2IV3A.js} +2 -2
  106. package/dist/{chunk-SB25YMEQ.js → chunk-JFMEXGFE.js} +2 -2
  107. package/dist/chunk-JFMI5SGB.js +4 -0
  108. package/dist/chunk-JJP37RGX.js +57 -0
  109. package/dist/chunk-JZ2A7LDM.js +5 -0
  110. package/dist/chunk-KNLQGXVH.js +80 -0
  111. package/dist/chunk-KVQCECPR.js +2 -0
  112. package/dist/{chunk-F24QUEQP.js → chunk-KXXORBZ2.js} +2 -2
  113. package/dist/{chunk-IKVNEGTW.js → chunk-L5KYH6U3.js} +2 -2
  114. package/dist/chunk-L6XHYJPZ.js +21 -0
  115. package/dist/chunk-L7KTFEAV.js +43 -0
  116. package/dist/{chunk-UAQ4T73O.js → chunk-LDXHR5EL.js} +2 -2
  117. package/dist/chunk-LEECKFCJ.js +2 -0
  118. package/dist/{chunk-LO5JSW2C.js → chunk-MHGDSBFX.js} +2 -2
  119. package/dist/{chunk-JUN5DOAK.js → chunk-MLQVVDG3.js} +2 -2
  120. package/dist/chunk-MOKUWRHO.js +3 -0
  121. package/dist/{chunk-44T4DUAA.js → chunk-MPYAPMNE.js} +2 -2
  122. package/dist/{chunk-ARVO6TTW.js → chunk-MV6SPXCR.js} +2 -2
  123. package/dist/{chunk-NRBNAECH.js → chunk-MWN53KRN.js} +2 -2
  124. package/dist/{chunk-TH6IC56G.js → chunk-MZPXPSUJ.js} +2 -2
  125. package/dist/{chunk-FBCVASUG.js → chunk-N55KIE46.js} +2 -2
  126. package/dist/{chunk-VMWUV6WB.js → chunk-NB4D3BNM.js} +2 -2
  127. package/dist/{chunk-JAT6C3VX.js → chunk-NGKBOT6G.js} +2 -2
  128. package/dist/{chunk-Q6T2CAJL.js → chunk-NJGKXKQF.js} +2 -2
  129. package/dist/chunk-NJQISBL4.js +8 -0
  130. package/dist/chunk-NJT3ZEKY.js +16 -0
  131. package/dist/{chunk-KFVSJX25.js → chunk-NKMKZP6A.js} +2 -2
  132. package/dist/chunk-NODFZ6ED.js +2 -0
  133. package/dist/{chunk-ERCYGVAM.js → chunk-NSM5IEVW.js} +2 -2
  134. package/dist/{chunk-YAGYMBEX.js → chunk-NTGUVNR2.js} +2 -2
  135. package/dist/{chunk-N7FP5H5U.js → chunk-NU3KFF2O.js} +8 -8
  136. package/dist/chunk-NWLVNU66.js +557 -0
  137. package/dist/{chunk-Q55NF3ZG.js → chunk-NYKZMCRC.js} +2 -2
  138. package/dist/{chunk-I6UTXNHU.js → chunk-O6BUXZEH.js} +2 -2
  139. package/dist/chunk-ODPDP7A4.js +3 -0
  140. package/dist/{chunk-ZAZGGSM3.js → chunk-OHIV323X.js} +2 -2
  141. package/dist/chunk-OIAPEKMT.js +3 -0
  142. package/dist/chunk-OIOC5EHF.js +3 -0
  143. package/dist/{chunk-YIHNPKWD.js → chunk-ONPPQM4G.js} +2 -2
  144. package/dist/{chunk-RHHCLWQ6.js → chunk-OUHEZBYI.js} +2 -2
  145. package/dist/{chunk-MSR2QRUE.js → chunk-OVGYW7UD.js} +2 -2
  146. package/dist/{chunk-OPSAW5DT.js → chunk-OYKU4B3Y.js} +2 -2
  147. package/dist/{chunk-5YRQIE2B.js → chunk-POBJ6FR2.js} +2 -2
  148. package/dist/{chunk-ZGW4HLPD.js → chunk-PSZPMMWN.js} +2 -2
  149. package/dist/chunk-PXTRBKRK.js +3 -0
  150. package/dist/{chunk-U2N2KE7A.js → chunk-Q5JRIHT3.js} +2 -2
  151. package/dist/{chunk-GRX7JOXQ.js → chunk-Q7ATHARX.js} +2 -2
  152. package/dist/{chunk-5ZMBRQFC.js → chunk-Q7CSKIDM.js} +2 -2
  153. package/dist/{chunk-HG722PO7.js → chunk-QBQE7ZJ5.js} +2 -2
  154. package/dist/{chunk-Z2PZVKPR.js → chunk-QH22UIXP.js} +2 -2
  155. package/dist/chunk-QXCKQTKR.js +60 -0
  156. package/dist/chunk-RBAD4GJ2.js +13 -0
  157. package/dist/chunk-RMDPFPNW.js +2 -0
  158. package/dist/chunk-ROPJDEJZ.js +4 -0
  159. package/dist/{chunk-56NQAEPJ.js → chunk-RVZC6TJE.js} +2 -2
  160. package/dist/{chunk-XJX6LGHL.js → chunk-S4QZBKSR.js} +2 -2
  161. package/dist/chunk-SCPMZ73U.js +2 -0
  162. package/dist/{chunk-7IQXARSQ.js → chunk-SIAP5RGI.js} +2 -2
  163. package/dist/{chunk-4TQU4TX2.js → chunk-SIX4RFR3.js} +2 -2
  164. package/dist/{chunk-AYPDH2LU.js → chunk-SKKXTABJ.js} +2 -2
  165. package/dist/{chunk-ZYM4HOFA.js → chunk-SSRFUQBD.js} +2 -2
  166. package/dist/chunk-SYVJEEUJ.js +3 -0
  167. package/dist/chunk-T3CZAZSI.js +8 -0
  168. package/dist/chunk-T3I6NHBH.js +2 -0
  169. package/dist/{chunk-GDRJB3SB.js → chunk-T6DWDI5E.js} +2 -2
  170. package/dist/chunk-T6HRIROJ.js +7 -0
  171. package/dist/{chunk-OTSPRVNW.js → chunk-TAA7HXHE.js} +2 -2
  172. package/dist/{chunk-IJMD6BRI.js → chunk-TJ2JQYT3.js} +2 -2
  173. package/dist/chunk-TULNMD5T.js +368 -0
  174. package/dist/chunk-U2FPY5XA.js +3 -0
  175. package/dist/chunk-U3SXIMII.js +38 -0
  176. package/dist/{chunk-ENWQWA2R.js → chunk-U6KCHXJ4.js} +2 -2
  177. package/dist/chunk-UH3XSKS5.js +9 -0
  178. package/dist/{chunk-UDY7MIAW.js → chunk-UIFUZVCC.js} +2 -2
  179. package/dist/{chunk-BDGTPN27.js → chunk-UXKURIVI.js} +2 -2
  180. package/dist/{chunk-FGNCOQUX.js → chunk-V2RBODHL.js} +2 -2
  181. package/dist/chunk-VBKUWB6N.js +2 -0
  182. package/dist/{chunk-PIFTZEEM.js → chunk-VBV6ALJE.js} +2 -2
  183. package/dist/{chunk-2OXVP5U5.js → chunk-VDGFWCQV.js} +2 -2
  184. package/dist/chunk-VDSDOEWF.js +2 -0
  185. package/dist/{chunk-C76O5MDS.js → chunk-VZPWVCLN.js} +2 -2
  186. package/dist/chunk-WDSFQDPN.js +2 -0
  187. package/dist/{chunk-BTVKZGWT.js → chunk-WFA35BGR.js} +2 -2
  188. package/dist/{chunk-H7CG6LOE.js → chunk-WLMP3OCW.js} +2 -2
  189. package/dist/{chunk-WOOAY3PA.js → chunk-WSA52GOR.js} +2 -2
  190. package/dist/chunk-WYPL7GF7.js +2 -0
  191. package/dist/{chunk-RDULNRSJ.js → chunk-X3YVZAKZ.js} +2 -2
  192. package/dist/chunk-X6OGVFIT.js +2 -0
  193. package/dist/{chunk-ISWFRGJ6.js → chunk-XKXTR6ZI.js} +2 -2
  194. package/dist/chunk-Y5DFAW5W.js +4 -0
  195. package/dist/chunk-YSYPDRD5.js +3 -0
  196. package/dist/chunk-ZFVPWH62.js +5 -0
  197. package/dist/chunk-ZGIHTH27.js +2 -0
  198. package/dist/{chunk-QKT4UI2Y.js → chunk-ZGIQN2SX.js} +2 -2
  199. package/dist/chunk-ZHG4WAHR.js +12 -0
  200. package/dist/{chunk-CLG6DWVS.js → chunk-ZKB2XUEN.js} +2 -2
  201. package/dist/chunk-ZLMXIQLC.js +21 -0
  202. package/dist/chunk-ZMCQIHI4.js +2 -0
  203. package/dist/cli-main.js +2 -2
  204. package/dist/code-TAVIKWJI.js +2 -0
  205. package/dist/code-result-json-5FEFQCAQ.js +2 -0
  206. package/dist/command-descriptors-7BKH53Y3.js +343 -0
  207. package/dist/dataflow-GFBTVDH3.js +2 -0
  208. package/dist/dependence-slice-GWGQCODG.js +2 -0
  209. package/dist/deps-4QHVDPYA.js +2 -0
  210. package/dist/direct-navigation-4UBC6HNW.js +3 -0
  211. package/dist/entry-map-QCTF4RVY.js +2 -0
  212. package/dist/files-M2UBF5HJ.js +2 -0
  213. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  214. package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
  215. package/dist/hierarchy-2UIHRLW4.js +2 -0
  216. package/dist/imports-WIE3YZOB.js +2 -0
  217. package/dist/index.d.ts +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/members-YKD636DA.js +2 -0
  220. package/dist/methods-VDF4IMYG.js +2 -0
  221. package/dist/output-continuation-command-4UMDOOLO.js +3 -0
  222. package/dist/output-pagination-2GME6OPY.js +19 -0
  223. package/dist/postinstall.js +1 -1
  224. package/dist/project-reindex-XEQTRCV5.js +3 -0
  225. package/dist/queries/affected.js +1 -1
  226. package/dist/queries/anchors.d.ts +1 -1
  227. package/dist/queries/anchors.js +1 -1
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +2 -0
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.js +1 -1
  234. package/dist/queries/cleanup-plan.js +1 -1
  235. package/dist/queries/co-change.d.ts +20 -2
  236. package/dist/queries/co-change.js +1 -1
  237. package/dist/queries/code.js +1 -1
  238. package/dist/queries/complexity-hotspots.js +1 -1
  239. package/dist/queries/complexity.js +1 -1
  240. package/dist/queries/context.js +1 -1
  241. package/dist/queries/convergence.js +1 -1
  242. package/dist/queries/coupling.js +1 -1
  243. package/dist/queries/cycles.js +1 -1
  244. package/dist/queries/dataflow.js +1 -1
  245. package/dist/queries/dead.d.ts +2 -0
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/deep-chains.js +1 -1
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.js +1 -1
  251. package/dist/queries/deps.js +1 -1
  252. package/dist/queries/diff-impact.d.ts +9 -0
  253. package/dist/queries/diff-impact.js +1 -1
  254. package/dist/queries/doc-drift.js +1 -1
  255. package/dist/queries/drift.js +1 -1
  256. package/dist/queries/duplicate-bodies.d.ts +28 -1
  257. package/dist/queries/duplicate-bodies.js +1 -1
  258. package/dist/queries/entry-map.d.ts +1 -1
  259. package/dist/queries/entry-map.js +1 -1
  260. package/dist/queries/evidence.js +1 -1
  261. package/dist/queries/extract-candidates.d.ts +50 -23
  262. package/dist/queries/extract-candidates.js +1 -1
  263. package/dist/queries/fan.js +1 -1
  264. package/dist/queries/files.js +1 -1
  265. package/dist/queries/health.d.ts +1 -1
  266. package/dist/queries/health.js +1 -1
  267. package/dist/queries/hierarchy.js +1 -1
  268. package/dist/queries/hotspots.js +1 -1
  269. package/dist/queries/imports.js +1 -1
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +4 -3
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.js +1 -1
  274. package/dist/queries/locality-candidates.js +1 -1
  275. package/dist/queries/members.js +1 -1
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.js +1 -1
  278. package/dist/queries/outline.js +1 -1
  279. package/dist/queries/passthrough-candidates.d.ts +9 -1
  280. package/dist/queries/passthrough-candidates.js +1 -1
  281. package/dist/queries/plan-context.js +1 -1
  282. package/dist/queries/react-component-duplicates.d.ts +19 -3
  283. package/dist/queries/react-component-duplicates.js +1 -1
  284. package/dist/queries/react-hook-candidates.d.ts +22 -3
  285. package/dist/queries/react-hook-candidates.js +1 -1
  286. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  287. package/dist/queries/react-large-component-pressure.js +1 -1
  288. package/dist/queries/recent-duplicates.js +1 -1
  289. package/dist/queries/redundant-reexports.js +1 -1
  290. package/dist/queries/reference-neighborhood.js +1 -1
  291. package/dist/queries/reference-reachability.js +1 -1
  292. package/dist/queries/refs.js +1 -1
  293. package/dist/queries/self-audit.d.ts +7 -1
  294. package/dist/queries/self-audit.js +1 -1
  295. package/dist/queries/similar-chains.js +1 -1
  296. package/dist/queries/similar-files.js +1 -1
  297. package/dist/queries/similar-signatures.js +1 -1
  298. package/dist/queries/similar.js +1 -1
  299. package/dist/queries/slice.js +1 -1
  300. package/dist/queries/source-inspection.js +1 -1
  301. package/dist/queries/source-search.js +1 -1
  302. package/dist/queries/stale-abstractions.js +1 -1
  303. package/dist/queries/surface.js +1 -1
  304. package/dist/queries/symbols.js +1 -1
  305. package/dist/queries/system-map.d.ts +1 -1
  306. package/dist/queries/system-map.js +1 -1
  307. package/dist/queries/system.js +1 -1
  308. package/dist/queries/test-quality.js +1 -1
  309. package/dist/queries/trace.js +1 -1
  310. package/dist/queries/twin-ab.js +1 -1
  311. package/dist/queries/twin-drift.d.ts +22 -6
  312. package/dist/queries/twin-drift.js +1 -1
  313. package/dist/queries/unused-imports.js +1 -1
  314. package/dist/queries/unused-params.js +1 -1
  315. package/dist/queries/value-flow.js +1 -1
  316. package/dist/queries/vue-component-duplicates.js +1 -1
  317. package/dist/queries/vue-composable-candidates.js +1 -1
  318. package/dist/queries/vue-large-view-pressure.js +1 -1
  319. package/dist/queries/wrapper-candidates.d.ts +16 -1
  320. package/dist/queries/wrapper-candidates.js +1 -1
  321. package/dist/query-service-fastpath.js +5 -5
  322. package/dist/query-service-server.js +3 -3
  323. package/dist/refs-JNK5CLM7.js +2 -0
  324. package/dist/refs-pagination-6BLRYGMV.js +2 -0
  325. package/dist/reindex-worker.js +25 -25
  326. package/dist/reindex.d.ts +3 -2
  327. package/dist/reindex.js +35 -35
  328. package/dist/runtime.d.ts +34 -2
  329. package/dist/runtime.js +4 -4
  330. package/dist/rust-semantic-session-server.js +1 -1
  331. package/dist/rust-semantic-session-worker.js +1 -1
  332. package/dist/rust-semantic-worker.js +1 -1
  333. package/dist/{scip-cli-H-n59izO.d.ts → scip-cli-DOerTq-R.d.ts} +42 -4
  334. package/dist/slice-PHPVNCWX.js +2 -0
  335. package/dist/surface-MQX5MPIV.js +2 -0
  336. package/dist/symbol-resolution-DBLVXLBC.js +2 -0
  337. package/dist/system-JOPKV4OG.js +2 -0
  338. package/dist/trace-I2P2YFH4.js +2 -0
  339. package/dist/typescript-mailbox-worker.js +1 -1
  340. package/dist/value-flow-JJVMF7NP.js +2 -0
  341. package/dist/watch-server.js +3 -3
  342. package/docs/COMMAND_REFERENCE.md +2 -2
  343. package/docs/DETECTOR_GUIDE.md +51 -12
  344. package/docs/accuracy-audit-checklist.md +36 -13
  345. package/docs/locality-analyzer-design.md +9 -9
  346. package/package.json +2 -2
  347. package/skills/conductor/SKILL.md +110 -0
  348. package/skills/conductor/agents/openai.yaml +4 -0
  349. package/skills/principal-maintainability-review/SKILL.md +273 -0
  350. package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
  351. package/skills/scip-calibrate/SKILL.md +102 -0
  352. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  353. package/skills/scip-claim-audit/SKILL.md +113 -0
  354. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  355. package/skills/scip-probe-reachability/SKILL.md +93 -0
  356. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  357. package/skills/scip-root-cause/SKILL.md +160 -0
  358. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  359. package/skills/scip-system-compression/SKILL.md +252 -0
  360. package/skills/scip-system-compression/agents/openai.yaml +4 -0
  361. package/skills/scip-system-compression/references/compression-atlas.md +116 -0
  362. package/skills/scip-system-compression/references/compression-patterns.md +87 -0
  363. package/skills/scip-twin-drift/SKILL.md +109 -0
  364. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  365. package/dist/by-kind-4IYG2SKW.js +0 -2
  366. package/dist/call-graph-WQNXMNNN.js +0 -2
  367. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  368. package/dist/chunk-2BTJALUS.js +0 -454
  369. package/dist/chunk-3QXC54FQ.js +0 -3
  370. package/dist/chunk-3TJY6M3B.js +0 -7
  371. package/dist/chunk-42W3LFUK.js +0 -13
  372. package/dist/chunk-4GAQ6FI4.js +0 -43
  373. package/dist/chunk-6NC3YSPY.js +0 -38
  374. package/dist/chunk-6VEFRPTD.js +0 -5
  375. package/dist/chunk-7C26EKLZ.js +0 -4
  376. package/dist/chunk-7JYHQAH2.js +0 -22
  377. package/dist/chunk-7KSO2OAP.js +0 -2
  378. package/dist/chunk-7XZGZBSQ.js +0 -2
  379. package/dist/chunk-A77SCPW2.js +0 -3
  380. package/dist/chunk-AK3PYTIK.js +0 -5
  381. package/dist/chunk-AMIMMNA4.js +0 -11
  382. package/dist/chunk-AUY5BL74.js +0 -2
  383. package/dist/chunk-BDHFVH2M.js +0 -18
  384. package/dist/chunk-BECZLYNU.js +0 -8
  385. package/dist/chunk-BUTEIZKP.js +0 -10
  386. package/dist/chunk-BWVQP3LB.js +0 -38
  387. package/dist/chunk-BYDAFMSR.js +0 -57
  388. package/dist/chunk-BZYSGZRK.js +0 -2
  389. package/dist/chunk-C7IJMOFP.js +0 -134
  390. package/dist/chunk-CBBHFNLX.js +0 -2
  391. package/dist/chunk-D2MVJSP4.js +0 -21
  392. package/dist/chunk-D35XIZGN.js +0 -2
  393. package/dist/chunk-DKM723YF.js +0 -79
  394. package/dist/chunk-DRENNWRG.js +0 -2
  395. package/dist/chunk-E44IVWIJ.js +0 -367
  396. package/dist/chunk-EDMB6SSO.js +0 -7
  397. package/dist/chunk-EETGXQY7.js +0 -3
  398. package/dist/chunk-FKGQOTKD.js +0 -2
  399. package/dist/chunk-GH5YSGZL.js +0 -5
  400. package/dist/chunk-GQIDEID3.js +0 -2
  401. package/dist/chunk-HCVJR2V4.js +0 -3
  402. package/dist/chunk-IMKZEXZG.js +0 -2
  403. package/dist/chunk-ISIQLPJ2.js +0 -61
  404. package/dist/chunk-IXESDH3J.js +0 -2
  405. package/dist/chunk-JJ62MTQH.js +0 -40
  406. package/dist/chunk-JT6XX7QY.js +0 -8
  407. package/dist/chunk-KFOYCQAJ.js +0 -9
  408. package/dist/chunk-LRI5OMPE.js +0 -2
  409. package/dist/chunk-MHIEP7EG.js +0 -4
  410. package/dist/chunk-NK3JMP22.js +0 -2
  411. package/dist/chunk-NVSZNESQ.js +0 -2
  412. package/dist/chunk-OJNK5ALA.js +0 -2
  413. package/dist/chunk-OXYAWIEA.js +0 -2
  414. package/dist/chunk-OZETODHH.js +0 -2
  415. package/dist/chunk-PBUH2P5S.js +0 -3
  416. package/dist/chunk-PLJUQFQN.js +0 -2
  417. package/dist/chunk-PLYUVM4F.js +0 -2
  418. package/dist/chunk-PXXYQK55.js +0 -2
  419. package/dist/chunk-Q5TA4OY4.js +0 -20
  420. package/dist/chunk-Q7GBK5T7.js +0 -81
  421. package/dist/chunk-QLBSG7U5.js +0 -3
  422. package/dist/chunk-QWKHW6VZ.js +0 -2
  423. package/dist/chunk-RPL3ARU7.js +0 -16
  424. package/dist/chunk-SVHTMVA4.js +0 -4
  425. package/dist/chunk-T6QD2ZQB.js +0 -43
  426. package/dist/chunk-TD7VKJ2Y.js +0 -117
  427. package/dist/chunk-TKDNDQA7.js +0 -3
  428. package/dist/chunk-TQZV7KV4.js +0 -2
  429. package/dist/chunk-TUSPIVZ3.js +0 -4
  430. package/dist/chunk-URSGGIZX.js +0 -2
  431. package/dist/chunk-UT7TADJX.js +0 -2
  432. package/dist/chunk-V4NG5OMS.js +0 -554
  433. package/dist/chunk-VTCIYFEK.js +0 -2
  434. package/dist/chunk-VU6LIWHT.js +0 -2
  435. package/dist/chunk-VUSKPCUB.js +0 -2
  436. package/dist/chunk-WN3TCGJ4.js +0 -2
  437. package/dist/chunk-WSLEJSFR.js +0 -2
  438. package/dist/chunk-WYZIHUPZ.js +0 -16
  439. package/dist/chunk-XE33FV5W.js +0 -2
  440. package/dist/chunk-XGGBK66W.js +0 -4
  441. package/dist/chunk-XSWYJCAK.js +0 -2
  442. package/dist/chunk-Y334QQU5.js +0 -3
  443. package/dist/chunk-Z2AWCTN6.js +0 -2
  444. package/dist/chunk-ZOXKSQQB.js +0 -2
  445. package/dist/chunk-ZPASRBLF.js +0 -2
  446. package/dist/chunk-ZZ3Z7D56.js +0 -2
  447. package/dist/code-EQJFDT6I.js +0 -2
  448. package/dist/code-result-json-7UWIWBOO.js +0 -2
  449. package/dist/command-descriptors-ORNTVNYV.js +0 -342
  450. package/dist/dataflow-6VL54GX5.js +0 -2
  451. package/dist/dependence-slice-DT2NUHD2.js +0 -2
  452. package/dist/deps-DB7H5IKC.js +0 -2
  453. package/dist/direct-navigation-O3LUAYWQ.js +0 -3
  454. package/dist/entry-map-6K62RV3D.js +0 -2
  455. package/dist/files-MSLD7MO6.js +0 -2
  456. package/dist/hierarchy-IVBXAKFA.js +0 -2
  457. package/dist/imports-FRAVZ3Y2.js +0 -2
  458. package/dist/members-KJOJDYGO.js +0 -2
  459. package/dist/methods-2AYABBT3.js +0 -2
  460. package/dist/output-continuation-command-JHMPH6NC.js +0 -3
  461. package/dist/output-pagination-3OFL2MJV.js +0 -19
  462. package/dist/project-reindex-HYO4WD7Z.js +0 -3
  463. package/dist/refs-ARMA6XUJ.js +0 -2
  464. package/dist/refs-pagination-VUGIWN6U.js +0 -2
  465. package/dist/slice-YOB5YFAM.js +0 -2
  466. package/dist/surface-VY5EFWTW.js +0 -2
  467. package/dist/symbol-resolution-DGQN4XIV.js +0 -2
  468. package/dist/system-2KQ3QD2P.js +0 -2
  469. package/dist/trace-HTIPTXAE.js +0 -2
  470. package/dist/value-flow-5FV3VQI7.js +0 -2
@@ -1,4 +1,4 @@
1
- import{d as z}from"./chunk-KK7GPALL.js";import{d as y}from"./chunk-5H5WTJSD.js";import{A as $,c as E,e as b,t as O}from"./chunk-TD7VKJ2Y.js";import{a as A,b as F,m as L,x as R}from"./chunk-42W3LFUK.js";import{N as v,z as T}from"./chunk-7JYHQAH2.js";import{B as p,c as h,d as k}from"./chunk-Q7GBK5T7.js";import{b as P,d as g}from"./chunk-GH5YSGZL.js";function _(e,n,t,r={}){if(!t)return[];let i=p(e,n);return i?i.indexOf(t)===-1?[]:(N(e,n).get(t)??[]).filter(s=>!X(s,r)):[]}function X(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var q=h("file-identifiers",{clearGroups:["whole-project","source-file"]});function B(e,n){let t=L(e,n);return t?t.fileIdentifiers:q.get(e,n,()=>new Set(N(e,n).keys()))}var K=h("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,n){let t=L(e,n);return t?t.identifierLineMap:K.get(e,n,()=>ee(e,n))}var Q=h("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function Re(e,n){let t=L(e,n);return t?t.identifiersByLine:Q.get(e,n,()=>{let r=N(e,n),i=0;for(let s of r.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of r)for(let a of c)o[a].add(s);return o})}function ee(e,n){let t=new Map,r=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=p(e,n);if(!i)return t;let o=F(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&r(l[1],c)}return t}function we(e,n){let t=j(e);return t?n.filter(r=>j(r.file)===t):n}function De(e,n,t,r,i){let o=R(e,n);if(r){let f=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!f)return null;let d=new Set(o.filter(u=>u.localName===f||u.importedName===f).map(u=>u.sourcePath).filter(u=>!!u));for(let u of t)for(let S of d)if(g(S,u.file))return u;if(f==="this"||f==="self"||f==="cls"){let u=t.filter(S=>S.file===n&&E(S.symbol)!==null);if(u.length===1)return u[0]}let m=te(p(e,n)??"",f);if(m.size===0)return null;let V=new Set(o.filter(u=>m.has(u.localName??u.importedName)).map(u=>u.sourcePath).filter(u=>!!u)),D=t.filter(u=>m.has(E(u.symbol)??"")&&(u.file===n||[...V].some(S=>g(S,u.file))));return D.length===1?D[0]:null}let s=t.filter(f=>E(f.symbol)===null),c=s.find(f=>f.file===n);if(c)return c;let a=b(t[0].symbol),l=o.filter(f=>f.kind!=="namespace"&&f.kind!=="side-effect"&&(f.localName===a||f.localName===null&&f.importedName===a));if(l.length>0){let f=s.filter(d=>l.some(m=>m.sourcePath!==null&&g(m.sourcePath,d.file)));return f.length===1?f[0]:null}return s.length===1?s[0]:null}function te(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function j(e){let n=T(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var ne=k("global-leaf-index",{clearGroups:["whole-project"]});function M(e){return ne.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
1
+ import{d as z}from"./chunk-KK7GPALL.js";import{d as y}from"./chunk-F5GSBHC6.js";import{C as $,c as E,e as b,v as O}from"./chunk-C7C6AKAT.js";import{a as A,b as F,n as L,y as R}from"./chunk-RBAD4GJ2.js";import{A as T,O as v}from"./chunk-ZLMXIQLC.js";import{h as p}from"./chunk-ETC674NS.js";import{c as h,d as k}from"./chunk-KNLQGXVH.js";import{b as P,d as g}from"./chunk-JZ2A7LDM.js";function _(e,n,t,r={}){if(!t)return[];let i=p(e,n);return i?i.indexOf(t)===-1?[]:(N(e,n).get(t)??[]).filter(s=>!X(s,r)):[]}function X(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var q=h("file-identifiers",{clearGroups:["whole-project","source-file"]});function B(e,n){let t=L(e,n);return t?t.fileIdentifiers:q.get(e,n,()=>new Set(N(e,n).keys()))}var K=h("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,n){let t=L(e,n);return t?t.identifierLineMap:K.get(e,n,()=>ee(e,n))}var Q=h("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function Re(e,n){let t=L(e,n);return t?t.identifiersByLine:Q.get(e,n,()=>{let r=N(e,n),i=0;for(let s of r.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of r)for(let a of c)o[a].add(s);return o})}function ee(e,n){let t=new Map,r=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=p(e,n);if(!i)return t;let o=F(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&r(l[1],c)}return t}function we(e,n){let t=j(e);return t?n.filter(r=>j(r.file)===t):n}function De(e,n,t,r,i){let o=R(e,n);if(r){let f=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!f)return null;let d=new Set(o.filter(u=>u.localName===f||u.importedName===f).map(u=>u.sourcePath).filter(u=>!!u));for(let u of t)for(let S of d)if(g(S,u.file))return u;if(f==="this"||f==="self"||f==="cls"){let u=t.filter(S=>S.file===n&&E(S.symbol)!==null);if(u.length===1)return u[0]}let m=te(p(e,n)??"",f);if(m.size===0)return null;let V=new Set(o.filter(u=>m.has(u.localName??u.importedName)).map(u=>u.sourcePath).filter(u=>!!u)),D=t.filter(u=>m.has(E(u.symbol)??"")&&(u.file===n||[...V].some(S=>g(S,u.file))));return D.length===1?D[0]:null}let s=t.filter(f=>E(f.symbol)===null),c=s.find(f=>f.file===n);if(c)return c;let a=b(t[0].symbol),l=o.filter(f=>f.kind!=="namespace"&&f.kind!=="side-effect"&&(f.localName===a||f.localName===null&&f.importedName===a));if(l.length>0){let f=s.filter(d=>l.some(m=>m.sourcePath!==null&&g(m.sourcePath,d.file)));return f.length===1?f[0]:null}return s.length===1?s[0]:null}function te(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function j(e){let n=T(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var ne=k("global-leaf-index",{clearGroups:["whole-project"]});function M(e){return ne.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
2
2
  COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
3
3
  FROM global_symbols gs
4
4
  LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
@@ -13,4 +13,4 @@ import{d as z}from"./chunk-KK7GPALL.js";import{d as y}from"./chunk-5H5WTJSD.js";
13
13
  ) mention_doc ON mention_doc.symbol_id = gs.id
14
14
  WHERE 1 = 1
15
15
  ${e.symbolNoiseFor("gs")}`),t=new Map;for(let r of n){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=b(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return t})}var re=h("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function Z(e,n){let t=P(n);return re.get(e,t,()=>ie(e,t))}function ie(e,n){let t=new Map;for(let r of R(e,n)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&G(t,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)G(t,o,r.sourcePath)}return t}function G(e,n,t){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var H=/[A-Za-z_$][A-Za-z0-9_$]*/g,U=/^[A-Za-z_$][A-Za-z0-9_$]*$/,oe=512;function C(e){let n=[],t=!1;for(let r of e)r&&(t=!0,U.test(r)||n.push(r));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function J(e,n){let t=se(n)?n:C(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=oe){for(let i of t.candidateNames)if(i){if(U.test(i)){if(ae(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}H.lastIndex=0;let r;for(;(r=H.exec(e))!==null;)if(t.candidateNames.has(r[0]))return!0;for(let i of t.nonIdentifierNames)if(e.includes(i))return!0;return!1}function se(e){return"candidateNames"in e}function ae(e){return new RegExp(`(?<![A-Za-z_$0-9])${A(e)}(?![A-Za-z_$0-9])`)}function w(e,n,t){let r=M(e).get(t);if(!r||r.length===0)return[];if(r.length===1)return[I(r[0])];let i=r.filter(a=>a.file===n);if(i.length>0)return i.map(I);let o=Z(e,n),s=o.get(t);if(s)for(let a of s){let l=r.filter(f=>g(a,f.file));if(l.length>0)return l.map(I)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=r.filter(f=>g(a,f.file));if(l.length>0&&l.length===r.length)return l.map(I)}return[]}function Ve(e,n,t){let r=w(e,n,t);if(r.length>0)return r;let i=M(e).get(t);return!i||i.length===0?[]:i.map(I)}function Y(e,n,t={}){let r=ce(e,n);if(!r)return[];let i=y(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return x(e,c)}}let o=new Map;for(let s of v(e)){let c=le(e,r,s);c.length>0&&o.set(s,c)}return x(e,o)}function ce(e,n){let t=y(e,n);if(!t)return null;let r=b(t.symbol);return r?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:r}:null}function le(e,n,t){let r=p(e,t);return!r||r.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!w(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:_(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Xe(e,n,t={}){let r=new Map;for(let a of n){if(!a.leaf)continue;let l=r.get(a.leaf)??[];l.push(a),r.set(a.leaf,l)}if(r.size===0)return new Map;let i=new Set(n.map(a=>a.symbolId)),o=new Set(r.keys()),s=C(o),c=new Map;for(let a of v(e)){if(t.skipPath?.(a)||!J(p(e,a),s))continue;let l=B(e,a);if(l.size!==0){for(let f of l)if(r.has(f))for(let d of w(e,a,f)){if(!i.has(d.symbolId)||a===d.relativePath)continue;let m=c.get(d.symbolId);m||(m=new Set,c.set(d.symbolId,m)),m.add(a)}}}return c}function I(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function x(e,n){let t=[],r=new Set;for(let[i,o]of n){let s=O(e,i);for(let c of o){let a=$(s,c),l=`${i}|${c}|${a?.symbol??""}`;r.has(l)||(r.add(l),t.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return t}function fe(e,n){return ue(e,[n]).get(n.symbolId)??[]}function ue(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:Se(e,o)})).filter(o=>o.prelude!==null),r=pe(e,t.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of t){let c=de(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,x(e,c))}return i}function rt(e,n,t={}){return me(e,n,t).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function me(e,n,t={}){let r=Y(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=r.length>0?W(r,"source-attribution"):W(fe(e,n),"scip-reference-chunk");return t.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function W(e,n){return e.map(t=>({...t,provenance:n}))}function de(e,n,t,r){let i=new Map;for(let[o,s]of n)i.set(o,ge(e,o,s,t,r));return i}function pe(e,n){let t=new Map;for(let r of z(e,n)){if(e.isIgnored(r.relative_path))continue;let i=t.get(r.symbol_id);i||(i=new Map,t.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return t}function ge(e,n,t,r,i){let o=n===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?_(e,n,i,o):[];return t.flatMap(c=>be(s,c))}function be(e,n){let t=e.filter(r=>r>=n.start_line&&r<=n.end_line);return t.length>0?t:[n.start_line]}function Se(e,n){let t=y(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}export{_ as a,N as b,Re as c,we as d,De as e,M as f,C as g,J as h,Z as i,w as j,Ve as k,Xe as l,fe as m,ue as n,rt as o,me as p};
16
- //# sourceMappingURL=chunk-AYPDH2LU.js.map
16
+ //# sourceMappingURL=chunk-SKKXTABJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as P,b as y}from"./chunk-FGNCOQUX.js";import{a as C,c as b,e as r,f}from"./chunk-B3X6KU75.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{P as v}from"./chunk-7JYHQAH2.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return b([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
2
- //# sourceMappingURL=chunk-ZYM4HOFA.js.map
1
+ import{a as P,b as y}from"./chunk-V2RBODHL.js";import{a as C,c as b,e as r,f}from"./chunk-B3X6KU75.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{Q as v}from"./chunk-ZLMXIQLC.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return b([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
2
+ //# sourceMappingURL=chunk-SSRFUQBD.js.map
@@ -0,0 +1,3 @@
1
+ import{a as P,b as k,c as S,d as I,e as E,i as z}from"./chunk-QBQE7ZJ5.js";import{J as u,O as Q,P as $,Q as v,x as _,z as C}from"./chunk-JZ2A7LDM.js";function F(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function j(t,e){if(t?.aborted)throw F(t,e)}import{randomUUID as oe}from"crypto";import{closeSync as se,fsyncSync as ae,linkSync as ce,mkdirSync as de,openSync as le,statSync as ue,unlinkSync as fe,writeSync as ye}from"fs";import{dirname as x}from"path";var G="scip-query-process-lock",A=1,w=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:I,readProcessIdentity:S,randomToken:()=>oe(),makeDirectory:t=>de(t,{recursive:!0}),openFile:(t,e,r)=>le(t,e,r),writeFile:(t,e,r,n)=>ye(t,e,r,n),syncFile:t=>ae(t),closeFile:t=>se(t),linkFile:(t,e)=>ce(t,e),readFile:t=>u(t,"process lock record"),statFile:t=>{let e=ue(t);return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs}},removeFile:t=>fe(t)});function B(t,e){let r=e.runtime??w;r.makeDirectory(x(t));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:J(t,e,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=m(t,{parseLegacy:e.parseLegacy,runtime:r});if(i===0&&me(t,s,{creationGraceMs:e.creationGraceMs,parseLegacy:e.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:m(t,{parseLegacy:e.parseLegacy,runtime:r})}}function m(t,e={}){let r=e.runtime??w,n,i;try{n=r.statFile(t),i=r.readFile(t)}catch(c){return c.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=pe(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:ke(s),parsed:o};let a=e.parseLegacy?.(o)??null;return a?{state:"legacy",raw:i,identity:n,owner:a,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function pe(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;if(e.protocol!==G||e.version!==A||typeof e.kind!="string"||e.kind.trim()===""||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.token!="string"||e.token.trim()===""||typeof e.startedAt!="string"||!Number.isFinite(Date.parse(e.startedAt))||e.detail!==void 0&&(typeof e.detail!="object"||e.detail===null||Array.isArray(e.detail)))return null;let r=e.processIdentity===void 0?null:P(e.processIdentity);return e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{protocol:G,version:A,kind:e.kind,pid:e.pid,token:e.token,...r?{processIdentity:r}:{},startedAt:e.startedAt,...e.detail?{detail:e.detail}:{}}}function me(t,e,r={}){let n=r.runtime??w;if(!q(e,n))return!1;let i=ge(`${t}.reclaim`,n);if(!i)return!1;try{let o=m(t,{parseLegacy:r.parseLegacy,runtime:n});return!V(e,o)||!q(o,n)?!1:O(t,n)}finally{i.release()}}function J(t,e,r){let n=e.directoryDurability??"durable",i=e.pid??process.pid,o=r.randomToken(),s=e.processIdentity===void 0?r.readProcessIdentity(i):e.processIdentity,a={protocol:G,version:A,kind:e.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...e.detail?{detail:e.detail}:{}},c=`${t}.${o}.candidate`,y=r.openFile(c,"wx",384),p;try{$(y,Buffer.from(`${JSON.stringify(a)}
2
+ `),r,"process lock"),r.syncFile(y)}catch(l){p=l}try{r.closeFile(y)}catch(l){p??=l}if(p!==void 0)throw h(c,r),p;try{r.linkFile(c,t)}catch(l){throw h(c,r),l}if(h(c,r),n==="durable")try{H(x(t),r)}catch(l){throw be(t,a,r),l}let f=!1;return{path:t,record:a,release:()=>f?!1:(f=!0,K(t,a,r,n))}}function be(t,e,r=w){return K(t,e,r,"durable")}function K(t,e,r,n){let i=m(t,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==e.pid||i.record.token!==e.token||e.processIdentity&&(!i.record.processIdentity||!k(e.processIdentity,i.record.processIdentity))?!1:O(t,r,n)}function ge(t,e){for(let r=0;r<2;r+=1)try{return J(t,{kind:"reclaim-guard",runtime:e},e)}catch(n){if(n.code!=="EEXIST")return null;let i=m(t,{runtime:e});if(r>0||!q(i,e))return null;let o=m(t,{runtime:e});if(!V(i,o)||!O(t,e))return null}return null}function q(t,e){if(t.state==="missing")return!1;if(t.owner){if(!e.isProcessAlive(t.owner.pid))return!0;if(!t.owner.processIdentity)return!1;let r=e.readProcessIdentity(t.owner.pid);return r!==null&&!k(t.owner.processIdentity,r)}return!1}function V(t,e){return t.state===e.state&&t.raw===e.raw&&t.identity!==void 0&&e.identity!==void 0&&t.identity.dev===e.identity.dev&&t.identity.ino===e.identity.ino&&t.identity.size===e.identity.size&&t.identity.mtimeMs===e.identity.mtimeMs}function ke(t){return{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}}function H(t,e){let r;try{r=e.openFile(t,"r")}catch(n){if(v(n,process.platform))return;throw n}try{e.syncFile(r)}catch(n){if(!v(n,process.platform))throw n}finally{e.closeFile(r)}}function O(t,e,r="durable"){try{return e.removeFile(t),r==="durable"&&H(x(t),e),!0}catch{return!1}}function h(t,e){try{e.removeFile(t)}catch{}}import{join as Le}from"path";var Pe=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function at(t,e={}){return D(Le(t,"gc.lock"),e)}function D(t,e={}){let r=e.waitMs??0,n=e.pollMs??10,i=e.now??E,o=i()+r;do{let s=U(t,e.directoryDurability);if(s)return W(s);let a=o-i();if(a<=0)return null;Se(Math.min(n,a))}while(i()<=o);return null}async function ct(t,e={}){let r=e.waitMs??0,n=e.pollMs??10,i=e.now??E,o=i()+r;do{j(e.signal,"Lock acquisition was aborted.");let s=U(t,e.directoryDurability);if(s)return W(s);let a=o-i();if(a<=0)return null;await Ie(Math.min(n,a),e.signal)}while(i()<=o);return null}function U(t,e){let r=B(t,{kind:"generic",parseLegacy:Pe,...e?{directoryDurability:e}:{}});return r.kind==="acquired"?r.lock:null}function W(t){return{release:()=>{t.release()}}}function Se(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}function Ie(t,e){return e?.aborted?Promise.reject(F(e,"Lock acquisition was aborted.")):new Promise((r,n)=>{let i=setTimeout(()=>{e?.removeEventListener("abort",o),r()},t),o=()=>{clearTimeout(i),e?.removeEventListener("abort",o),n(e?F(e,"Lock acquisition was aborted."):new Error("Lock acquisition was aborted."))};e?.addEventListener("abort",o,{once:!0})})}import{createHash as Fe,randomUUID as we}from"crypto";import{existsSync as b,mkdirSync as Re,readdirSync as Ee,rmSync as Y,statSync as Z}from"fs";import{basename as ve,dirname as R,join as d}from"path";var he=1,Ge=1,Ae=".scipquery-generations",qe="manifest.json",ee="readers",xe="gc.lock",Oe=128,L=new Map,te={pid:process.pid,now:()=>new Date,randomToken:()=>we(),isProcessAlive:I,readProcessIdentity:S};function g(t){return d(R(t),Ae)}function De(t){return d(g(t),xe)}function Pt(t,e=te){let r=D(De(t.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!r)throw new Error("SQLite generation retention is busy; retry opening the index.");let n;try{let i=Ce(t);if(i.source!=="immutable")return{generation:i,release(){}};let o=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let s=d(g(t.dbPath),ee);Re(s,{recursive:!0}),n=d(s,`${e.pid}-${o}.json`);let a=e.readProcessIdentity(e.pid);z(n,{version:1,token:o,generationIdentity:i.identity,pid:e.pid,...a?{processIdentity:a}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let c=!1;return{generation:i,release(){c||!n||(c=!0,Y(n,{force:!0}))}}}finally{r.release()}}function St(t,e,r=te,n={}){let i=d(g(t),ee);if(!b(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,c=0;for(let y of Ee(i,{withFileTypes:!0})){if(!y.isFile()||!y.name.endsWith(".json"))continue;let p=d(i,y.name),f;try{f=Me(JSON.parse(u(p,"SQLite generation reader lease")))}catch{f=null}if(!f){c+=1;for(let l of e)o.add(l);continue}if(!Ne(f,r)){n.removeStale!==!1&&(Y(p,{force:!0}),a+=1);continue}s+=1,o.add(f.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:c}}function Me(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,r=e.processIdentity===void 0?null:P(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...r?{processIdentity:r}:{},acquiredAt:e.acquiredAt}}function Ne(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let r=e.readProcessIdentity(t.pid);return r===null||k(t.processIdentity,r)}function re(t){try{let e=JSON.parse(u(d(g(t),"state.json"),"SQLite generation state"));return Be(e)?e:null}catch{return null}}function Te(t,e){return _e(g(t),e)}function _e(t,e){try{let r=JSON.parse(u(d(t,e,qe),"SQLite generation manifest"));return je(r,e)?r:null}catch{return null}}function Ce(t){let e=re(t.dbPath);if(e){let r=$e(t,e.currentGeneration);if(r)return r;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(b(d(R(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return ze(t,e?.currentGeneration)}function It(t){let e=re(t);if(e)return e.currentGeneration;try{let r=d(R(t),"meta.json"),n=b(r)?u(r,"reindex metadata"):void 0;return ne(t,n)}catch{return null}}function Qe(t){return C(_(t))??t}function $e(t,e){try{let r=d(g(t.dbPath),e),n=Te(t.dbPath,e);if(!n)return null;let i=M(r,n.database),o=n.index?M(r,n.index):void 0,s=n.metadata?M(r,n.metadata):void 0;return!N(i,n.database)||n.index&&(!o||!N(o,n.index))||n.metadata&&(!s||!N(s,n.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:u(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function ze(t,e){let r=ie(t.dbPath),n=d(R(t.dbPath),"meta.json"),i=b(n)?u(n,"reindex metadata"):void 0,o=b(t.indexPath)?t.indexPath:void 0;return{identity:e??ne(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:n,metadataRaw:i},source:"legacy",databaseFileIdentity:r}}function ne(t,e){let r=Fe("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&r.update(Qe(e)),r.update(`\0${ie(t)}`),r.digest("hex")}function ie(t){let e=Z(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function M(t,e){if(ve(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return d(t,e.file)}function N(t,e){if(!b(t))return!1;let r=X(t);if(!r||r.size!==e.size)return!1;let n=`${t}\0${e.sha256}\0${r.identity}`;if(L.has(n))return!0;let i=Q(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=X(t);if(!o||o.identity!==r.identity||i!==e.sha256)return!1;for(L.set(n,!0);L.size>Oe;){let s=L.keys().next().value;if(s===void 0)break;L.delete(s)}return!0}function X(t){let e=Z(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function je(t,e){return t.version===Ge&&t.identity===e&&T(t.database)&&(t.index===void 0||T(t.index))&&(t.metadata===void 0||T(t.metadata))}function T(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function Be(t){return t.version===he&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&Je(t.stableMirrors)&&Ke(t.previousGeneration)&&Ve(t.publication)}function Je(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function Ke(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function Ve(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,r=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(n=>n!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&r.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}export{F as a,j as b,B as c,m as d,me as e,at as f,D as g,ct as h,he as i,Ge as j,Ae as k,qe as l,g as m,De as n,Pt as o,St as p,re as q,Te as r,_e as s,Ce as t,It as u,Qe as v,ie as w};
3
+ //# sourceMappingURL=chunk-SYVJEEUJ.js.map
@@ -0,0 +1,8 @@
1
+ import{a as ee,b as q,d as v}from"./chunk-JFMEXGFE.js";import{i as te,j as h,k as f,l as p}from"./chunk-7HXT6YLU.js";import{e as Q,g as Z,h as F,n as P}from"./chunk-7F45LJKI.js";import{randomUUID as Le}from"crypto";import{closeSync as Ne,existsSync as Oe,fsyncSync as ke,linkSync as qe,mkdirSync as Pe,openSync as $e,renameSync as Ce,unlinkSync as Te,writeSync as _e}from"fs";import{dirname as ne}from"path";import{chmodSync as Ie,constants as Fe,copyFileSync as Re}from"fs";import{dirname as Ee}from"path";var ie=Object.freeze({...te,copyFile:(e,t)=>Re(e,t,Fe.COPYFILE_FICLONE),chmodFile:(e,t)=>Ie(e,t)});function ve(e,t,i={}){let n=i.runtime??ie,r=Ee(t),o=h(r,n);n.copyFile(e,t),i.mode!==void 0&&n.chmodFile(t,i.mode);let s=n.openFile(t,"r");try{n.syncFile(s)}finally{n.closeFile(s)}return p(o,f(r,n))}var re=Object.freeze({platform:process.platform,randomToken:()=>Le(),pathExists:e=>Oe(e),makeDirectory:e=>Pe(e,{recursive:!0}),openFile:(e,t,i)=>$e(e,t,i),writeFile:(e,t,i,n)=>_e(e,t,i,n),syncFile:e=>ke(e),closeFile:e=>Ne(e),renameFile:(e,t)=>Ce(e,t),linkFile:(e,t)=>qe(e,t),removeFile:e=>Te(e)});function $(e,t,i={}){let n=i.durability??"visibility",r=i.runtime??re,o=ne(e),s=n==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,d,c=!1;try{d=r.openFile(a,"wx",i.mode??384),c=!0,P(d,l,r,"atomic file"),n==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.renameFile(a,e),c=!1;let m=n==="durable"?p(s,f(o,r)):"not-requested";return oe(n,m)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(c)try{r.removeFile(a)}catch{}}}function L(e,t,i={}){let n=i.durability??"visibility",r=i.runtime??re;if(!r.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ne(e),s=n==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,d,c=!1;try{d=r.openFile(a,"wx",i.mode??384),c=!0,P(d,l,r,"exclusive atomic file"),n==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.linkFile(a,e);let m=n==="durable"?f(o,r):"not-requested";r.removeFile(a),c=!1;let b=n==="durable"?p(s,m,f(o,r)):"not-requested";return oe(n,b)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(c)try{r.removeFile(a)}catch{}}}function oe(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function se(e,t,i={}){$(e,ae(t,i),{durability:"visibility",runtime:i.runtime})}function C(e,t,i={}){return $(e,ae(t,i),{durability:"durable",runtime:i.runtime})}function ae(e,t){let i=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${i}
2
+ `:i}import{createHash as T,randomUUID as pe}from"crypto";import{closeSync as Ue,existsSync as D,fstatSync as We,lstatSync as B,mkdirSync as Ke,openSync as ze,readdirSync as w,readSync as Xe,renameSync as _,rmSync as g}from"fs";import{basename as S,dirname as J,join as y}from"path";function de(e){return N(e,Je)}function St(e){return N(e,je)}function N(e,t){return Array.isArray(e)?`[${e.map(i=>N(i,t)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([i],[n])=>t(i,n)).map(([i,n])=>`${JSON.stringify(i)}:${N(n,t)}`).join(",")}}`:JSON.stringify(e)}function Je(e,t){return e.localeCompare(t)}function je(e,t){return e<t?-1:e>t?1:0}var j=1,He=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),x=class extends Error{constructor(i,n,r,o){let s=i==="item-too-large"?`request is ${o} bytes; per-item limit is ${r.maxItemBytes}`:i==="item-capacity"?`mailbox has ${n.totalItems} retained items; limit is ${r.maxItems}`:i==="byte-capacity"?`mailbox retains ${n.totalBytes} bytes and the request adds ${o}; limit is ${r.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=i;this.status=n;this.limits=r;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},ge=".owner.json",U={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function qt(e){return{rootDir:e,pendingDir:y(e,"pending"),inflightDir:y(e,"inflight"),responseDir:y(e,"responses"),deadLetterDir:y(e,"dead-letter"),legacyRequestDir:y(e,"requests")}}function I(e={}){let t={...He,...e};for(let[i,n]of Object.entries(t))if(!Number.isFinite(n)||n<=0||!Number.isInteger(n))throw new Error(`Mailbox limit ${i} must be a positive integer.`);return t}function k(e){let t=[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir].map(i=>h(i));return p(...t)}function Pt(e,t){return T("sha256").update(de({namespace:e,payload:t})).digest("hex")}function xe(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${e}`}function $t(e,t,i={}){let n=I(i.limits),r=i.nowMs??Date.now(),o=k(e);return st(t),K(e,n,i.admissionLockTimeoutMs??2e3,i.monotonicNow??v,i.durability??"durable",()=>{W(e,r,n);let s=y(e.pendingDir,`${t.id}.json`),a=y(e.responseDir,`${t.id}.json`),l=ce(e,t.id);if(l){let b=ue(l,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:b.deadlineAtMs??t.deadlineAtMs}}let d=`${JSON.stringify(t)}
3
+ `,c=Buffer.byteLength(d),m=R(e);if(c>n.maxItemBytes)throw new x("item-too-large",m,n,c);if(m.totalItems+1>n.maxItems)throw new x("item-capacity",m,n,c);if(m.totalBytes+c>n.maxBytes)throw new x("byte-capacity",m,n,c);i.onBeforePublish?.();try{let b=i.durability??"durable",u=L(s,d,{durability:b}),M=b==="durable"?p(o,u.directorySync):"not-requested";return{disposition:"accepted",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:t.deadlineAtMs,achievedDurability:u.achievedDurability,directorySync:M}}catch(b){if(b.code!=="EEXIST")throw b;let u=ce(e,t.id);if(!u)throw b;let M=ue(u,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:M.deadlineAtMs??t.deadlineAtMs}}})}function Ve(e,t){if(!t.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");if(t.owner&&(!Number.isSafeInteger(t.owner.pid)||t.owner.pid<=0||t.owner.processIdentity!==void 0&&t.owner.processIdentity.pid!==t.owner.pid))throw new Error("Mailbox claim process identity is invalid.");let i=t.nowMs??Date.now(),n=I(t.limits),r=k(e);try{return K(e,n,2e3,t.monotonicNow??v,t.durability??"durable",()=>Ye(e,t.ownerId,i,n,t.liveness??U,t.owner??{pid:process.pid},r,t.durability??"durable",t.onClaimStage))}catch(o){if(o instanceof x&&o.code==="admission-busy")return[];throw o}}function Ct(e,t){return!be(e.pendingDir)&&!be(e.legacyRequestDir)?[]:Ve(e,t)}function Ye(e,t,i,n,r,o,s,a,l){W(e,i,n,r);let d=y(e.inflightDir,O(t)),c=[...me(e.pendingDir,!1),...me(e.legacyRequestDir,!0)].sort((u,M)=>u.orderAtMs-M.orderAtMs||u.header.id.localeCompare(M.header.id)||u.path.localeCompare(M.path)),m=a==="durable"?s:"not-requested";c.length>0&&(a==="durable"?m=p(m,h(d)):Ke(d,{recursive:!0}),l?.("after-owner-directory-durable"),rt(d,t,o,a),l?.("after-owner-record-published"));let b=[];for(let u of c){if(b.length>=n.maxBatch)break;let M=y(e.responseDir,`${u.header.id}.json`);if(D(M)){g(u.path,{force:!0});continue}let H=Math.max(i+n.claimLeaseMs,(u.header.deadlineAtMs??i)+5e3),we=`${O(u.originalFile)}.${H}.claim`,V=y(d,we);try{_(u.path,V)}catch(Y){let G=Y.code;if(G==="ENOENT"||G==="EEXIST")continue;throw Y}l?.("after-claim-renamed");let Ae=a==="durable"?f(J(u.path)):"not-requested";l?.("after-source-directory-synced");let Se=a==="durable"?f(d):"not-requested";l?.("after-destination-directory-synced");let Be=p(m,Ae,Se);b.push({requestId:u.header.id,ownerId:t,path:V,originalFile:u.originalFile,claimedAtMs:i,claimExpiresAtMs:H,byteLength:u.byteLength,...u.header.operationKey?{operationKey:u.header.operationKey}:{},...u.header.clientId?{clientId:u.header.clientId}:{},...u.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.header.enqueuedAtMs},...u.header.deadlineAtMs===void 0?{}:{deadlineAtMs:u.header.deadlineAtMs},legacy:u.legacy,directorySync:Be})}return b}function Tt(e,t={}){let i=I(t);if(e.byteLength>i.maxItemBytes)throw new x("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:e.byteLength},i,e.byteLength);return Z(e.path,{maxBytes:i.maxItemBytes,inputKind:"bounded mailbox item"})}function Ge(e,t,i,n={}){let r=n.nowMs??Date.now(),o=I(n.limits),s=t.deadlineAtMs===void 0?r+o.responseRetentionMs:Math.min(r+o.responseRetentionMs,Math.max(t.deadlineAtMs,r)+Me),a={mailboxVersion:j,operationKey:t.operationKey??`legacy-${t.requestId}`,clientId:t.clientId??"legacy",...t.deadlineAtMs===void 0?{}:{deadlineAtMs:t.deadlineAtMs},completedAtMs:r,expiresAtMs:s},l={...a,...i,...a},d=Buffer.byteLength(`${JSON.stringify(l)}
4
+ `),c=R(e);if(d>o.maxItemBytes)throw new x("item-too-large",c,o,d);let m=Math.max(0,c.totalBytes-t.byteLength)+d;if(m>o.maxBytes&&m>c.totalBytes&&(Ze(e,r).removed>0&&(c=R(e),m=Math.max(0,c.totalBytes-t.byteLength)+d),m>o.maxBytes&&m>c.totalBytes))throw new x("byte-capacity",c,o,d);let b=n.durability??"durable";if(et(e,t,l,b),n.onAfterResponsePublished?.(),g(t.path,{force:!0}),b==="durable"){let u=J(t.path);f(D(u)?u:e.inflightDir)}}var Me=3e4,Qe=4096;function Ze(e,t){let i={removed:0,bytesFreed:0},n;try{n=w(e.responseDir)}catch{return i}for(let r of n){if(!r.endsWith(".json"))continue;let o=y(e.responseDir,r),s,a;try{let m=ze(o,"r");try{a=We(m).size;let b=Buffer.alloc(Math.min(Qe,a));Xe(m,b,0,b.length,0),s=b.toString("utf8")}finally{Ue(m)}}catch{continue}let l=le(s,"expiresAtMs"),d=le(s,"deadlineAtMs");if(l!==null&&l<=t||d!==null&&d+Me<=t)try{g(o,{force:!0}),i.removed+=1,i.bytesFreed+=a}catch{}}return i}function le(e,t){let i=new RegExp(`"${t}":(\\d+)`).exec(e);if(!i)return null;let n=Number(i[1]);return Number.isSafeInteger(n)?n:null}function _t(e,t,i,n,r={}){let o=r.nowMs??Date.now(),s=I(r.limits);if(Ge(e,t,i,{...r,nowMs:o,limits:s}),!D(t.path)){let a=y(e.deadLetterDir,`${lt(t.requestId)}.${o}.${T("sha256").update(n).digest("hex").slice(0,12)}.json`),l={mailboxVersion:j,requestId:t.requestId,ownerId:t.ownerId,rejectedAtMs:o,reason:n,originalFile:t.originalFile},d=Buffer.byteLength(`${JSON.stringify(l,null,2)}
5
+ `),c=R(e);c.totalItems<s.maxItems&&c.totalBytes+d<=s.maxBytes&&C(a,l,{spacing:2,trailingNewline:!0})}}function Jt(e,t={}){let i=t.nowMs??Date.now(),n=I(t.limits);return k(e),K(e,n,2e3,t.monotonicNow??v,"durable",()=>W(e,i,n,t.liveness??U))}function W(e,t,i,n=U){let r={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=i.cleanupBatch;for(let s of X(e.inflightDir)){if(o<=0)break;let a=y(e.responseDir,`${s.requestId}.json`);if(D(a)){g(s.path,{force:!0}),r.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>t||ot(e,s.ownerId,n)!=="dead")continue;let l=y(e.pendingDir,s.originalFile);try{_(s.path,l),r.reclaimed++}catch(d){if(d.code!=="EEXIST")throw d;g(s.path,{force:!0})}f(J(s.path)),f(e.pendingDir),o--}o=ye(e.responseDir,o,(s,a)=>a+i.responseRetentionMs,t,()=>{r.responsesRemoved++}),o=ye(e.deadLetterDir,o,(s,a)=>a+i.deadLetterRetentionMs,t,()=>{r.deadLettersRemoved++});for(let s of[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir]){if(o<=0)break;for(let a of De(s)){if(o<=0)break;if(!S(a).includes(".tmp-"))continue;let l;try{l=B(a).mtimeMs}catch(d){if(d.code==="ENOENT")continue;throw d}l+i.temporaryRetentionMs>t||(g(a,{force:!0}),r.temporaryFilesRemoved++,o--)}}return at(e.inflightDir),r}function R(e){k(e);let t=[...A(e.pendingDir).map(l=>({path:l,pending:!0})),...A(e.legacyRequestDir).map(l=>({path:l,pending:!0}))],i=X(e.inflightDir).map(l=>({path:l.path,pending:!1})),n=A(e.responseDir).map(l=>({path:l,pending:!1})),r=A(e.deadLetterDir).map(l=>({path:l,pending:!1})),o=[...t,...i,...n,...r],s=0,a;for(let l of t){let d=E(l.path);if(!d){s++;continue}let c=d.enqueuedAtMs;if(c===void 0)try{c=B(l.path).mtimeMs}catch(m){if(m.code==="ENOENT")continue;throw m}a=a===void 0?c:Math.min(a,c)}return{pending:t.length,inflight:i.length,responses:n.length,deadLetters:r.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((l,d)=>l+dt(d.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function et(e,t,i,n){let r=y(e.responseDir,`${t.requestId}.json`),o=`${JSON.stringify(i)}
6
+ `;try{L(r,o,{durability:n})}catch(s){if(s.code!=="EEXIST")throw s;let a=E(r),l=t.operationKey??`legacy-${t.requestId}`;if(a?.operationKey!==l)throw new Error(`Mailbox completion ${t.requestId} conflicts with an existing operation.`,{cause:s})}}function K(e,t,i,n,r,o){let s=y(e.rootDir,".admission.lock"),a=`${process.pid}-${pe()}`,l=n()+Math.max(0,i);for(;!tt(e.rootDir,s,a,r);){if(it(s),n()>=l)throw new x("admission-busy",R(e),t,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{z(s).ownerToken===a&&(g(s,{recursive:!0,force:!0}),r==="durable"&&f(e.rootDir))}catch{}}}function tt(e,t,i,n){let r=`${JSON.stringify({ownerToken:i,pid:process.pid,acquiredAtMs:Date.now()})}
7
+ `;try{return L(t,r,{durability:n}),!0}catch(o){if(o.code==="EEXIST")return!1;try{z(t).ownerToken===i&&(g(t,{force:!0}),n==="durable"&&f(e))}catch{}throw o}}function it(e){let t=null;try{let n=z(e);typeof n.ownerToken=="string"&&Number.isSafeInteger(n.pid)&&Number(n.pid)>0&&(t=Number(n.pid))}catch{}if(t===null||nt(t))return;let i=`${e}.stale-${pe()}`;try{_(e,i)}catch(n){let r=n.code;if(r==="ENOENT"||r==="EEXIST")return;throw n}g(i,{recursive:!0,force:!0})}function z(e){try{return JSON.parse(F(e,"mailbox lock record"))}catch(t){if(t.code!=="EISDIR"&&!(t instanceof Q&&t.reason==="not-regular"))throw t;return JSON.parse(F(y(e,"owner.json"),"mailbox lock owner record"))}}function nt(e){try{return process.kill(e,0),!0}catch(t){let i=t.code;return i==="EPERM"||i!=="ESRCH"}}function rt(e,t,i,n){let r=y(e,ge),o=i.processIdentity,s=he(r);if(s&&s.ownerId===t&&s.pid===i.pid&&(!s.processIdentity&&!o||s.processIdentity&&o&&q(s.processIdentity,o)))return;if(A(e).some(l=>l.endsWith(".claim")))throw new Error(`Mailbox owner identity ${t} collides with retained work from another process instance.`);let a={version:1,ownerId:t,pid:i.pid,...o?{processIdentity:o}:{}};n==="durable"?C(r,a):se(r,a)}function ot(e,t,i){let n=he(y(e.inflightDir,O(t),ge));if(!n)return"unknown";if(!i.isProcessAlive(n.pid))return"dead";if(!n.processIdentity)return"live";let r=i.readProcessIdentity(n.pid);return r?q(n.processIdentity,r)?"live":"dead":"unknown"}function he(e){try{let t=JSON.parse(F(e,"mailbox owner record"));if(t.version!==1||typeof t.ownerId!="string"||!t.ownerId||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0)return null;let i=t.processIdentity===void 0?null:ee(t.processIdentity);return t.processIdentity!==void 0&&(!i||i.pid!==t.pid)?null:{version:1,ownerId:t.ownerId,pid:t.pid,...i?{processIdentity:i}:{}}}catch{return null}}function ce(e,t){for(let i of[y(e.pendingDir,`${t}.json`),y(e.legacyRequestDir,`${t}.json`),y(e.responseDir,`${t}.json`)])if(D(i))return i;for(let i of X(e.inflightDir))if(i.requestId===t)return i.path;return null}function ue(e,t,i){let n=E(e);if(n?.operationKey===t)return n;if(S(e)===`${xe(t)}.json`)return{id:i,operationKey:t};throw new Error(`Mailbox operation ${i} conflicts with an existing retained record.`)}function st(e){if(e.mailboxVersion!==j||e.id!==xe(e.operationKey)||!e.clientId.trim()||!Number.isFinite(e.enqueuedAtMs)||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function me(e,t){return A(e).filter(i=>i.endsWith(".json")).map(i=>{let n=B(i),r=S(i,".json"),o=E(i)??{id:r};return{path:i,originalFile:S(i),header:o,byteLength:n.size,orderAtMs:o.enqueuedAtMs??n.mtimeMs,legacy:t}})}function X(e){if(!D(e))return[];let t=[];for(let i of w(e,{withFileTypes:!0})){if(!i.isDirectory())continue;let n=fe(i.name);if(n===null)continue;let r=y(e,i.name);for(let o of w(r,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=fe(s[1]),l=Number(s[2]);if(a===null||S(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(l))continue;let d=y(r,o.name),c=E(d)??{id:S(a,".json")},m;try{m=B(d)}catch(b){if(b.code==="ENOENT")continue;throw b}t.push({requestId:c.id,ownerId:n,path:d,originalFile:a,claimedAtMs:m.mtimeMs,claimExpiresAtMs:l,byteLength:m.size,...c.operationKey?{operationKey:c.operationKey}:{},...c.clientId?{clientId:c.clientId}:{},...c.enqueuedAtMs===void 0?{}:{enqueuedAtMs:c.enqueuedAtMs},...c.deadlineAtMs===void 0?{}:{deadlineAtMs:c.deadlineAtMs},legacy:c.operationKey===void 0})}}return t.sort((i,n)=>i.claimedAtMs-n.claimedAtMs||i.path.localeCompare(n.path))}function E(e){try{let t=JSON.parse(F(e,"mailbox record"));return typeof t.id!="string"||!t.id?null:{id:t.id,...typeof t.operationKey=="string"?{operationKey:t.operationKey}:{},...typeof t.clientId=="string"?{clientId:t.clientId}:{},...typeof t.enqueuedAtMs=="number"?{enqueuedAtMs:t.enqueuedAtMs}:{},...typeof t.deadlineAtMs=="number"?{deadlineAtMs:t.deadlineAtMs}:{}}}catch{return null}}function ye(e,t,i,n,r){for(let o of A(e)){if(t<=0)break;let s;try{s=B(o)}catch(a){if(a.code==="ENOENT")continue;throw a}i(o,s.mtimeMs)>n||(g(o,{force:!0}),r(),t--)}return t}function A(e){return D(e)?w(e,{withFileTypes:!0}).filter(t=>t.isFile()).map(t=>y(e,t.name)).sort():[]}function be(e){try{return w(e).some(t=>t.endsWith(".json"))}catch{return!1}}function De(e){if(!D(e))return[];let t=[];for(let i of w(e,{withFileTypes:!0})){let n=y(e,i.name);i.isFile()?t.push(n):i.isDirectory()&&t.push(...De(n))}return t.sort()}function at(e){if(D(e))for(let t of w(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let i=y(e,t.name);w(i).some(n=>n.endsWith(".claim"))||g(i,{recursive:!0,force:!0})}}function dt(e){try{return B(e).size}catch{return 0}}function O(e){return Buffer.from(e,"utf8").toString("base64url")}function fe(e){try{let t=Buffer.from(e,"base64url").toString("utf8");return O(t)===e?t:null}catch{return null}}function lt(e){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)?e:`invalid-${T("sha256").update(e).digest("hex")}`}export{ve as a,se as b,C as c,de as d,St as e,j as f,x as g,qt as h,k as i,Pt as j,xe as k,$t as l,Ct as m,Tt as n,Ge as o,_t as p,Jt as q,R as r};
8
+ //# sourceMappingURL=chunk-T3CZAZSI.js.map
@@ -0,0 +1,2 @@
1
+ import{getHeapStatistics as r}from"v8";var o=2560,n=1.25;function _(t){let e=t/1048576;return Math.max(0,Math.floor((e-o)/n))}function p(){return _(r().heap_size_limit)}export{o as a,n as b,p as c};
2
+ //# sourceMappingURL=chunk-T3I6NHBH.js.map
@@ -1,3 +1,3 @@
1
- import{a as R}from"./chunk-IXESDH3J.js";import{p as h}from"./chunk-2XCGSDIT.js";import{a as g}from"./chunk-EELPBR7E.js";import{h as p}from"./chunk-C7IJMOFP.js";import{a as m}from"./chunk-YXPUP5G2.js";import{g as d}from"./chunk-DRENNWRG.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
1
+ import{a as R}from"./chunk-WDSFQDPN.js";import{p as h}from"./chunk-FI7VGOR4.js";import{a as g}from"./chunk-2USA3S3P.js";import{i as p}from"./chunk-2VAHDDLM.js";import{a as m}from"./chunk-YXPUP5G2.js";import{g as d}from"./chunk-BL6DCHQP.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
2
2
  `);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
3
- //# sourceMappingURL=chunk-GDRJB3SB.js.map
3
+ //# sourceMappingURL=chunk-T6DWDI5E.js.map
@@ -0,0 +1,7 @@
1
+ import{a as O}from"./chunk-CFE6PSG6.js";import{a as j,b,c as T}from"./chunk-GTZZVLKJ.js";import{e as $}from"./chunk-GG45PK4S.js";import{g as F,h as N}from"./chunk-OIOC5EHF.js";import{a as B}from"./chunk-VBV6ALJE.js";import{a as A}from"./chunk-BOJ5SVE2.js";import{b as v,c as R}from"./chunk-2BMSSRBH.js";import{a as _}from"./chunk-BGBBVSH4.js";import{b as D}from"./chunk-SKKXTABJ.js";import{C,d as I,e as S,f as y,m as E}from"./chunk-C7C6AKAT.js";import{b as W,q as P}from"./chunk-RBAD4GJ2.js";import{k}from"./chunk-ETC674NS.js";import{y as L}from"./chunk-KNLQGXVH.js";import{basename as m,extname as h}from"path";function De(n,t){let{scope:e,maxLoc:i=15,limit:r=30,scanLimit:a}=t??{},o=new R(n),s=re(o.fileDependencyGraph(e)),p=new Map,f=B({candidates:()=>U(n,o,e,i),orderCandidates:A,scanLimit:a,profile:{name:"wrapper-candidates"},prepare:c=>({callerFileMap:J(n,o,c,{semantic:t?.semantic!==!1}),reverseFanIn:s,receivers:p}),evaluate:(c,u)=>q(n,o,c,u),orderResults:(c,u)=>u.callerFanIn-c.callerFanIn||u.loc-c.loc,limit:r});return V(f,p)}function J(n,t,e,i){let r=j(n,t),a=b(r.forDefinitions(e,{semantic:!1,sourceFallback:!1})),o=[];i.semantic&&L("wrapper.semantic-candidates",()=>{o=e.filter(l=>M(n,t,l,a).length<=1)},()=>({symbols:e.length,semanticCandidates:o.length}));let s=o.length===0?new Map:b(r.forDefinitions(o,{semantic:!0,sourceFallback:!1})),p=s.size===0?a:v(a,s),f=new Map(e.map(l=>[l.symbolId,l])),c=new Map;for(let l of e){let d=M(n,t,l,p);if(d.length>1||(c.set(l.symbolId,l),d.length!==1))continue;let x=d[0],w=z(n,l.symbolId,x);if(!w)continue;let g=G(t,n,x,l.symbol,w);g?.isFunctionLike&&f.has(g.symbolId)&&c.set(g.symbolId,f.get(g.symbolId))}let u=[...c.values()];return u.length===0?p:v(p,b(r.forDefinitions(u,{semantic:!1,sourceFallback:!0})))}function q(n,t,e,i){let r=M(n,t,e,i.callerFileMap);if(r.length!==1)return null;let a=r[0],o=z(n,e.symbolId,a);if(!o)return null;let s=G(t,n,a,e.symbol,o);if(s&&E(s.symbol))return null;let{fanIn:p,source:f}=ee(i.callerFileMap,i.reverseFanIn,a,s);if(f==="function"?p<=3:p<=5)return null;let c=ie(n,e,a,s),u=Z(n,e);u==="helper"&&c.push("body computes or branches rather than forwarding one call");let l=u==="forwarding"?H(n,e):null;l&&i.receivers.set(e.symbol,l);let d=l&&K(n,e.relativePath,l)?l:null;return d&&c.push(`forwards through module-private state: ${d}`),{symbol:e.symbol,shortName:I(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:_(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?I(s.symbol):m(a),callerFanIn:p,actionTier:c.length>0?"signal":"direct",bodyShape:u,boundaryEvidence:c}}function H(n,t){let e=F(n,t);if(!e)return null;let i=W(N(e)).trim(),r=/^(?:return\s+)?(?:await\s+)?([A-Za-z_$][\w$]*)\s*[.(]/.exec(i)?.[1];return!r||r==="this"||r==="super"?null:r}function K(n,t,e){let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^(?:const|let|var)\\s+${i}\\b`);return k(n,t).some(a=>r.test(a))}var Q=3;function V(n,t){let e=new Map,i=r=>{let a=t.get(r.symbol);return a&&r.bodyShape==="forwarding"?`${r.file}\0${a}`:null};for(let r of n){let a=i(r);a&&e.set(a,(e.get(a)??0)+1)}return n.map(r=>{let a=i(r),o=a?e.get(a)??0:0;if(o<Q)return r;let s=t.get(r.symbol);return{...r,actionTier:"signal",boundaryEvidence:[...r.boundaryEvidence,`facade: ${o} sibling forwards from this file through ${s}`]}})}function Z(n,t){let e=F(n,t);return e&&$(e)?"forwarding":"helper"}function U(n,t,e,i){return t.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(r=>!P(n,r)).filter(r=>!X(r.leaf))}function X(n){return typeof n=="string"&&n.startsWith("<")&&n.endsWith(">")}function M(n,t,e,i){let r=m(e.relativePath,h(e.relativePath)),a=[...i.get(e.symbolId)??[]].filter(o=>o!==e.relativePath).filter(o=>m(o,h(o))!==r).filter(o=>{let s=t.fileKind(o);return s!=="barrel"&&s!=="entry"&&s!=="test"});return T(n,e,a).realConsumers}function z(n,t,e){return n.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`,t,e)}function G(n,t,e,i,r){let a=n.definitionsForFile(e);for(let o of Y(t,e,i,r.start_line,r.end_line)){let s=C(a,o);if(s?.isFunctionLike)return s}return C(a,ne(t,e,i,r.start_line,r.end_line))}function Y(n,t,e,i,r){let a=S(e);return a?(D(n,t).get(a)??[]).filter(o=>o>=i&&o<=r):[]}function ee(n,t,e,i){if(i?.isFunctionLike){let r=[...n.get(i.symbolId)??[]].filter(a=>a!==i.relativePath);if(r.length>0)return{fanIn:r.length,source:"function"}}return{fanIn:te(t,e),source:"file"}}function ne(n,t,e,i,r){let a=S(e);if(!a)return i;let o=D(n,t).get(a);if(!o||o.length===0)return i;for(let s of o)if(s>=i&&s<=r)return s;return i}function re(n){let t=new Map;for(let[e,i]of n){t.has(e)||t.set(e,t.get(e)??0);for(let r of i)t.set(r,(t.get(r)??0)+1)}return t}function te(n,t){let e=n.get(t)??0;if(e>0)return e;let i=m(t,h(t)),r=0;for(let[a,o]of n)a!==t&&m(a,h(a))===i&&o>r&&(r=o);return r}function ie(n,t,e,i){return O(n,t.relativePath,t.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:y(t.symbol),side:"self"},{label:"caller name",value:i?.symbol?y(i.symbol):m(e),side:"other"},{label:"wrapper path",value:t.relativePath,side:"self"},{label:"caller path",value:e,side:"other"}])}export{De as a,V as b};
7
+ //# sourceMappingURL=chunk-T6HRIROJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-SV2LEFVM.js";import{a as $}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-Q6T2CAJL.js";import{b as j}from"./chunk-4GAQ6FI4.js";import{t as q}from"./chunk-TD7VKJ2Y.js";import{x as v}from"./chunk-42W3LFUK.js";import{a as U}from"./chunk-7JYHQAH2.js";import{readdirSync as L}from"fs";import{join as I}from"path";function z(e){return V(e).replace(/\/\*\*?$/,"")}function D(e,r){let t=V(r),o=z(t),c=t.endsWith("/**"),s=[],n=(a,l)=>{let g;try{g=L(a,{withFileTypes:!0})}catch{return}for(let p of g){if(p.name.startsWith("."))continue;let u=l?`${l}/${p.name}`:p.name;B(t,u)&&s.push(u),c&&p.isDirectory()&&n(I(a,p.name),u)}};return n(I(e,o),o),s.sort()}function V(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}var G=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,T=new Map;function k(e,r,t,o){if(!r?.testPaths?.length)return[];let c=H(r),s=[];for(let n of _(e,r.testPaths)){let a=K(e,n,o),l=a?t(a):null;if(l)for(let g of v(e,n)){let p=g.sourcePath;if(!p)continue;let u=t(p);u&&u!==l&&(c.get(l)?.has(u)||s.push({testFile:n,ownerBoundary:l,importedFile:p,importedBoundary:u,reason:"outside-owner-policy"}))}}return N(s)}function H(e){let r=e.allowedDependencies??{},t=e.boundaries.map(n=>n.name),o=new Map,c=(n,a)=>{for(let l of r[n]??[])a.has(l)||(a.add(l),c(l,a))};for(let n of t){let a=new Set;c(n,a),o.set(n,a)}let s=new Map;for(let n of t){let a=new Set(o.get(n));for(let l of t)l!==n&&o.get(l)?.has(n)&&a.add(l);s.set(n,a)}return s}function _(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=T.get(t);if(o)return o;let c=new Set;for(let n of r)for(let a of D(e.config.projectRoot,n))G.test(a)&&c.add(a);let s=[...c].sort();return T.set(t,s),s}function K(e,r,t){let o=r.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(o!==r&&t(o))return o;let c=r.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=v(e,r).map(n=>n.sourcePath).filter(n=>!!n&&t(n)&&n.split("/").pop()===c);return s.length===1?s[0]:null}function N(e){let r=new Map;for(let t of e){let o=`${t.testFile}\0${t.importedBoundary}`;r.has(o)||r.set(o,t)}return[...r.values()].sort((t,o)=>t.testFile.localeCompare(o.testFile)||t.importedBoundary.localeCompare(o.importedBoundary))}function O(e,r){let t=(e?.boundaries??[]).filter(o=>o.paths.some(c=>B(c,r)));return t.length===1?t[0].name:null}var C="architecture:";function W(e,r,t,o={}){let c=J(e,r);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let s=new Map,n=new Map(t.boundaries.map(i=>[i.name,new Set])),a=[],l=[];for(let i of c){let f=t.boundaries.filter(y=>y.paths.some(S=>B(S,i))).map(y=>y.name).sort();if(f.length===0)a.push(i);else if(f.length>1)l.push({file:i,boundaries:f});else{let y=f[0];s.set(i,y),n.get(y).add(i)}}let g=new Map;for(let[i,f]of e){let y=s.get(i);if(y)for(let S of f){let x=s.get(S);if(!x||y===x)continue;let M=F(y,x),w=g.get(M);w||(w={from:y,to:x,fileEdges:[],importers:new Set,importedFiles:new Set},g.set(M,w)),w.fileEdges.push({fromFile:i,toFile:S}),w.importers.add(i),w.importedFiles.add(S)}}let p=[...g.values()].map(i=>Q(i,t)).sort(ie),u=p,E=new Map(u.map(i=>[F(i.from,i.to),i])),R=new Map(t.boundaries.map(i=>[i.name,new Set]));for(let i of u)R.get(i.from).add(i.to);let m=[];for(let i of u){if(i.from>=i.to)continue;let f=E.get(F(i.to,i.from));f&&m.push({boundaries:[i.from,i.to],forward:i,reverse:f})}let{components:A}=$(R),h=A.filter(i=>i.length>1).map(i=>Z(i,u,t.requireAcyclic===!0)).sort((i,f)=>f.boundaries.length-i.boundaries.length||i.boundaries.join("/").localeCompare(f.boundaries.join("/"))),b=t.allowedDependencies??{},d=t.boundaries.map(i=>i.name).filter(i=>!Object.hasOwn(b,i)).sort();return{configured:!0,boundaries:t.boundaries.map(i=>({name:i.name,paths:[...i.paths],fileCount:n.get(i.name).size,dependencyPolicyDeclared:Object.hasOwn(b,i.name)})).sort((i,f)=>i.name.localeCompare(f.name)),edges:p,forbiddenEdges:u.filter(i=>i.policyStatus==="forbidden"),reciprocalPairs:m,cycles:h,staleAllowances:te(t,u),boundaryLimits:oe(t,u,n),fragileEdges:u.filter(i=>i.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:ee(e,n,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,i=>t.boundaries.find(f=>f.name===i)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-d.length,totalBoundaries:t.boundaries.length,missingRows:d,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function Fe(e,r={}){let t=j(e,r.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),o=U(e,{includeIgnored:!1}).filter(s=>!r.scope||s.includes(r.scope)),c=new Set(o);return W(t,o,e.config.architecture,{isModuleHierarchyFile:s=>X(e,s),testBoundaryViolations:k(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function X(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:q(e,r).length===0}function Ee(e){let r=e.forbiddenEdges.map(o=>`${C}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${C}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${C}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${C}ambiguous-file:${encodeURIComponent(o.file)}:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`)}if(e.policyCoverage.requiresMinimalPolicy)for(let o of e.staleAllowances)r.push(`${C}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${C}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${C}boundary-limit:${o.kind}:${encodeURIComponent(o.boundary)}`);let t=new Map;for(let o of e.coarseBoundaries)o.violatesPolicy&&t.set(o.boundary,(t.get(o.boundary)??0)+1);for(let[o,c]of t){let s=`${C}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let n=2;n<=c;n+=1)r.push(`${s}:component:${n}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${C}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function Se(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireCompleteCoverage===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(r=>r.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function J(e,r){let t=new Set(r);for(let[o,c]of e){t.add(o);for(let s of c)t.add(s)}return[...t].sort()}function Q(e,r){let t=[...e.fileEdges].sort((o,c)=>o.fromFile.localeCompare(c.fromFile)||o.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:Y(r,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function Y(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function Z(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),n=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===n),violatesPolicy:t}}function ee(e,r,t=re,o=!1,c=()=>"directory"){let s=[];for(let[n,a]of r){let l=c(n)==="file"?m=>m:ne,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let p=new Set(g),u=new Map,E=new Map;for(let m of g)E.set(l(m),new Set);for(let m of g)for(let A of e.get(m)??[]){if(!p.has(A))continue;let h=l(m),b=l(A);if(h===b)continue;let d=F(h,b),i=u.get(d);i||(i={from:h,to:b,fileEdges:[]},u.set(d,i)),i.fileEdges.push({fromFile:m,toFile:A}),E.get(h).add(b)}let{components:R}=$(E);for(let m of R){if(m.length<2)continue;let A=new Set(m),h=[...u.values()].filter(d=>A.has(d.from)&&A.has(d.to)).map(d=>({from:d.from,to:d.to,fileEdgeCount:d.fileEdges.length,examples:d.fileEdges.slice(0,5)})).sort((d,i)=>d.from.localeCompare(i.from)||d.to.localeCompare(i.to)),b=Math.min(...h.map(d=>d.fileEdgeCount));s.push({boundary:n,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:h,narrowestEdges:h.filter(d=>d.fileEdgeCount===b)})}}return s.sort((n,a)=>a.subUnits.length-n.subUnits.length||n.boundary.localeCompare(a.boundary))}function te(e,r){let t=new Set(r.map(n=>F(n.from,n.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(n=>n.name)),s=[];for(let[n,a]of Object.entries(o))if(c.has(n))for(let l of a)!c.has(l)||t.has(F(n,l))||s.push({from:n,to:l});return s.sort((n,a)=>n.from.localeCompare(a.from)||n.to.localeCompare(a.to))}function oe(e,r,t){let o=[],c=new Map;for(let s of r)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&o.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let n=s.maxFiles??e.maxBoundaryFiles;if(n!==void 0){let a=t.get(s.name)?.size??0;a>n&&o.push({boundary:s.name,kind:"files",observed:a,limit:n})}}return o.sort((s,n)=>s.boundary.localeCompare(n.boundary)||s.kind.localeCompare(n.kind))}function re(e){let r=P(e);return r==="test"||r==="entry"}function ne(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function F(e,r){return`${e}\0${r}`}function ie(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{D as a,C as b,W as c,Fe as d,Ee as e,Se as f,ee as g};
2
- //# sourceMappingURL=chunk-OTSPRVNW.js.map
1
+ import{a as B}from"./chunk-SV2LEFVM.js";import{a as $}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-FLMTCX5R.js";import{b as j}from"./chunk-BOW7SSQH.js";import{v as q}from"./chunk-C7C6AKAT.js";import{y as v}from"./chunk-RBAD4GJ2.js";import{a as U}from"./chunk-ZLMXIQLC.js";import{readdirSync as L}from"fs";import{join as I}from"path";function z(e){return V(e).replace(/\/\*\*?$/,"")}function D(e,r){let t=V(r),o=z(t),c=t.endsWith("/**"),s=[],n=(a,l)=>{let g;try{g=L(a,{withFileTypes:!0})}catch{return}for(let p of g){if(p.name.startsWith("."))continue;let u=l?`${l}/${p.name}`:p.name;B(t,u)&&s.push(u),c&&p.isDirectory()&&n(I(a,p.name),u)}};return n(I(e,o),o),s.sort()}function V(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}var G=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,T=new Map;function k(e,r,t,o){if(!r?.testPaths?.length)return[];let c=H(r),s=[];for(let n of _(e,r.testPaths)){let a=K(e,n,o),l=a?t(a):null;if(l)for(let g of v(e,n)){let p=g.sourcePath;if(!p)continue;let u=t(p);u&&u!==l&&(c.get(l)?.has(u)||s.push({testFile:n,ownerBoundary:l,importedFile:p,importedBoundary:u,reason:"outside-owner-policy"}))}}return N(s)}function H(e){let r=e.allowedDependencies??{},t=e.boundaries.map(n=>n.name),o=new Map,c=(n,a)=>{for(let l of r[n]??[])a.has(l)||(a.add(l),c(l,a))};for(let n of t){let a=new Set;c(n,a),o.set(n,a)}let s=new Map;for(let n of t){let a=new Set(o.get(n));for(let l of t)l!==n&&o.get(l)?.has(n)&&a.add(l);s.set(n,a)}return s}function _(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=T.get(t);if(o)return o;let c=new Set;for(let n of r)for(let a of D(e.config.projectRoot,n))G.test(a)&&c.add(a);let s=[...c].sort();return T.set(t,s),s}function K(e,r,t){let o=r.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(o!==r&&t(o))return o;let c=r.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=v(e,r).map(n=>n.sourcePath).filter(n=>!!n&&t(n)&&n.split("/").pop()===c);return s.length===1?s[0]:null}function N(e){let r=new Map;for(let t of e){let o=`${t.testFile}\0${t.importedBoundary}`;r.has(o)||r.set(o,t)}return[...r.values()].sort((t,o)=>t.testFile.localeCompare(o.testFile)||t.importedBoundary.localeCompare(o.importedBoundary))}function O(e,r){let t=(e?.boundaries??[]).filter(o=>o.paths.some(c=>B(c,r)));return t.length===1?t[0].name:null}var C="architecture:";function W(e,r,t,o={}){let c=J(e,r);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let s=new Map,n=new Map(t.boundaries.map(i=>[i.name,new Set])),a=[],l=[];for(let i of c){let f=t.boundaries.filter(y=>y.paths.some(S=>B(S,i))).map(y=>y.name).sort();if(f.length===0)a.push(i);else if(f.length>1)l.push({file:i,boundaries:f});else{let y=f[0];s.set(i,y),n.get(y).add(i)}}let g=new Map;for(let[i,f]of e){let y=s.get(i);if(y)for(let S of f){let x=s.get(S);if(!x||y===x)continue;let M=F(y,x),w=g.get(M);w||(w={from:y,to:x,fileEdges:[],importers:new Set,importedFiles:new Set},g.set(M,w)),w.fileEdges.push({fromFile:i,toFile:S}),w.importers.add(i),w.importedFiles.add(S)}}let p=[...g.values()].map(i=>Q(i,t)).sort(ie),u=p,E=new Map(u.map(i=>[F(i.from,i.to),i])),R=new Map(t.boundaries.map(i=>[i.name,new Set]));for(let i of u)R.get(i.from).add(i.to);let m=[];for(let i of u){if(i.from>=i.to)continue;let f=E.get(F(i.to,i.from));f&&m.push({boundaries:[i.from,i.to],forward:i,reverse:f})}let{components:A}=$(R),h=A.filter(i=>i.length>1).map(i=>Z(i,u,t.requireAcyclic===!0)).sort((i,f)=>f.boundaries.length-i.boundaries.length||i.boundaries.join("/").localeCompare(f.boundaries.join("/"))),b=t.allowedDependencies??{},d=t.boundaries.map(i=>i.name).filter(i=>!Object.hasOwn(b,i)).sort();return{configured:!0,boundaries:t.boundaries.map(i=>({name:i.name,paths:[...i.paths],fileCount:n.get(i.name).size,dependencyPolicyDeclared:Object.hasOwn(b,i.name)})).sort((i,f)=>i.name.localeCompare(f.name)),edges:p,forbiddenEdges:u.filter(i=>i.policyStatus==="forbidden"),reciprocalPairs:m,cycles:h,staleAllowances:te(t,u),boundaryLimits:oe(t,u,n),fragileEdges:u.filter(i=>i.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:ee(e,n,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,i=>t.boundaries.find(f=>f.name===i)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-d.length,totalBoundaries:t.boundaries.length,missingRows:d,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function Fe(e,r={}){let t=j(e,r.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),o=U(e,{includeIgnored:!1}).filter(s=>!r.scope||s.includes(r.scope)),c=new Set(o);return W(t,o,e.config.architecture,{isModuleHierarchyFile:s=>X(e,s),testBoundaryViolations:k(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function X(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:q(e,r).length===0}function Ee(e){let r=e.forbiddenEdges.map(o=>`${C}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${C}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${C}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${C}ambiguous-file:${encodeURIComponent(o.file)}:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`)}if(e.policyCoverage.requiresMinimalPolicy)for(let o of e.staleAllowances)r.push(`${C}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${C}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${C}boundary-limit:${o.kind}:${encodeURIComponent(o.boundary)}`);let t=new Map;for(let o of e.coarseBoundaries)o.violatesPolicy&&t.set(o.boundary,(t.get(o.boundary)??0)+1);for(let[o,c]of t){let s=`${C}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let n=2;n<=c;n+=1)r.push(`${s}:component:${n}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${C}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function Se(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireCompleteCoverage===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(r=>r.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function J(e,r){let t=new Set(r);for(let[o,c]of e){t.add(o);for(let s of c)t.add(s)}return[...t].sort()}function Q(e,r){let t=[...e.fileEdges].sort((o,c)=>o.fromFile.localeCompare(c.fromFile)||o.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:Y(r,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function Y(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function Z(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),n=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===n),violatesPolicy:t}}function ee(e,r,t=re,o=!1,c=()=>"directory"){let s=[];for(let[n,a]of r){let l=c(n)==="file"?m=>m:ne,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let p=new Set(g),u=new Map,E=new Map;for(let m of g)E.set(l(m),new Set);for(let m of g)for(let A of e.get(m)??[]){if(!p.has(A))continue;let h=l(m),b=l(A);if(h===b)continue;let d=F(h,b),i=u.get(d);i||(i={from:h,to:b,fileEdges:[]},u.set(d,i)),i.fileEdges.push({fromFile:m,toFile:A}),E.get(h).add(b)}let{components:R}=$(E);for(let m of R){if(m.length<2)continue;let A=new Set(m),h=[...u.values()].filter(d=>A.has(d.from)&&A.has(d.to)).map(d=>({from:d.from,to:d.to,fileEdgeCount:d.fileEdges.length,examples:d.fileEdges.slice(0,5)})).sort((d,i)=>d.from.localeCompare(i.from)||d.to.localeCompare(i.to)),b=Math.min(...h.map(d=>d.fileEdgeCount));s.push({boundary:n,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:h,narrowestEdges:h.filter(d=>d.fileEdgeCount===b)})}}return s.sort((n,a)=>a.subUnits.length-n.subUnits.length||n.boundary.localeCompare(a.boundary))}function te(e,r){let t=new Set(r.map(n=>F(n.from,n.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(n=>n.name)),s=[];for(let[n,a]of Object.entries(o))if(c.has(n))for(let l of a)!c.has(l)||t.has(F(n,l))||s.push({from:n,to:l});return s.sort((n,a)=>n.from.localeCompare(a.from)||n.to.localeCompare(a.to))}function oe(e,r,t){let o=[],c=new Map;for(let s of r)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&o.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let n=s.maxFiles??e.maxBoundaryFiles;if(n!==void 0){let a=t.get(s.name)?.size??0;a>n&&o.push({boundary:s.name,kind:"files",observed:a,limit:n})}}return o.sort((s,n)=>s.boundary.localeCompare(n.boundary)||s.kind.localeCompare(n.kind))}function re(e){let r=P(e);return r==="test"||r==="entry"}function ne(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function F(e,r){return`${e}\0${r}`}function ie(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{D as a,C as b,W as c,Fe as d,Ee as e,Se as f,ee as g};
2
+ //# sourceMappingURL=chunk-TAA7HXHE.js.map
@@ -1,2 +1,2 @@
1
- import{a as F,b as A}from"./chunk-ZOXKSQQB.js";import{c as C}from"./chunk-PLYUVM4F.js";import{a as k}from"./chunk-5H5WTJSD.js";import{d as S}from"./chunk-TD7VKJ2Y.js";import{a as y}from"./chunk-7JYHQAH2.js";import{b as p}from"./chunk-GH5YSGZL.js";import{posix as h}from"path";var _=20,G=1,O=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ce(e,n={}){let t=L(n.limit,_),i=L(n.minConsumers,G),r=new C(e),s=r.fileDependencyGraph(n.scope),o=ge(y(e,{includeIgnored:!1})),a=pe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,s,c,n,o,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(me).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:S(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function J(e,n,t){let i=y(e,{scope:n,includeIgnored:!1}),r=L(t,i.length);return i.slice(0,r).map(s=>I(s))}function Q(e,n,t,i,r,s,o){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"exact":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=w([...T(c),...u?T(u):[]]),b=ie(i.unit,c,u,a),g=re(b,i.unit,c,u,a,s,o),j=le(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=ue(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonOwner:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:de(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(F(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return E(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return E(t)}function Z(e,n){let t=p(n),i=y(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:S(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function T(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return w($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=O.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":U(t,"package")?"package-level-shared":U(t,"app")?"app-level-shared":N(t,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function re(e,n,t,i,r,s,o){let a=oe(e,i);if(a)return m(a);let d=fe(n.file),f=se(e,t,d,r,o);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common owner for its consumers.`);let u=ae(c,t,d,o);return u||ce(c,t,d,s,o)}function oe(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function se(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?v(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=l(h.dirname(i[0])),o=H(n,t,s,r);return o?m(o):v(s)}return null}function ae(e,n,t,i){return be(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function ce(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=P(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let s=H(n,t,e,i);return s?m(s):v(e)}function v(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function le(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function ue(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function me(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function ge(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function fe(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function he(e,n,t){let i=x(e),r=x(n);return(M(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function H(e,n,t,i){return l(e)===l(t)||!he(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function pe(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=ye(i);r&&n.add(r)}return n}function ye(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function be(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=p(e);return n===""?".":n}function x(e){let n=p(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function E(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{Ce as a};
2
- //# sourceMappingURL=chunk-IJMD6BRI.js.map
1
+ import{a as F,b as A}from"./chunk-GTZZVLKJ.js";import{c as C}from"./chunk-2BMSSRBH.js";import{a as k}from"./chunk-F5GSBHC6.js";import{d as S}from"./chunk-C7C6AKAT.js";import{a as y}from"./chunk-ZLMXIQLC.js";import{b as p}from"./chunk-JZ2A7LDM.js";import{posix as h}from"path";var _=20,G=1,O=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ce(e,n={}){let t=L(n.limit,_),i=L(n.minConsumers,G),r=new C(e),s=r.fileDependencyGraph(n.scope),o=ge(y(e,{includeIgnored:!1})),a=pe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,s,c,n,o,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(me).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:S(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function J(e,n,t){let i=y(e,{scope:n,includeIgnored:!1}),r=L(t,i.length);return i.slice(0,r).map(s=>I(s))}function Q(e,n,t,i,r,s,o){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"exact":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=w([...T(c),...u?T(u):[]]),b=ie(i.unit,c,u,a),g=re(b,i.unit,c,u,a,s,o),j=le(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=ue(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonOwner:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:de(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(F(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return E(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return E(t)}function Z(e,n){let t=p(n),i=y(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:S(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function T(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return w($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=O.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":U(t,"package")?"package-level-shared":U(t,"app")?"app-level-shared":N(t,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function re(e,n,t,i,r,s,o){let a=oe(e,i);if(a)return m(a);let d=fe(n.file),f=se(e,t,d,r,o);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common owner for its consumers.`);let u=ae(c,t,d,o);return u||ce(c,t,d,s,o)}function oe(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function se(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?v(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=l(h.dirname(i[0])),o=H(n,t,s,r);return o?m(o):v(s)}return null}function ae(e,n,t,i){return be(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function ce(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=P(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let s=H(n,t,e,i);return s?m(s):v(e)}function v(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function le(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function ue(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function me(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function ge(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function fe(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function he(e,n,t){let i=x(e),r=x(n);return(M(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function H(e,n,t,i){return l(e)===l(t)||!he(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function pe(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=ye(i);r&&n.add(r)}return n}function ye(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function be(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=p(e);return n===""?".":n}function x(e){let n=p(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function E(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{Ce as a};
2
+ //# sourceMappingURL=chunk-TJ2JQYT3.js.map