codebaseiq 0.1.0 → 0.2.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 (422) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-DQMDCD24.js → chunk-27PHVDKL.js} +2 -2
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-2DMVFAY7.js} +2 -2
  5. package/dist/{chunk-5PUWMSDU.js → chunk-2E6BTWER.js} +2 -2
  6. package/dist/{chunk-YESXMKX3.js → chunk-2F5ERMNI.js} +2 -2
  7. package/dist/chunk-2VKB5CMA.js +60 -0
  8. package/dist/{chunk-NNJ2KZZG.js → chunk-327YK6TB.js} +4 -4
  9. package/dist/chunk-347TXATM.js +2 -0
  10. package/dist/{chunk-VEXUL62T.js → chunk-35YYZD3D.js} +2 -2
  11. package/dist/chunk-36WRYYTE.js +3 -0
  12. package/dist/chunk-37TKC6MB.js +2 -0
  13. package/dist/{chunk-FAJQ7LWY.js → chunk-3AC56WAR.js} +2 -2
  14. package/dist/{chunk-JE3WZ6II.js → chunk-3NUZVLR7.js} +2 -2
  15. package/dist/{chunk-UZGZB3VB.js → chunk-3XFJUWJE.js} +2 -2
  16. package/dist/{chunk-OVTS4DKB.js → chunk-4AOOSCZ7.js} +2 -2
  17. package/dist/{chunk-LU3BMVH2.js → chunk-4IFISPQW.js} +2 -2
  18. package/dist/chunk-4NHWNAWQ.js +11 -0
  19. package/dist/chunk-4O52YNKL.js +5 -0
  20. package/dist/{chunk-HPJRBHVT.js → chunk-54K6556S.js} +2 -2
  21. package/dist/{chunk-HRWGYWRJ.js → chunk-57GCCPLS.js} +2 -2
  22. package/dist/{chunk-J77SU6VA.js → chunk-57KEZDPT.js} +2 -2
  23. package/dist/{chunk-OFBE4NGP.js → chunk-57KFVPVZ.js} +2 -2
  24. package/dist/{chunk-WOQBZPIF.js → chunk-5BDK6QC3.js} +2 -2
  25. package/dist/{chunk-7MGU3HPH.js → chunk-5IO2APSS.js} +2 -2
  26. package/dist/chunk-5NJPH3QZ.js +61 -0
  27. package/dist/{chunk-GW6Z3WGY.js → chunk-5WXOEJ4G.js} +2 -2
  28. package/dist/chunk-5XEVXVTK.js +3 -0
  29. package/dist/{chunk-RR7SX44N.js → chunk-6OVNYYY4.js} +2 -2
  30. package/dist/{chunk-ZV3JV5G5.js → chunk-6SDEQTVY.js} +2 -2
  31. package/dist/{chunk-EF2R3WNQ.js → chunk-6URCE5QY.js} +2 -2
  32. package/dist/{chunk-UCD3H3UZ.js → chunk-6ZV5EDUT.js} +2 -2
  33. package/dist/{chunk-C6SBF2WH.js → chunk-77GHPR2R.js} +2 -2
  34. package/dist/{chunk-YVCIMIOC.js → chunk-7R64XY4Y.js} +2 -2
  35. package/dist/{chunk-VXYS3FZD.js → chunk-7Z7HCZ7J.js} +2 -2
  36. package/dist/{chunk-CO5R3UNA.js → chunk-A67HT5FR.js} +2 -2
  37. package/dist/{chunk-UDS562V4.js → chunk-A7XQT7MH.js} +2 -2
  38. package/dist/{chunk-RDBI2RXU.js → chunk-ACZDU5GK.js} +2 -2
  39. package/dist/{chunk-FETNQCFO.js → chunk-AM5SUGHF.js} +2 -2
  40. package/dist/{chunk-NNOKTMZT.js → chunk-B2E3HZ2A.js} +2 -2
  41. package/dist/{chunk-CVYSU6BX.js → chunk-BH5CE4LN.js} +2 -2
  42. package/dist/chunk-BLKYYQ7C.js +543 -0
  43. package/dist/{chunk-4WKDMDEW.js → chunk-BX2U3QQV.js} +2 -2
  44. package/dist/{chunk-ZKX2FRS6.js → chunk-CANBLFVQ.js} +2 -2
  45. package/dist/{chunk-SMRBZ6EC.js → chunk-CCRZLRWJ.js} +2 -2
  46. package/dist/chunk-CDWSLAPN.js +21 -0
  47. package/dist/chunk-CIVYHK7U.js +22 -0
  48. package/dist/{chunk-L57ZKWVG.js → chunk-CMXW7MFV.js} +2 -2
  49. package/dist/{chunk-T3DGWPXM.js → chunk-CSZOQ7YO.js} +2 -2
  50. package/dist/{chunk-ZZXSWSN6.js → chunk-CWMHWD56.js} +2 -2
  51. package/dist/{chunk-6NW7MU72.js → chunk-CZEIHYMP.js} +2 -2
  52. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  53. package/dist/{chunk-XWUOUWYI.js → chunk-DFPAZXLU.js} +2 -2
  54. package/dist/{chunk-MOVBWNIP.js → chunk-DKJXK3HA.js} +2 -2
  55. package/dist/{chunk-XMQ23E27.js → chunk-DLC6JDN7.js} +2 -2
  56. package/dist/chunk-DUKHVPU5.js +4 -0
  57. package/dist/{chunk-ID63777H.js → chunk-DVYG3JTA.js} +2 -2
  58. package/dist/{chunk-NE6IU5ZD.js → chunk-EFFMFK7C.js} +2 -2
  59. package/dist/{chunk-I2T2LLK2.js → chunk-EM5UHLAM.js} +2 -2
  60. package/dist/chunk-EN4AHLL3.js +3 -0
  61. package/dist/chunk-EXMVF3JR.js +3 -0
  62. package/dist/{chunk-SWHMHUKF.js → chunk-FEBLLMTL.js} +2 -2
  63. package/dist/chunk-FIXYHQ3W.js +3 -0
  64. package/dist/{chunk-RKEJ6VTF.js → chunk-FLLXYUOL.js} +2 -2
  65. package/dist/{chunk-KWVHSKHK.js → chunk-FPDL2TUB.js} +2 -2
  66. package/dist/chunk-FQA3KIFX.js +17 -0
  67. package/dist/chunk-FWY2PRIF.js +3 -0
  68. package/dist/chunk-FY5V4V4F.js +2 -0
  69. package/dist/chunk-G2XUZCF2.js +88 -0
  70. package/dist/{chunk-QHRNXP3C.js → chunk-GXVDTHFC.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-H3CKAL6P.js} +2 -2
  72. package/dist/chunk-H5QXP63L.js +2 -0
  73. package/dist/{chunk-VUIYB2V3.js → chunk-HBQGKMM3.js} +2 -2
  74. package/dist/{chunk-PYAB5SM6.js → chunk-HBXZAGY6.js} +2 -2
  75. package/dist/{chunk-NNO6A2PO.js → chunk-HCMQZPEO.js} +2 -2
  76. package/dist/{chunk-Q65CQ4XL.js → chunk-HHBBGWES.js} +2 -2
  77. package/dist/{chunk-GTXSJDCO.js → chunk-HIEXRDJF.js} +2 -2
  78. package/dist/{chunk-4FC325IF.js → chunk-HYKSLTAR.js} +2 -2
  79. package/dist/{chunk-XLQ3GLWZ.js → chunk-I2KP4AGR.js} +2 -2
  80. package/dist/chunk-I5FCDTK2.js +2 -0
  81. package/dist/{chunk-QKPLA6IC.js → chunk-I645ZF75.js} +2 -2
  82. package/dist/{chunk-FDGD5AB5.js → chunk-IBM3F2BJ.js} +2 -2
  83. package/dist/{chunk-Q72QSKXC.js → chunk-IEL6Q5W3.js} +38 -38
  84. package/dist/{chunk-NCZUNH3E.js → chunk-IGQQUENU.js} +12 -12
  85. package/dist/chunk-IGYAZPRX.js +4 -0
  86. package/dist/chunk-IOVPAZWP.js +3 -0
  87. package/dist/{chunk-OL6KJP3N.js → chunk-IVJJNVSX.js} +2 -2
  88. package/dist/{chunk-AKB7V7TV.js → chunk-IWAMYGPN.js} +2 -2
  89. package/dist/chunk-IYBIBMPF.js +90 -0
  90. package/dist/{chunk-IOP6FWIM.js → chunk-J24VICI5.js} +2 -2
  91. package/dist/{chunk-C7QOQX32.js → chunk-JN5LIBT3.js} +2 -2
  92. package/dist/{chunk-O6QTXQPJ.js → chunk-JOALNFY3.js} +2 -2
  93. package/dist/{chunk-GCHRX4YW.js → chunk-JUO3Z644.js} +2 -2
  94. package/dist/{chunk-BJ6SQAEN.js → chunk-JXHLB7TP.js} +2 -2
  95. package/dist/{chunk-IJ4HMYBE.js → chunk-JYX5UZSZ.js} +2 -2
  96. package/dist/chunk-K2O7SBAU.js +2 -0
  97. package/dist/{chunk-OLF4MA5W.js → chunk-K5G7SPAG.js} +2 -2
  98. package/dist/{chunk-YSNONTJ2.js → chunk-KDYQQJ6X.js} +2 -2
  99. package/dist/{chunk-7NVGT435.js → chunk-KM4QRWI5.js} +2 -2
  100. package/dist/{chunk-HKQUXIFO.js → chunk-KNV5VFDV.js} +2 -2
  101. package/dist/chunk-L3YSDLNB.js +2 -0
  102. package/dist/{chunk-EZNMUY67.js → chunk-LAGDJXFY.js} +2 -2
  103. package/dist/{chunk-ENCCHKM6.js → chunk-LY2NB5XR.js} +4 -4
  104. package/dist/chunk-M4EVGA5S.js +14 -0
  105. package/dist/chunk-M7LAIM77.js +127 -0
  106. package/dist/{chunk-BVAJLC5A.js → chunk-MRGTCMDK.js} +2 -2
  107. package/dist/{chunk-OZYRSMSH.js → chunk-MT5W4DUG.js} +2 -2
  108. package/dist/{chunk-VE5AVNMP.js → chunk-MTMF4N7F.js} +2 -2
  109. package/dist/chunk-N3Q3AWGW.js +545 -0
  110. package/dist/{chunk-TXXOEMZJ.js → chunk-NDGTJHQN.js} +2 -2
  111. package/dist/chunk-NIO346UL.js +2 -0
  112. package/dist/chunk-NJA4MMBD.js +2 -0
  113. package/dist/{chunk-7FND7D7N.js → chunk-NK76RSB6.js} +2 -2
  114. package/dist/{chunk-H3LGFZVK.js → chunk-NTRW52UR.js} +2 -2
  115. package/dist/{chunk-JOIRNPPY.js → chunk-OJFLPVBP.js} +2 -2
  116. package/dist/{chunk-KMITESMT.js → chunk-OMBRP7BB.js} +2 -2
  117. package/dist/{chunk-UP3BUZR5.js → chunk-OVKZM2XI.js} +2 -2
  118. package/dist/{chunk-MVB3DAEY.js → chunk-PARCKE3Q.js} +2 -2
  119. package/dist/{chunk-CAUCPUOF.js → chunk-PFPHS4NO.js} +2 -2
  120. package/dist/chunk-PHPQ24UG.js +22 -0
  121. package/dist/chunk-PLZXWZHY.js +77 -0
  122. package/dist/{chunk-34WBMAYK.js → chunk-PNVZIJ57.js} +2 -2
  123. package/dist/{chunk-SYDJMPES.js → chunk-QKVTWODE.js} +2 -2
  124. package/dist/{chunk-FW53T7EB.js → chunk-QLTFXVUI.js} +2 -2
  125. package/dist/{chunk-PBI2LFKH.js → chunk-QMGWSEPL.js} +2 -2
  126. package/dist/{chunk-CQP3THUZ.js → chunk-QVHZB75Z.js} +2 -2
  127. package/dist/{chunk-6BQ3DSPK.js → chunk-QVWDQTMG.js} +2 -2
  128. package/dist/{chunk-ST7V3SKN.js → chunk-RCPZOPV6.js} +2 -2
  129. package/dist/chunk-RJWAB4VR.js +345 -0
  130. package/dist/chunk-RRPK327J.js +20 -0
  131. package/dist/chunk-RVYLJDXC.js +21 -0
  132. package/dist/chunk-RWKEXCHU.js +3 -0
  133. package/dist/{chunk-L4NRUAGJ.js → chunk-S5SKXCND.js} +2 -2
  134. package/dist/{chunk-RBAS5ZHI.js → chunk-S64NCE2Z.js} +2 -2
  135. package/dist/{chunk-WMPRTGH2.js → chunk-SF34QLK2.js} +2 -2
  136. package/dist/{chunk-ANFVSJWQ.js → chunk-SJZQ2PTZ.js} +2 -2
  137. package/dist/{chunk-4XTAUQFD.js → chunk-SRY26ITJ.js} +2 -2
  138. package/dist/chunk-SV2LEFVM.js +2 -0
  139. package/dist/{chunk-7XAN6GKB.js → chunk-T3YFIJ5P.js} +2 -2
  140. package/dist/chunk-T55YPJGB.js +3 -0
  141. package/dist/chunk-TAJ6UGCO.js +21 -0
  142. package/dist/{chunk-PIOMTC27.js → chunk-TUTSO7UZ.js} +2 -2
  143. package/dist/{chunk-FQKZWM4L.js → chunk-U24M5RQM.js} +5 -5
  144. package/dist/{chunk-XME3HPXZ.js → chunk-U2XX3BT4.js} +2 -2
  145. package/dist/{chunk-SZD2KF7Q.js → chunk-UWB5WMC2.js} +2 -2
  146. package/dist/{chunk-6CS3UQTN.js → chunk-VCL7FK3E.js} +2 -2
  147. package/dist/{chunk-N3IQCBCF.js → chunk-VCWAJPXQ.js} +2 -2
  148. package/dist/{chunk-LZYFLFEH.js → chunk-VG55NFXF.js} +2 -2
  149. package/dist/{chunk-PTAWHLVJ.js → chunk-VLTUX4IF.js} +2 -2
  150. package/dist/{chunk-JEJLSICM.js → chunk-VVCBMH5O.js} +2 -2
  151. package/dist/{chunk-JSOYNVWH.js → chunk-VYZQZ4ZN.js} +2 -2
  152. package/dist/chunk-W3FK73MD.js +8 -0
  153. package/dist/{chunk-UNBY47BC.js → chunk-W6C6QTXJ.js} +2 -2
  154. package/dist/chunk-WH5SYOMD.js +2 -0
  155. package/dist/chunk-WJOQC4P7.js +7 -0
  156. package/dist/chunk-WO47BIPY.js +3 -0
  157. package/dist/chunk-WOOTEWQT.js +239 -0
  158. package/dist/{chunk-UBGWN7I4.js → chunk-X5I2BQGX.js} +2 -2
  159. package/dist/{chunk-PX4RYAAK.js → chunk-XNUWRTYM.js} +2 -2
  160. package/dist/{chunk-ICFDQHAM.js → chunk-XUJM6474.js} +2 -2
  161. package/dist/chunk-XYLV727H.js +21 -0
  162. package/dist/{chunk-TRRC4ZJ7.js → chunk-YFQPWKHR.js} +2 -2
  163. package/dist/{chunk-NEDP5RFQ.js → chunk-YIOQJ45A.js} +2 -2
  164. package/dist/{chunk-Y6KHROC3.js → chunk-YXJ4IAHH.js} +2 -2
  165. package/dist/chunk-YYFV32WR.js +3 -0
  166. package/dist/{chunk-BH5F2Q4O.js → chunk-ZB3V5QM7.js} +2 -2
  167. package/dist/chunk-ZJZQ7Q2Q.js +3 -0
  168. package/dist/{chunk-EMNIHCRB.js → chunk-ZNQCR656.js} +2 -2
  169. package/dist/{chunk-TIIC3ZE7.js → chunk-ZOEDRCR4.js} +2 -2
  170. package/dist/cli-context-TSADTXLB.js +2 -0
  171. package/dist/cli-context-XEPPF4RX.js +3 -0
  172. package/dist/cli-program-KJGQEM72.js +7 -0
  173. package/dist/cli.js +1 -1
  174. package/dist/{code-DlqpBDd0.d.ts → code-CDe-mIjx.d.ts} +1 -1
  175. package/dist/code-viewer-YGDON6SY.js +12 -0
  176. package/dist/code-viewer-ZCTHXQ5C.js +11 -0
  177. package/dist/command-descriptors-5VAB2MZX.js +335 -0
  178. package/dist/command-descriptors-EAHKIRAG.js +337 -0
  179. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  180. package/dist/{db-D7sauVFH.d.ts → db-DmRNdCtm.d.ts} +1 -1
  181. package/dist/direct-navigation-B3SGOOBW.js +2 -0
  182. package/dist/direct-navigation-ZL362KXF.js +3 -0
  183. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-Bs54NWws.d.ts} +1 -1
  184. package/dist/{health-DJaZXg8I.d.ts → health-BnzbSLCE.d.ts} +1 -1
  185. package/dist/index.d.ts +2 -2
  186. package/dist/index.js +1 -1
  187. package/dist/invocation-command-descriptors-CSUGUHTT.js +2 -0
  188. package/dist/invocation-command-descriptors-PPVZOIE5.js +3 -0
  189. package/dist/output-continuation-command-FTVVBVSN.js +2 -0
  190. package/dist/output-continuation-command-ITPRC3YV.js +3 -0
  191. package/dist/project-reindex-7HZSLLLY.js +3 -0
  192. package/dist/project-reindex-NGM3DYBN.js +2 -0
  193. package/dist/queries/affected.d.ts +2 -2
  194. package/dist/queries/affected.js +1 -1
  195. package/dist/queries/anchors.d.ts +2 -2
  196. package/dist/queries/anchors.js +1 -1
  197. package/dist/queries/architecture.d.ts +2 -2
  198. package/dist/queries/architecture.js +1 -1
  199. package/dist/queries/bottlenecks.d.ts +2 -2
  200. package/dist/queries/bottlenecks.js +1 -1
  201. package/dist/queries/by-kind.d.ts +2 -2
  202. package/dist/queries/by-kind.js +1 -1
  203. package/dist/queries/call-graph.d.ts +2 -2
  204. package/dist/queries/call-graph.js +1 -1
  205. package/dist/queries/change-surface.d.ts +2 -2
  206. package/dist/queries/change-surface.js +1 -1
  207. package/dist/queries/cleanup-plan.d.ts +2 -2
  208. package/dist/queries/cleanup-plan.js +1 -1
  209. package/dist/queries/co-change.d.ts +2 -2
  210. package/dist/queries/co-change.js +1 -1
  211. package/dist/queries/code.d.ts +3 -3
  212. package/dist/queries/code.js +1 -1
  213. package/dist/queries/complexity-hotspots.d.ts +2 -2
  214. package/dist/queries/complexity-hotspots.js +1 -1
  215. package/dist/queries/complexity.d.ts +2 -2
  216. package/dist/queries/complexity.js +1 -1
  217. package/dist/queries/context.d.ts +2 -2
  218. package/dist/queries/context.js +1 -1
  219. package/dist/queries/convergence.d.ts +2 -2
  220. package/dist/queries/convergence.js +1 -1
  221. package/dist/queries/coupling.d.ts +2 -2
  222. package/dist/queries/coupling.js +1 -1
  223. package/dist/queries/cycles.d.ts +2 -2
  224. package/dist/queries/cycles.js +1 -1
  225. package/dist/queries/dataflow.d.ts +2 -2
  226. package/dist/queries/dataflow.js +1 -1
  227. package/dist/queries/dead.d.ts +2 -2
  228. package/dist/queries/dead.js +1 -1
  229. package/dist/queries/decorative-checkers.d.ts +2 -2
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.d.ts +2 -2
  232. package/dist/queries/deep-chains.js +1 -1
  233. package/dist/queries/dependence-slice.d.ts +3 -3
  234. package/dist/queries/dependence-slice.js +1 -1
  235. package/dist/queries/dependency-depth.d.ts +2 -2
  236. package/dist/queries/dependency-depth.js +1 -1
  237. package/dist/queries/deps.d.ts +2 -2
  238. package/dist/queries/deps.js +1 -1
  239. package/dist/queries/diff-impact.d.ts +2 -2
  240. package/dist/queries/diff-impact.js +1 -1
  241. package/dist/queries/doc-drift.d.ts +2 -2
  242. package/dist/queries/doc-drift.js +1 -1
  243. package/dist/queries/drift.d.ts +2 -2
  244. package/dist/queries/drift.js +1 -1
  245. package/dist/queries/duplicate-bodies.d.ts +2 -2
  246. package/dist/queries/duplicate-bodies.js +1 -1
  247. package/dist/queries/entry-map.d.ts +2 -2
  248. package/dist/queries/entry-map.js +1 -1
  249. package/dist/queries/evidence.d.ts +3 -3
  250. package/dist/queries/evidence.js +1 -1
  251. package/dist/queries/extract-candidates.d.ts +2 -2
  252. package/dist/queries/extract-candidates.js +1 -1
  253. package/dist/queries/fan.d.ts +2 -2
  254. package/dist/queries/fan.js +1 -1
  255. package/dist/queries/files.d.ts +2 -2
  256. package/dist/queries/files.js +1 -1
  257. package/dist/queries/health.d.ts +3 -3
  258. package/dist/queries/health.js +1 -1
  259. package/dist/queries/hierarchy.d.ts +2 -2
  260. package/dist/queries/hierarchy.js +1 -1
  261. package/dist/queries/hotspots.d.ts +2 -2
  262. package/dist/queries/hotspots.js +1 -1
  263. package/dist/queries/imports.d.ts +2 -2
  264. package/dist/queries/imports.js +1 -1
  265. package/dist/queries/incomplete-migration.d.ts +2 -2
  266. package/dist/queries/incomplete-migration.js +1 -1
  267. package/dist/queries/index.d.ts +5 -5
  268. package/dist/queries/index.js +1 -1
  269. package/dist/queries/isolated.d.ts +2 -2
  270. package/dist/queries/isolated.js +1 -1
  271. package/dist/queries/locality-candidates.d.ts +2 -2
  272. package/dist/queries/locality-candidates.js +1 -1
  273. package/dist/queries/members.d.ts +2 -2
  274. package/dist/queries/members.js +1 -1
  275. package/dist/queries/methods.d.ts +2 -2
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.d.ts +2 -2
  278. package/dist/queries/not-implemented.js +1 -1
  279. package/dist/queries/outline.d.ts +2 -2
  280. package/dist/queries/outline.js +1 -1
  281. package/dist/queries/passthrough-candidates.d.ts +2 -2
  282. package/dist/queries/passthrough-candidates.js +1 -1
  283. package/dist/queries/plan-context.d.ts +2 -2
  284. package/dist/queries/plan-context.js +1 -1
  285. package/dist/queries/react-component-duplicates.d.ts +2 -2
  286. package/dist/queries/react-component-duplicates.js +1 -1
  287. package/dist/queries/react-hook-candidates.d.ts +2 -2
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  290. package/dist/queries/react-large-component-pressure.js +1 -1
  291. package/dist/queries/recent-duplicates.d.ts +2 -2
  292. package/dist/queries/recent-duplicates.js +1 -1
  293. package/dist/queries/redundant-reexports.d.ts +2 -2
  294. package/dist/queries/redundant-reexports.js +1 -1
  295. package/dist/queries/reference-neighborhood.d.ts +2 -2
  296. package/dist/queries/reference-neighborhood.js +1 -1
  297. package/dist/queries/reference-reachability.d.ts +2 -2
  298. package/dist/queries/reference-reachability.js +1 -1
  299. package/dist/queries/refs.d.ts +2 -2
  300. package/dist/queries/refs.js +1 -1
  301. package/dist/queries/self-audit.d.ts +2 -2
  302. package/dist/queries/self-audit.js +1 -1
  303. package/dist/queries/similar-chains.d.ts +2 -2
  304. package/dist/queries/similar-chains.js +1 -1
  305. package/dist/queries/similar-files.d.ts +2 -2
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.d.ts +2 -2
  308. package/dist/queries/similar-signatures.js +1 -1
  309. package/dist/queries/similar.d.ts +2 -2
  310. package/dist/queries/similar.js +1 -1
  311. package/dist/queries/slice.d.ts +2 -2
  312. package/dist/queries/slice.js +1 -1
  313. package/dist/queries/source-inspection.d.ts +4 -4
  314. package/dist/queries/source-inspection.js +1 -1
  315. package/dist/queries/source-search.d.ts +2 -2
  316. package/dist/queries/source-search.js +1 -1
  317. package/dist/queries/stale-abstractions.d.ts +2 -2
  318. package/dist/queries/stale-abstractions.js +1 -1
  319. package/dist/queries/stats.d.ts +2 -2
  320. package/dist/queries/surface.d.ts +2 -2
  321. package/dist/queries/surface.js +1 -1
  322. package/dist/queries/symbols.d.ts +2 -2
  323. package/dist/queries/symbols.js +1 -1
  324. package/dist/queries/system-map.d.ts +2 -2
  325. package/dist/queries/system-map.js +1 -1
  326. package/dist/queries/system.d.ts +2 -2
  327. package/dist/queries/system.js +1 -1
  328. package/dist/queries/test-quality.d.ts +2 -2
  329. package/dist/queries/test-quality.js +1 -1
  330. package/dist/queries/trace.d.ts +2 -2
  331. package/dist/queries/trace.js +1 -1
  332. package/dist/queries/twin-ab.d.ts +2 -2
  333. package/dist/queries/twin-ab.js +1 -1
  334. package/dist/queries/twin-drift.d.ts +2 -2
  335. package/dist/queries/twin-drift.js +1 -1
  336. package/dist/queries/unused-imports.d.ts +2 -2
  337. package/dist/queries/unused-imports.js +1 -1
  338. package/dist/queries/unused-params.d.ts +2 -2
  339. package/dist/queries/unused-params.js +1 -1
  340. package/dist/queries/value-flow.d.ts +3 -3
  341. package/dist/queries/value-flow.js +1 -1
  342. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  343. package/dist/queries/vue-component-duplicates.js +1 -1
  344. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  345. package/dist/queries/vue-composable-candidates.js +1 -1
  346. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  347. package/dist/queries/vue-large-view-pressure.js +1 -1
  348. package/dist/queries/wrapper-candidates.d.ts +2 -2
  349. package/dist/queries/wrapper-candidates.js +1 -1
  350. package/dist/reindex-worker.js +1 -1
  351. package/dist/reindex.d.ts +3 -3
  352. package/dist/reindex.js +31 -31
  353. package/dist/runtime.d.ts +24 -4
  354. package/dist/runtime.js +3 -3
  355. package/dist/rust-semantic-session-server.js +1 -1
  356. package/dist/rust-semantic-session-worker.js +1 -1
  357. package/dist/rust-semantic-worker.js +1 -1
  358. package/dist/{scip-cli-B7N3haxa.d.ts → scip-cli-BRFKkHQn.d.ts} +1 -1
  359. package/dist/sentinel-ensure-command-KYYULCFU.js +2 -0
  360. package/dist/sentinel-ensure-command-RIZA3RY7.js +3 -0
  361. package/dist/sentinel-hook.js +39 -0
  362. package/dist/sentinel-worker.js +16 -0
  363. package/dist/typescript-mailbox-worker.js +1 -1
  364. package/dist/watch-server.js +6 -6
  365. package/docs/COMMAND_REFERENCE.md +5 -3
  366. package/docs/schemas/project-config.schema.json +159 -0
  367. package/package.json +9 -5
  368. package/skills/codebaseiq/SKILL.md +1 -1
  369. package/skills/concrete-plan/SKILL.md +1 -1
  370. package/ui/view/api.js +450 -0
  371. package/ui/view/app.js +394 -0
  372. package/ui/view/builder.js +323 -0
  373. package/ui/view/file-panel.js +170 -0
  374. package/ui/view/focus.js +379 -0
  375. package/ui/view/index.html +54 -0
  376. package/ui/view/map.js +424 -0
  377. package/ui/view/styles.css +1125 -0
  378. package/dist/chunk-2X7V4HS4.js +0 -88
  379. package/dist/chunk-3IER7Q6H.js +0 -12
  380. package/dist/chunk-3JSXXYTZ.js +0 -345
  381. package/dist/chunk-476NR5B7.js +0 -2
  382. package/dist/chunk-5VKBFZZU.js +0 -3
  383. package/dist/chunk-ADTBPVUZ.js +0 -21
  384. package/dist/chunk-BFFZDZQV.js +0 -2
  385. package/dist/chunk-BMYOV5GP.js +0 -77
  386. package/dist/chunk-C74PPYLA.js +0 -3
  387. package/dist/chunk-CWONGW6P.js +0 -3
  388. package/dist/chunk-DDZ7VHWV.js +0 -20
  389. package/dist/chunk-DR2LURYU.js +0 -3
  390. package/dist/chunk-ECQBG7PW.js +0 -564
  391. package/dist/chunk-FM5BPL4V.js +0 -60
  392. package/dist/chunk-G6XFR4ZL.js +0 -4
  393. package/dist/chunk-GTIYTDRE.js +0 -562
  394. package/dist/chunk-HOA5YGOH.js +0 -3
  395. package/dist/chunk-KUW32IRO.js +0 -2
  396. package/dist/chunk-LTA3BRZX.js +0 -2
  397. package/dist/chunk-NAUD7LCA.js +0 -2
  398. package/dist/chunk-OGTFJ3XD.js +0 -2
  399. package/dist/chunk-Q5ELPRKQ.js +0 -2
  400. package/dist/chunk-QCN62RTF.js +0 -3
  401. package/dist/chunk-QW7EP6WI.js +0 -21
  402. package/dist/chunk-RU65DDUP.js +0 -215
  403. package/dist/chunk-SELM5MER.js +0 -2
  404. package/dist/chunk-SNNWPCN7.js +0 -4
  405. package/dist/chunk-TFZB6XTM.js +0 -239
  406. package/dist/chunk-UXM43C7T.js +0 -3
  407. package/dist/chunk-VFY6Y2H6.js +0 -61
  408. package/dist/chunk-WE5RZHZ7.js +0 -5
  409. package/dist/chunk-Z54RD7VL.js +0 -3
  410. package/dist/cli-context-3SNLDYBM.js +0 -3
  411. package/dist/cli-context-T3B7W6GG.js +0 -2
  412. package/dist/cli-program-YNOXO72B.js +0 -7
  413. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  414. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  415. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  416. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  417. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  418. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  419. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  420. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  421. package/dist/project-reindex-5JOKXAXT.js +0 -2
  422. package/dist/project-reindex-UQBIKO4M.js +0 -3
@@ -0,0 +1,20 @@
1
+ import{m as u,r as p,t as h}from"./chunk-6ZV5EDUT.js";import{a as c,e as d}from"./chunk-PLZXWZHY.js";import{h as l}from"./chunk-327YK6TB.js";import b from"better-sqlite3";var f=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],i=class{constructor(t,e){this.connection=t;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(t){try{for(let e of f)this.connection.pragma(e);t(this.connection)}catch(e){try{this.close()}catch(n){throw new AggregateError([e,n],"SQLite initialization and rollback both failed.",{cause:n})}throw e}}close(){if(!this.active)return;this.active=!1;let t,e;try{this.connection.close()}catch(n){t=n}try{this.releaseGenerationReader()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"SQLite connection close and generation-reader release both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}},g=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".codebaseiq-cache","__pycache__",".venv","venv"],m=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;closed=!1;constructor(t,e){this.config=t,this.pathFilter=e??null;let n=S(t),o=new i(n.db,n.release);try{o.initialize(E),this.generation=n.generation,this.connection=n.db,this.connectionOwnership=o,this.db=w(n.db)}catch(r){try{o.close()}catch(s){throw new AggregateError([r,s],"SQLite construction and rollback both failed.",{cause:s})}throw r}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
2
+ EXISTS (
3
+ SELECT 1
4
+ FROM defn_enclosing_ranges local_der
5
+ JOIN documents local_d ON local_der.document_id = local_d.id
6
+ WHERE local_der.symbol_id = gs.id
7
+ ${this.pathExclusionsFor("local_d").trimStart()}
8
+ )
9
+ OR EXISTS (
10
+ SELECT 1
11
+ FROM mentions local_m
12
+ JOIN chunks local_c ON local_m.chunk_id = local_c.id
13
+ JOIN documents local_d ON local_c.document_id = local_d.id
14
+ WHERE local_m.symbol_id = gs.id
15
+ AND local_m.role = 1
16
+ ${this.pathExclusionsFor("local_d").trimStart()}
17
+ )
18
+ )`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>g.flatMap(n=>[`AND ${e}.relative_path NOT LIKE '${n}/%'`,`AND ${e}.relative_path NOT LIKE '%/${n}/%'`])).join(`
19
+ `)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){if(this.closed)return;this.closed=!0,this.statementCache.clear();let t,e;try{d(this)}catch(n){t=n}try{this.connectionOwnership.close()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"Database-owned resource and SQLite connection cleanup both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}statement(t){let e=this.statementCache.get(t);return e||(e=this.connection.prepare(t),this.statementCache.set(t,e)),e}};function w(a){return Object.freeze({prepare(t){let e=a.prepare(t);if(!e.readonly||!e.reader)throw new Error("ScipDatabase.db only permits read-only statements that return rows.");return y(e)}})}function y(a){let t={get:(...e)=>a.get(...e),all:(...e)=>a.all(...e),iterate:(...e)=>a.iterate(...e),pluck(e){return e===void 0?a.pluck():a.pluck(e),t},expand(e){return e===void 0?a.expand():a.expand(e),t},raw(e){return e===void 0?a.raw():a.raw(e),t},bind(...e){return a.bind(...e),t},columns:()=>a.columns(),safeIntegers(e){return e===void 0?a.safeIntegers():a.safeIntegers(e),t}};return Object.freeze(t)}function E(a){if(!a.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=a.prepare("SELECT relative_path FROM documents").iterate();for(let n of e)l(n.relative_path)}function S(a){for(let t=0;t<4;t+=1){let e=u(a),n=e.generation,o;try{o=new b(c(n.databasePath),{readonly:!0,fileMustExist:!0})}catch(r){throw e.release(),r}if(n.source==="immutable")return{db:o,generation:n,release:e.release};try{let r=p(a);if(n.databaseFileIdentity===h(n.databasePath)&&r.source==="legacy"&&r.identity===n.identity&&r.databaseFileIdentity===n.databaseFileIdentity&&r.metadataRaw===n.metadataRaw)return{db:o,generation:n,release:e.release}}catch(r){throw o.close(),e.release(),r}o.close(),e.release()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{m as a};
20
+ //# sourceMappingURL=chunk-RRPK327J.js.map
@@ -0,0 +1,21 @@
1
+ import{g as L,h as X,i as F,j as _e,k as Fe,l as Le,r as Pe,s as y,t as Ee,v as Ae,w as g,x as we}from"./chunk-PLZXWZHY.js";import{H,c as v}from"./chunk-327YK6TB.js";import{basename as Re}from"path";var It=L("indexed-document-paths",{clearGroups:["whole-project"]});function O(e,t={}){let n=Vt(t);return[...It.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${e.pathExclusionsFor("documents")}
5
+ ${o}
6
+ ${s}
7
+ ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function Vt(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function Mo(e,t,n){let r=Ve(t);if(!r)return[];let o=e.all(`SELECT relative_path
8
+ FROM documents
9
+ WHERE relative_path = ?
10
+ ${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Ie(c.relative_path,r)}));if(o.length>0)return o;let s=O(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Ie(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Ie(e,t){let n=Ve(e),r=Re(n),o=Re(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Ve(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as je}from"path";var jt={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function D(e){return jt[je(e).toLowerCase()]??null}function ce(e){return je(e).toLowerCase()===".vue"}import{createRequire as Bt}from"module";var d=Bt(import.meta.url),J=null,Be=!1;function $t(){if(Be)return null;if(J)return J;try{return J=d("tree-sitter"),J}catch{return Be=!0,null}}var $e=new Map,Z=new Set;function Ot(e){if(Z.has(e))return null;let t=$e.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Z.add(e),null}}catch{return Z.add(e),null}return $e.set(e,n),n}var Oe=new Map;function Dt(e){let t=Oe.get(e);if(t)return t;let n=Ot(e);if(!n)return null;let r=$t();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return Z.add(e),null}return Oe.set(e,o),o}function Wt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function P(e,t){let n=Dt(e);if(!n)return null;try{return Wt(n,t)}catch{return null}}import{posix as le}from"path";import{parse as Ut}from"@vue/compiler-sfc";var Mt=F("vue-sfc-units");function R(e,t){let n=Ue(t),r=g(e,n);return Mt.get(e,n,r,()=>ue(e,n,r))}function Ue(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function zt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function E(e){return!e||e.body.length===0?0:e.body.split(`
11
+ `).length}function ue(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Ut(n,{filename:t})}catch(i){return r.errors.push(We(i)),r}r.errors.push(...o.errors.map(We));let{descriptor:s}=o;return s.template&&(r.template=G(e,t,"template",s.template)),s.script&&r.scripts.push(De(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(De(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>G(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>G(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function De(e,t,n,r){let o=G(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:zt(o.lang)}}function G(e,t,n,r){let o=Ht(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=qt(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
12
+ `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function qt(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Ue(le.normalize(le.join(le.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Ht(e){return{...e}}function We(e){return e instanceof Error?e.message:String(e)}function pe(e,t,n){let o=ue(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
13
+ `.repeat(i.startLine)}${i.body}`).join(`
14
+ `),startLine:0,language:s}:null}var Me=_e("ast-trees",{clearGroups:["whole-project","source-file"]});function ze(e,t){if(ce(t))return Xt(e,t);let n=D(t);if(!n)return null;let r=g(e,t);return r?Me.get(e,t,r,()=>P(n,r)):null}function as(e,t,n){if(ce(t)){let s=pe(e,t,n);if(!s)return null;let i=P(s.language,`
15
+ `.repeat(s.startLine)+s.body);return i?{tree:i,language:s.language}:null}let r=D(t);if(!r)return null;let o=P(r,n);return o?{tree:o,language:r}:null}function Xt(e,t){let n=g(e,t);return n?Me.get(e,t,n,()=>{let r=pe(e,t,n);if(!r)return null;let o=`
16
+ `.repeat(r.startLine)+r.body;return P(r.language,o)}):null}import{readdirSync as Jt}from"fs";import{execFileSync as Zt}from"child_process";import{extname as K,join as Gt}from"path";var Kt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],ds=[".vue"],qe=[".tsx",".jsx"],He=[".vue"],Qt=[...qe,...He],Yt=new Set(qe),en=new Set(He),Xe=new Set(Kt.map(e=>e.toLowerCase())),tn=[...Xe].sort().join(","),Je=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function W(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):Xe,i=o?[...s].sort().join(","):tn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return nn.get(e,a,()=>{let c=new Set;if(n)for(let l of O(e,{includeIgnored:!1}))s.has(K(l).toLowerCase())&&c.add(l);if(r)for(let l of rn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function gs(e,t={}){let n=!1,r=!1;for(let o of W(e,{extensions:Qt})){if(t.scope&&!o.includes(t.scope))continue;let s=K(o).toLowerCase();if(n||=Yt.has(s),r||=en.has(s),n&&r)break}return{react:n,vue:r}}var nn=L("source-files",{clearGroups:[]});function rn(e,t){return on(e,t)??an(e,t)}function on(e,t){try{let n=Zt("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Set;for(let o of n.split(`
17
+ `)){let s=o.trim();s&&(sn(s)||t.has(K(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function sn(e){return e.split("/").some(t=>Je.has(t))}function an(e,t){let n=new Set,r=o=>{let s=o?Gt(e,o):e,i;try{i=Jt(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!Je.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(K(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as fn}from"path";function Y(e,t){let n=ln(e,t);if(!n)return null;let r=Q(n);if(!r)return null;let o=un(n);return{calleeLeaf:r,calleeQualifier:o?cn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function cn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function ln(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function un(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Q(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Q(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"super":case"self":case"this":return null;default:return null}}var pn=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function ee(e){return e.length<=2||pn.has(e)}var mn=[".tsx",".jsx"],Ze=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),dn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),gn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),hn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Sn=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),yn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),xn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),vn=F("react-component-behavior-profiles"),Ge=Ee({kind:"react-component-behavior-profiles",invalidation:Ae("react-component-behavior-profiles"),serialize:kn,deserialize:Tn});function et(e,t={}){let n=W(e,{extensions:mn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>me(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function me(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return vn.get(e,n,r,()=>Nn(e,n,r)).map(bn)}function Nn(e,t,n){let r=Le(e,t,n),o=Ge.read(e,t,r);if(o)return o;let s=Cn(e,t);return Ge.write(e,t,r,s),s}function Cn(e,t){let n=Fn(t);if(!n)return[];let r=ze(e,t);if(!r)return[];let o=we(e,t).length;return Ln(r.rootNode,n).filter(i=>i.kind==="hook"||de(i.bodyNode)).map(i=>{let a=Vn(i.bodyNode),c=Dn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function bn(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function kn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Tn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=_n(r);if(!o)return null;n.push(o)}return n}catch{return null}}function _n(e){if(!Pe(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:B,hookNames:ie,requestNames:ae,stateNames:m,effectNames:C,handlerNames:$}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!te(o)||!te(s)||!te(i)||!te(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(ie),requestNames:y(ae),stateNames:y(m),effectNames:y(C),handlerNames:y($)};return Object.values(S).some(Rt=>Rt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function te(e){return typeof e=="number"&&Number.isFinite(e)}function Fn(e){let t=fn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:D(e)}function Ln(e,t){let n=[],r=new Set,o=s=>{let i=Pn(s);if(i&&(!Rn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function Pn(e){if(e.type==="class_declaration"){let s=fe(e);if(!s||!/^[A-Z]/.test(s))return null;let i=En(e);return!i||!An(e)&&!de(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=fe(e);return!s||!Ke(s)?null:{name:s,kind:Qe(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=U(t);if(!r||!n||!Ke(r))return null;let o=wn(n);return o?{name:r,kind:Qe(r),node:e,bodyNode:o}:null}function En(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function An(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Ke(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function Qe(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function wn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=In(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Rn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function fe(e){return U(e.childForFieldName("name")??e.namedChild(0))}function In(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function de(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(de)}function Vn(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?jn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Bn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function jn(e,t){let n=$n(e),r=!1;if(n){let o=Ye(n),s=o==="Fragment"||o==="React.Fragment";r=qn(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=On(o);if(!s)continue;let i=Ye(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else xn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(tt(o))}function Bn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(tt(e)),nt(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Hn(n))ee(r)||t.tokens.add(`binding:${r}`)}function tt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function nt(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(nt)}function $n(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function On(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Dn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=Y(o,t);s&&Wn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")Mn(o,n);else if(o.type==="function_declaration"){let s=fe(o);s&&rt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function Wn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Ze.has(e)&&!hn.has(e)&&t.tokens.add(`hook:${e}`)),Ze.has(e)&&t.tokens.add(`react-hook:${e}`),dn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),gn.has(e)&&t.tokens.add(`state-hook:${e}`),Un(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function Un(e){if(Sn.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Mn(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>U(a)),i=U(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=U(n);o&&rt(o,t)}function rt(e,t){let n=zn(e);!n||!yn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function zn(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function qn(e){return/^[A-Z]/.test(e)||e.includes(".")}function Ye(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function U(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Hn(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}function M(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Xn=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),ot=new Set(["arrow_function","function_expression","generator_function"]);function Jn(e,t){let n=Qn(e,t);if(n)return n;if(!Kn(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,definitionNode:e,functionNode:e}:null}function it(e,t){let n=Jn(e,t);if(!n)return null;let{definitionNode:r,functionNode:o}=n;return{name:n.name,startLine:r.startPosition.row,endLine:r.endPosition.row,paramCount:Yn(o),params:Zn(o),paramsEndLine:Gn(o),isLiteralPassthrough:er(o,t)}}function at(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Zn(e){let t=at(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(M(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function Gn(e){let t=at(e);return t?t.endPosition.row:e.startPosition.row}function Kn(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?Xn.has(e):!1}function Qn(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=st(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=st(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function st(e){if(ot.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>ot.has(o.type));return r.length===1?r[0]:null}function Yn(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)M(r)||(n+=1);return n}function er(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!M(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!M(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}var tr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),nr=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),rr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),or=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),sr=new Set(["catch","for","function","if","return","switch","while"]);function re(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=E(n),n.external&&(t.externalLineCount+=E(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...lr(n));let r=P(n.astLanguage,n.body);r?ar(n,r.rootNode,t):cr(n,t)}return ir(t),t.externalScriptPaths=lt(t.externalScriptPaths),t}function ir(e){e.composables=I(e,"composable"),e.stores=I(e,"store"),e.reactivity=I(e,"reactivity"),e.lifecycle=I(e,"lifecycle"),e.requests=I(e,"request"),e.macros=I(e,"macro")}function I(e,t){return lt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function ar(e,t,n){let r=new Set,o=new Set,s=i=>{let a=it(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Y(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:ct(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function cr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||sr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+ne(e.body,n.index??0),categories:ct(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+ne(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function lr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+ne(e.body,n.index??0);for(let i of ur(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function ur(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function ct(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),tr.has(e)&&t.push("reactivity"),nr.has(e)&&t.push("lifecycle"),rr.has(e)&&t.push("request"),or.has(e)&&t.push("macro"),t}function ne(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function lt(e){return[...new Set(e)].sort()}import{ElementTypes as pr,NodeTypes as ge,parse as fr}from"@vue/compiler-dom";import{parse as Us}from"@vue/compiler-sfc";function ut(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var mr=F("vue-template-facts"),dr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),gr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),hr=new Set(["div","span","template"]),Sr=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function oe(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return mr.get(e,n,r,()=>yr(n,R(e,n).template))}function yr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=fr(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return ft(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function ft(e,t,n,r){for(let o of e)if(o.type===ge.ELEMENT)xr(o,t,n,r),ft(o.children,t,n,r);else if(o.type===ge.INTERPOLATION){r("interpolation");let s=he(o.content);s&&mt(s,t,o.loc.start.line,n,r)}}function xr(e,t,n,r){let o=_r(e.tag),s={tag:e.tag,normalized:o,kind:Tr(e),startLine:V(t,e.loc.start.line),endLine:V(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),hr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)vr(i,t,n,r)}function vr(e,t,n,r){if(e.type===ge.ATTRIBUTE){let a=e.value?.content??null,c=pt("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Cr(e),s=he(e.exp),i=pt(Nr(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&mt(s,t,e.loc.start.line,n,r)}function pt(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:V(r,o),endLine:V(r,s)}}function Nr(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Cr(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function mt(e,t,n,r,o){for(let s of br(e)){let i={name:s,startLine:V(t,n),endLine:V(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function br(e){let t=new Set,n=kr(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];Sr.has(s)||ee(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function kr(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Tr(e){let t=e.tag;return e.tagType===pr.COMPONENT?"component":dr.has(t)?"builtin":gr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function _r(e){return ut(e,/[-_:]/)}function V(e,t){return e+Math.max(0,t-1)}import{createRequire as Br}from"module";import{existsSync as w}from"fs";import{basename as gt,dirname as h,extname as k,join as x,relative as A,resolve as f,sep as $r}from"path";import{existsSync as ye,readdirSync as Fr,statSync as Lr}from"fs";import{join as j,relative as Pr}from"path";function dt(e){let t=Er(e)??Ir(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Vr(e,o)){if(r.has(s))continue;r.add(s);let i=jr(e,s);i&&n.push(i)}return n}function Er(e){let t=j(e,"pnpm-workspace.yaml");if(!ye(t))return null;try{return Ar(H(t,"pnpm workspace manifest"))}catch{return null}}function Ar(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=wr(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Rr(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function wr(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Rr(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Ir(e){let t=j(e,"package.json");if(!ye(t))return null;try{let n=JSON.parse(H(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Vr(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=j(e,t);return Se(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=j(e,r||".");return Se(s)?Fr(s).map(i=>j(s,i,o)).filter(Se):[]}function Se(e){try{return Lr(e).isDirectory()}catch{return!1}}function jr(e,t){let n=j(t,"package.json");if(!ye(n))return null;try{let r=JSON.parse(H(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Pr(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var Or=X("indexed-paths",{clearGroups:[]}),Dr=X("indexed-path-digest",{clearGroups:[]}),Wr=L("tsconfig-alias-config",{clearGroups:["whole-project"]}),Ur=L("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Mr=Br(import.meta.url),z;function zr(){if(z!==void 0)return z;try{z=Mr("typescript")}catch{z=null}return z}var qr=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Hr=X("workspace-packages",{clearGroups:["whole-project"]}),q=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ht=[".py",".pyi"],St=[".java",".scala",".kt",".kts"],yt=[".rs"],xt=[".rb"],vt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Nt=[".cs",".vb"],Ct=[".dart"],bt=[".php"],se=[".clj",".cljs",".cljc"],Xr=new Set(q),xe=new Set(ht),kt=new Set(St),ve=new Set(yt),Ne=new Set(xt),Tt=new Set(vt),_t=new Set(Nt),Ce=new Set(Ct),Ft=new Set(bt),Lt=new Set(se),Jr=[{extensions:q,lookup:Xr},{extensions:ht,lookup:xe},{extensions:St,lookup:kt},{extensions:yt,lookup:ve},{extensions:xt,lookup:Ne},{extensions:vt,lookup:Tt},{extensions:Nt,lookup:_t},{extensions:Ct,lookup:Ce},{extensions:bt,lookup:Ft},{extensions:se,lookup:Lt}];function T(e,t){return t.has(k(e).toLowerCase())}function Zr(e){return T(e,xe)}function Gr(e){return T(e,kt)}function Kr(e){return T(e,ve)}function Qr(e){return T(e,Ne)}function Yr(e){return T(e,Tt)}function eo(e){return T(e,_t)}function ai(e){return k(e).toLowerCase()===".vb"}function to(e){return T(e,Ce)}function no(e){return T(e,Ft)}function ro(e){return T(e,Lt)}function oo(e){let t=k(e).toLowerCase();for(let n of Jr)if(n.lookup.has(t))return n.extensions;return q}function so(e){return Gr(e)||eo(e)||no(e)}function Pt(e,t,n){return Zr(t)?xo(e,t,n):Kr(t)?vo(e,t,n):Qr(t)?No(e,t,n):Yr(t)?Co(e,t,n):so(t)?bo(e,n.replace(/\\/g,"."),oo(t)):to(t)?ko(e,t,n):ro(t)?To(e,n):io(e,t,n)}function io(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return ao(e,t,n)??lo(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of ke(o)){let a=v(A(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(A(e.config.projectRoot,o))}function ao(e,t,n){let r=ho(e,t);if(!r)return null;let o=_(e);for(let s of co(r,n)){let i=f(r.baseUrl,s);for(let a of ke(i)){let c=v(A(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function co(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function lo(e,t){let n=po(uo(e),t);if(!n)return null;let r=_(e);for(let o of fo(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of ke(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function uo(e){return Hr.get(e,()=>dt(e.config.projectRoot))}function po(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function fo(e){let t=[],n=mo(e.pkg.exports,e.subpath);if(n){let r=go(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function mo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Et(e[n])}function Et(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=Et(t[n]);if(r)return r}return null}function go(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function ho(e,t){let n=v(h(t));return Ur.get(e,n,()=>So(e,n))}function So(e,t){let n=zr();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+$r);){for(let i of qr){let a=x(o,i);if(!w(a))continue;let c=Wr.get(e,a,()=>yo(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function yo(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function xo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of _o(o)){let i=v(A(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function vo(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),be(e,Fo(s))}function No(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return be(e,Lo(o))}function Co(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return be(e,o)}function bo(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>gt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function ko(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Po(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function To(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of se){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of se){let s=[...r].find(i=>gt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function _o(e){let t=k(e);return xe.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function be(e,t){let n=_(e);for(let r of t){let o=v(A(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function Fo(e){let t=k(e);return ve.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Lo(e){let t=k(e);return Ne.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Po(e){let t=k(e);return Ce.has(t)?[e]:[`${e}.dart`,e]}function ke(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of q)n.add(e.slice(0,-t.length)+r)}else for(let r of q)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return Or.get(e,()=>new Set(O(e,{includeIgnored:!1}).map(v)))}function ci(e){return Dr.get(e,()=>Fe([..._(e)].sort().join(`
18
+ `)))}var Eo=new Set(["in","key","of"]),Ao=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),wo=F("vue-component-behavior-profiles");function At(e,t={}){let n=W(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Te(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=wo.get(e,n,r,()=>Ro(e,n,r));return Vo(o)}function Ro(e,t,n){let r=R(e,t),o=oe(e,t),s=re(r),i=$o(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,$)=>$.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,$)=>$.indexOf(m)===C).sort(),l=n?n.split(`
19
+ `).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ie,paths:ae}=Io(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Bo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ie,delegatedComposablePaths:ae}}function Io(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Pt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
20
+ `).length:0)},0),paths:o}}function Vo(e){let t=jo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function jo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Bo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Ao.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function $o(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Oo(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of wt(n.value))t.add(r);return[...t].sort()}function Oo(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?wt(t[1]??""):[]}function wt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Eo.has(r)||t.push(r)}return t}function bi(e){return{capability:(t,n)=>Do(t,n),reactProfiles:(t={})=>et(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>At(e,t),vueProfileForFile:t=>Te(e,t),vueTemplateFacts:t=>oe(e,t),vueScriptFacts:t=>re(R(e,t))}}function Do(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{O as a,Mo as b,dt as c,Vr as d,q as e,ht as f,St as g,yt as h,xt as i,vt as j,Nt as k,Ct as l,bt as m,se as n,ai as o,oo as p,Pt as q,xo as r,vo as s,No as t,Co as u,bo as v,ko as w,To as x,ci as y,D as z,ce as A,pe as B,ze as C,as as D,Y as E,Q as F,it as G,ut as H,ds as I,Je as J,W as K,gs as L,bi as M};
21
+ //# sourceMappingURL=chunk-RVYLJDXC.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-ITPRC3YV.js");return[n]}if(e==="__sentinel-ensure-service"){let{sentinelEnsureCommandDescriptor:n}=await import("./sentinel-ensure-command-RIZA3RY7.js");return[n]}if(a(e)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-ZL362KXF.js"),o=n.find(i=>i.id===e);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${e}`);return[o]}let{commandDescriptors:t}=await import("./command-descriptors-EAHKIRAG.js");return t}export{d as a,a as b,p as c};
3
+ //# sourceMappingURL=chunk-RWKEXCHU.js.map
@@ -1,4 +1,4 @@
1
- import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-7FND7D7N.js";import{j as $}from"./chunk-6CS3UQTN.js";import{d as k,g as S,i as j}from"./chunk-FETNQCFO.js";import{C as A}from"./chunk-ADTBPVUZ.js";import{f as _}from"./chunk-CWONGW6P.js";import{aa as C,h as b}from"./chunk-NNJ2KZZG.js";import{execFileSync as g}from"child_process";import{existsSync as ne}from"fs";import{basename as W}from"path";var ie="Unable to compute git diff.",se={semanticConsumers:$,sourceFallbackConsumers:O},w={resolveCommit:C,readBatch({projectRoot:e,resolvedBase:i,relativePaths:t}){let n=t.map(a=>`${i}:./${a}
1
+ import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-NK76RSB6.js";import{j as $}from"./chunk-VCL7FK3E.js";import{d as k,g as S,i as j}from"./chunk-AM5SUGHF.js";import{C as A}from"./chunk-RVYLJDXC.js";import{f as _}from"./chunk-IOVPAZWP.js";import{ba as C,h as b}from"./chunk-327YK6TB.js";import{execFileSync as g}from"child_process";import{existsSync as ne}from"fs";import{basename as W}from"path";var ie="Unable to compute git diff.",se={semanticConsumers:$,sourceFallbackConsumers:O},w={resolveCommit:C,readBatch({projectRoot:e,resolvedBase:i,relativePaths:t}){let n=t.map(a=>`${i}:./${a}
2
2
  `).join("");return g("git",["cat-file","--batch"],{cwd:e,input:n,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"],windowsHide:!0})}};function Ze(e,i={}){let t=i.plan??ae(e,i);return t.note?ce(t.note,t.changedFileLines):t.changedFiles.length===0?le(t.changedFileLines):oe(t.changedFiles,[re(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function ae(e,i={}){let{base:t="HEAD"}=i;try{let n=C(e.config.projectRoot,t),a=de(e.config.projectRoot,n),s=a.changedFileLines,o=be(e,s),r=ye(e,a.changedRanges);return{changedFileLines:s,changedFiles:o,changedRanges:r,renamedFiles:ge(e.config.projectRoot,n,o,a),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:ie}}}function re(e,i,t,n=[],a={}){let s=a.evidenceRuntime??se,o=new z(e),r=new Set(t),l=G(n),u=[],d=new Map,c=i.flatMap(f=>o.definitionsForFile(f)).filter(Ne),m=c.filter(f=>Ce(f,l)),p=ve(e,c,m,l),y=Ie([...m,...p.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),B=y.map(f=>f.symbolId),M=Pe(e,B),ee=Ee(e,B,t),R=y.filter(f=>(M.get(f.symbolId)??0)===0),P=q("semantic-consumers",R.length,()=>s.semanticConsumers(e,R)),E=P.values,T=R.filter(f=>(E.get(f.symbolId)?.size??0)===0),N=q("source-fallback-consumers",T.length,()=>s.sourceFallbackConsumers(e,T)),te=N.values;for(let f of y)Fe(e,f,r,u,d,E.get(f.symbolId)??new Set,te.get(f.symbolId)??new Set,M.get(f.symbolId)??0,ee.get(f.symbolId)??new Set);return{changedSymbols:u,consumerEntries:[...d.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:p.notes,evidenceTiers:[P.status,N.status]}}function oe(e,i){let t=new Map,n=i.flatMap(r=>r.changedSymbols),a=i.flatMap(r=>r.attributionNotes??[]),s=Be(i);for(let r of i)for(let l of r.consumerEntries){let u=t.get(l.file);u||(u=new Set,t.set(l.file,u));for(let d of l.symbols)u.add(d)}let o=Te(t);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:o,attributionNotes:a,evidenceTiers:s,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:o.length}}}function ce(e,i=[]){return{changedFiles:i,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:X(),summary:{totalChangedFiles:i.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function le(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:X(),summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function de(e,i){let t=g("git",["diff","--name-status","--find-renames",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864,windowsHide:!0}),n=g("git",["diff","--name-status","--find-renames","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),a=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),s=g("git",["diff","--unified=0",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),o=g("git",["diff","--unified=0","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),r=pe([t,n]);return{changedFileLines:[...new Set([...r.changedFiles,...V(a)])],changedRanges:K([...U(s),...U(o)]),renamedFiles:r.renamedFiles,deletedFiles:r.deletedFiles}}function ue(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePath:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||typeof n.relativePath!="string")throw new TypeError("fileContentAtBase requires projectRoot, base, and relativePath.");let a={projectRoot:n.projectRoot,base:n.base,relativePath:n.relativePath},{relativePath:s}=a,o=J(a);if(o.state==="unavailable")throw new Error(`Base content unavailable for ${s}: ${o.reason}`);return o.state==="present"?o.content:null}function J(e,i=w){return Z(e.relativePath),x({projectRoot:e.projectRoot,base:e.base,relativePaths:[e.relativePath]},i).get(e.relativePath)??{state:"unavailable",reason:`Base-content lookup omitted ${e.relativePath}.`}}function x(e,i=w){for(let o of e.relativePaths)Z(o);let t=[...new Set(e.relativePaths)];if(t.length===0)return new Map;let n;try{n=i.resolveCommit(e.projectRoot,e.base)}catch(o){return v(t,D(o))}let a;try{a=i.readBatch({projectRoot:e.projectRoot,resolvedBase:n,relativePaths:t})}catch(o){return v(t,D(o))}let s;try{s=me(a,t)}catch(o){return v(t,`Malformed git cat-file batch output: ${D(o)}`)}return new Map(t.map(o=>{let r=s.get(o)??null;return[o,r===null?{state:"absent"}:{state:"present",content:r}]}))}function fe(e,i=w){let t=x({projectRoot:e.projectRoot,base:e.base,relativePaths:e.preloadPaths??[]},i);return n=>(t.has(n)||t.set(n,J({projectRoot:e.projectRoot,base:e.base,relativePath:n},i)),t.get(n)??{state:"unavailable",reason:`Base-content reader omitted ${n}.`})}function Ve(e,i,t=[]){let n=typeof e=="string"?{projectRoot:e,base:i,preloadPaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string")throw new TypeError("createBaseContentReader requires projectRoot and base.");let a={projectRoot:n.projectRoot,base:n.base,preloadPaths:n.preloadPaths},s=fe(a);return o=>{let r=s(o);if(r.state==="unavailable")throw new Error(`Base content unavailable for ${o}: ${r.reason}`);return r.state==="present"?r.content:null}}function Ye(e,i=e.changedFiles){let t=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(i.map(n=>t.get(n)??n))]}function Ke(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||!Array.isArray(n.relativePaths))throw new TypeError("fileContentsAtBase requires projectRoot, base, and relativePaths.");let a=x(n),s=new Map;for(let[o,r]of a){if(r.state==="unavailable")throw new Error(`Base content unavailable for ${o}: ${r.reason}`);s.set(o,r.state==="present"?r.content:null)}return s}function Z(e){b(e)}function v(e,i){return new Map(e.map(t=>[t,{state:"unavailable",reason:i}]))}function D(e){let t=(e instanceof Error?e.message:String(e)).replaceAll(/\s+/g," ").trim().slice(0,500);return t===""?"Git base-content lookup failed without a reason.":t}function me(e,i){let t=new Map,n=0;for(let a of i){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let o=e.subarray(n,s).toString("utf-8");if(n=s+1,o.endsWith(" missing")){t.set(a,null);continue}let r=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(o);if(!r)throw new Error(`unexpected git cat-file batch header: ${o}`);let[,l,u]=r,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${o}`);if(n+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let c=e.subarray(n,n+d);t.set(a,l==="blob"?c.toString("utf-8"):null),n+=d,e[n]===10&&(n+=1)}return t}function ge(e,i,t,n){if(t.length===0)return[];let a=new Map,s=new Set;for(let r of n.renamedFiles)t.includes(r.to)&&(a.set(r.to,r),s.add(r.from));let o=n.deletedFiles;if(o.length===0)return[...a.values()].sort((r,l)=>r.to.localeCompare(l.to));for(let r of t){if(a.has(r)||!ne(`${e}/${r}`))continue;let l=o.filter(c=>!s.has(c)).filter(c=>W(c)===W(r));if(l.length===0)continue;let u=_(e,r),d=l.map(c=>({from:c,to:r,similarity:he(ue({projectRoot:e,base:i,relativePath:c})??"",u)})).sort((c,m)=>m.similarity-c.similarity)[0];d&&d.similarity>=.45&&(a.set(r,d),s.add(d.from))}return[...a.values()].sort((r,l)=>r.to.localeCompare(l.to))}function pe(e){let i=new Set,t=new Map,n=new Set;for(let a of e.flatMap(s=>V(s))){let[s,o,r]=a.split(" ");if(!(!s||!o)){if(s.startsWith("R")&&r){i.add(r),t.set(r,{from:o,to:r,similarity:Number(s.slice(1))/100});continue}i.add(o),s.startsWith("D")&&n.add(o)}}return{changedFiles:[...i],renamedFiles:[...t.values()],deletedFiles:[...n]}}function he(e,i){let t=new Set(H(e)),n=new Set(H(i));if(t.size===0&&n.size===0)return 1;if(t.size===0||n.size===0)return 0;let a=0;for(let s of t)n.has(s)&&(a+=1);return 2*a/(t.size+n.size)}function H(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function V(e){return e.split(`
3
3
  `).map(i=>i.trim()).filter(i=>i.length>0)}function be(e,i){let t=Y(e),n=[];for(let a of i){let s=t(a);s&&!e.isIgnored(s)&&n.push(s)}return n}function ye(e,i){let t=Y(e),n=[];for(let a of i){let s=t(a.file);s&&!e.isIgnored(s)&&n.push({...a,file:s})}return K(n)}function Y(e){let t=e.all(`SELECT relative_path FROM documents
4
4
  ORDER BY id`).map(a=>a.relative_path).map(a=>({path:a,normalized:b(a)})),n=new Map;for(let a of t){let s=n.get(a.normalized);n.set(a.normalized,s===void 0||s===a.path?a.path:null)}return a=>{let s=b(a),o=n.get(s);if(o)return o;let r=t.filter(l=>l.normalized.endsWith(s));return r.length===1?r[0].path:null}}function U(e){let i=[],t=null;for(let n of e.split(`
@@ -15,4 +15,4 @@ import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-7FND7D
15
15
  AND m.role != 1
16
16
  AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
17
17
  ${e.pathExclusionsFor("ref_d")}`,...i,...t),a=new Map;for(let s of n){let o=a.get(s.symbol_id);o||(o=new Set,a.set(s.symbol_id,o)),o.add(s.relative_path)}return a}function I(e,i,t,n,a){if(e.isIgnored(n)||i.has(n))return;let s=t.get(n);s||(s=new Set,t.set(n,s)),s.add(a)}function Te(e){return[...e.entries()].map(([i,t])=>({file:i,consumedSymbols:t.size})).sort((i,t)=>t.consumedSymbols-i.consumedSymbols)}function Ne(e){return!(j(e.symbol)||e.parentTypeName!==null&&!S(e.symbol))}function _e(e,i){return S(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&i>0}export{ie as a,Ze as b,ae as c,re as d,oe as e,ue as f,J as g,x as h,fe as i,Ve as j,Ye as k,Ke as l,Se as m};
18
- //# sourceMappingURL=chunk-L4NRUAGJ.js.map
18
+ //# sourceMappingURL=chunk-S5SKXCND.js.map
@@ -1,2 +1,2 @@
1
- import{a as P,b as y}from"./chunk-IRQOAM5G.js";import{a as C,c as b,e as r,f}from"./chunk-OTOKVOJ3.js";import{a as g,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-ADTBPVUZ.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-RBAS5ZHI.js.map
1
+ import{a as P,b as y}from"./chunk-IRQOAM5G.js";import{a as C,c as b,e as r,f}from"./chunk-OTOKVOJ3.js";import{a as g,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-RVYLJDXC.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-S64NCE2Z.js.map
@@ -1,2 +1,2 @@
1
- import{a as v,b as j}from"./chunk-QDCCHMVZ.js";import{a as M}from"./chunk-35NLDRZC.js";import{a as P}from"./chunk-TIIC3ZE7.js";import{a as q}from"./chunk-NNOKTMZT.js";import{t as I}from"./chunk-FETNQCFO.js";import{p as x}from"./chunk-O6QTXQPJ.js";import{a as U}from"./chunk-ADTBPVUZ.js";var T=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,D=new Map;function V(e,r,t,o){if(!r?.testPaths?.length)return[];let c=k(r),s=[];for(let i of L(e,r.testPaths)){let a=z(e,i,o),l=a?t(a):null;if(l)for(let g of x(e,i)){let C=g.sourcePath;if(!C)continue;let d=t(C);d&&d!==l&&(c.get(l)?.has(d)||s.push({testFile:i,ownerBoundary:l,importedFile:C,importedBoundary:d,reason:"outside-owner-policy"}))}}return H(s)}function k(e){let r=e.allowedDependencies??{},t=e.boundaries.map(i=>i.name),o=new Map,c=(i,a)=>{for(let l of r[i]??[])a.has(l)||(a.add(l),c(l,a))};for(let i of t){let a=new Set;c(i,a),o.set(i,a)}let s=new Map;for(let i of t){let a=new Set(o.get(i));for(let l of t)l!==i&&o.get(l)?.has(i)&&a.add(l);s.set(i,a)}return s}function L(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=D.get(t);if(o)return o;let c=new Set;for(let i of r)for(let a of j(e.config.projectRoot,i))T.test(a)&&c.add(a);let s=[...c].sort();return D.set(t,s),s}function z(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=x(e,r).map(i=>i.sourcePath).filter(i=>!!i&&t(i)&&i.split("/").pop()===c);return s.length===1?s[0]:null}function H(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=>v(c,r)));return t.length===1?t[0].name:null}var b="architecture:";function G(e,r,t,o={}){let c=K(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,i=new Map(t.boundaries.map(n=>[n.name,new Set])),a=[],l=[];for(let n of c){let f=t.boundaries.filter(p=>p.paths.some(F=>v(F,n))).map(p=>p.name).sort();if(f.length===0)a.push(n);else if(f.length>1)l.push({file:n,boundaries:f});else{let p=f[0];s.set(n,p),i.get(p).add(n)}}let g=new Map;for(let[n,f]of e){let p=s.get(n);if(p)for(let F of f){let R=s.get(F);if(!R||p===R)continue;let $=w(p,R),B=g.get($);B||(B={from:p,to:R,fileEdges:[],importers:new Set,importedFiles:new Set},g.set($,B)),B.fileEdges.push({fromFile:n,toFile:F}),B.importers.add(n),B.importedFiles.add(F)}}let C=[...g.values()].map(n=>N(n,t)).sort(te),d=C,E=new Map(d.map(n=>[w(n.from,n.to),n])),S=new Map(t.boundaries.map(n=>[n.name,new Set]));for(let n of d)S.get(n.from).add(n.to);let m=[];for(let n of d){if(n.from>=n.to)continue;let f=E.get(w(n.to,n.from));f&&m.push({boundaries:[n.from,n.to],forward:n,reverse:f})}let{components:A}=M(S),y=A.filter(n=>n.length>1).map(n=>J(n,d,t.requireAcyclic===!0)).sort((n,f)=>f.boundaries.length-n.boundaries.length||n.boundaries.join("/").localeCompare(f.boundaries.join("/"))),h=t.allowedDependencies??{},u=t.boundaries.map(n=>n.name).filter(n=>!Object.hasOwn(h,n)).sort();return{configured:!0,boundaries:t.boundaries.map(n=>({name:n.name,paths:[...n.paths],fileCount:i.get(n.name).size,dependencyPolicyDeclared:Object.hasOwn(h,n.name)})).sort((n,f)=>n.name.localeCompare(f.name)),edges:C,forbiddenEdges:d.filter(n=>n.policyStatus==="forbidden"),reciprocalPairs:m,cycles:y,staleAllowances:W(t,d),boundaryLimits:Y(t,d,i),fragileEdges:d.filter(n=>n.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:Q(e,i,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,n=>t.boundaries.find(f=>f.name===n)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-u.length,totalBoundaries:t.boundaries.length,missingRows:u,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function ge(e,r={}){let t=q(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 G(t,o,e.config.architecture,{isModuleHierarchyFile:s=>_(e,s),testBoundaryViolations:V(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function _(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:I(e,r).length===0}function ye(e){let r=e.forbiddenEdges.map(o=>`${b}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${b}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${b}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${b}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(`${b}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${b}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${b}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=`${b}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let i=2;i<=c;i+=1)r.push(`${s}:component:${i}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${b}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function he(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 K(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 N(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:X(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 X(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function J(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),i=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===i),violatesPolicy:t}}function Q(e,r,t=Z,o=!1,c=()=>"directory"){let s=[];for(let[i,a]of r){let l=c(i)==="file"?m=>m:ee,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let C=new Set(g),d=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(!C.has(A))continue;let y=l(m),h=l(A);if(y===h)continue;let u=w(y,h),n=d.get(u);n||(n={from:y,to:h,fileEdges:[]},d.set(u,n)),n.fileEdges.push({fromFile:m,toFile:A}),E.get(y).add(h)}let{components:S}=M(E);for(let m of S){if(m.length<2)continue;let A=new Set(m),y=[...d.values()].filter(u=>A.has(u.from)&&A.has(u.to)).map(u=>({from:u.from,to:u.to,fileEdgeCount:u.fileEdges.length,examples:u.fileEdges.slice(0,5)})).sort((u,n)=>u.from.localeCompare(n.from)||u.to.localeCompare(n.to)),h=Math.min(...y.map(u=>u.fileEdgeCount));s.push({boundary:i,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:y,narrowestEdges:y.filter(u=>u.fileEdgeCount===h)})}}return s.sort((i,a)=>a.subUnits.length-i.subUnits.length||i.boundary.localeCompare(a.boundary))}function W(e,r){let t=new Set(r.map(i=>w(i.from,i.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(i=>i.name)),s=[];for(let[i,a]of Object.entries(o))if(c.has(i))for(let l of a)!c.has(l)||t.has(w(i,l))||s.push({from:i,to:l});return s.sort((i,a)=>i.from.localeCompare(a.from)||i.to.localeCompare(a.to))}function Y(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 i=s.maxFiles??e.maxBoundaryFiles;if(i!==void 0){let a=t.get(s.name)?.size??0;a>i&&o.push({boundary:s.name,kind:"files",observed:a,limit:i})}}return o.sort((s,i)=>s.boundary.localeCompare(i.boundary)||s.kind.localeCompare(i.kind))}function Z(e){let r=P(e);return r==="test"||r==="entry"}function ee(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function w(e,r){return`${e}\0${r}`}function te(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{b as a,G as b,ge as c,ye as d,he as e,Q as f};
2
- //# sourceMappingURL=chunk-WMPRTGH2.js.map
1
+ import{a as v,b as j}from"./chunk-QDCCHMVZ.js";import{a as M}from"./chunk-35NLDRZC.js";import{a as P}from"./chunk-ZOEDRCR4.js";import{a as q}from"./chunk-B2E3HZ2A.js";import{t as I}from"./chunk-AM5SUGHF.js";import{p as x}from"./chunk-JOALNFY3.js";import{a as U}from"./chunk-RVYLJDXC.js";var T=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,D=new Map;function V(e,r,t,o){if(!r?.testPaths?.length)return[];let c=k(r),s=[];for(let i of L(e,r.testPaths)){let a=z(e,i,o),l=a?t(a):null;if(l)for(let g of x(e,i)){let C=g.sourcePath;if(!C)continue;let d=t(C);d&&d!==l&&(c.get(l)?.has(d)||s.push({testFile:i,ownerBoundary:l,importedFile:C,importedBoundary:d,reason:"outside-owner-policy"}))}}return H(s)}function k(e){let r=e.allowedDependencies??{},t=e.boundaries.map(i=>i.name),o=new Map,c=(i,a)=>{for(let l of r[i]??[])a.has(l)||(a.add(l),c(l,a))};for(let i of t){let a=new Set;c(i,a),o.set(i,a)}let s=new Map;for(let i of t){let a=new Set(o.get(i));for(let l of t)l!==i&&o.get(l)?.has(i)&&a.add(l);s.set(i,a)}return s}function L(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=D.get(t);if(o)return o;let c=new Set;for(let i of r)for(let a of j(e.config.projectRoot,i))T.test(a)&&c.add(a);let s=[...c].sort();return D.set(t,s),s}function z(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=x(e,r).map(i=>i.sourcePath).filter(i=>!!i&&t(i)&&i.split("/").pop()===c);return s.length===1?s[0]:null}function H(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=>v(c,r)));return t.length===1?t[0].name:null}var b="architecture:";function G(e,r,t,o={}){let c=K(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,i=new Map(t.boundaries.map(n=>[n.name,new Set])),a=[],l=[];for(let n of c){let f=t.boundaries.filter(p=>p.paths.some(F=>v(F,n))).map(p=>p.name).sort();if(f.length===0)a.push(n);else if(f.length>1)l.push({file:n,boundaries:f});else{let p=f[0];s.set(n,p),i.get(p).add(n)}}let g=new Map;for(let[n,f]of e){let p=s.get(n);if(p)for(let F of f){let R=s.get(F);if(!R||p===R)continue;let $=w(p,R),B=g.get($);B||(B={from:p,to:R,fileEdges:[],importers:new Set,importedFiles:new Set},g.set($,B)),B.fileEdges.push({fromFile:n,toFile:F}),B.importers.add(n),B.importedFiles.add(F)}}let C=[...g.values()].map(n=>N(n,t)).sort(te),d=C,E=new Map(d.map(n=>[w(n.from,n.to),n])),S=new Map(t.boundaries.map(n=>[n.name,new Set]));for(let n of d)S.get(n.from).add(n.to);let m=[];for(let n of d){if(n.from>=n.to)continue;let f=E.get(w(n.to,n.from));f&&m.push({boundaries:[n.from,n.to],forward:n,reverse:f})}let{components:A}=M(S),y=A.filter(n=>n.length>1).map(n=>J(n,d,t.requireAcyclic===!0)).sort((n,f)=>f.boundaries.length-n.boundaries.length||n.boundaries.join("/").localeCompare(f.boundaries.join("/"))),h=t.allowedDependencies??{},u=t.boundaries.map(n=>n.name).filter(n=>!Object.hasOwn(h,n)).sort();return{configured:!0,boundaries:t.boundaries.map(n=>({name:n.name,paths:[...n.paths],fileCount:i.get(n.name).size,dependencyPolicyDeclared:Object.hasOwn(h,n.name)})).sort((n,f)=>n.name.localeCompare(f.name)),edges:C,forbiddenEdges:d.filter(n=>n.policyStatus==="forbidden"),reciprocalPairs:m,cycles:y,staleAllowances:W(t,d),boundaryLimits:Y(t,d,i),fragileEdges:d.filter(n=>n.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:Q(e,i,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,n=>t.boundaries.find(f=>f.name===n)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-u.length,totalBoundaries:t.boundaries.length,missingRows:u,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function ge(e,r={}){let t=q(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 G(t,o,e.config.architecture,{isModuleHierarchyFile:s=>_(e,s),testBoundaryViolations:V(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function _(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:I(e,r).length===0}function ye(e){let r=e.forbiddenEdges.map(o=>`${b}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${b}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${b}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${b}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(`${b}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${b}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${b}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=`${b}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let i=2;i<=c;i+=1)r.push(`${s}:component:${i}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${b}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function he(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 K(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 N(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:X(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 X(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function J(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),i=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===i),violatesPolicy:t}}function Q(e,r,t=Z,o=!1,c=()=>"directory"){let s=[];for(let[i,a]of r){let l=c(i)==="file"?m=>m:ee,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let C=new Set(g),d=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(!C.has(A))continue;let y=l(m),h=l(A);if(y===h)continue;let u=w(y,h),n=d.get(u);n||(n={from:y,to:h,fileEdges:[]},d.set(u,n)),n.fileEdges.push({fromFile:m,toFile:A}),E.get(y).add(h)}let{components:S}=M(E);for(let m of S){if(m.length<2)continue;let A=new Set(m),y=[...d.values()].filter(u=>A.has(u.from)&&A.has(u.to)).map(u=>({from:u.from,to:u.to,fileEdgeCount:u.fileEdges.length,examples:u.fileEdges.slice(0,5)})).sort((u,n)=>u.from.localeCompare(n.from)||u.to.localeCompare(n.to)),h=Math.min(...y.map(u=>u.fileEdgeCount));s.push({boundary:i,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:y,narrowestEdges:y.filter(u=>u.fileEdgeCount===h)})}}return s.sort((i,a)=>a.subUnits.length-i.subUnits.length||i.boundary.localeCompare(a.boundary))}function W(e,r){let t=new Set(r.map(i=>w(i.from,i.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(i=>i.name)),s=[];for(let[i,a]of Object.entries(o))if(c.has(i))for(let l of a)!c.has(l)||t.has(w(i,l))||s.push({from:i,to:l});return s.sort((i,a)=>i.from.localeCompare(a.from)||i.to.localeCompare(a.to))}function Y(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 i=s.maxFiles??e.maxBoundaryFiles;if(i!==void 0){let a=t.get(s.name)?.size??0;a>i&&o.push({boundary:s.name,kind:"files",observed:a,limit:i})}}return o.sort((s,i)=>s.boundary.localeCompare(i.boundary)||s.kind.localeCompare(i.kind))}function Z(e){let r=P(e);return r==="test"||r==="entry"}function ee(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function w(e,r){return`${e}\0${r}`}function te(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{b as a,G as b,ge as c,ye as d,he as e,Q as f};
2
+ //# sourceMappingURL=chunk-SF34QLK2.js.map
@@ -1,4 +1,4 @@
1
- import{a as F}from"./chunk-GTXSJDCO.js";import{c as w}from"./chunk-7FND7D7N.js";import{k as E}from"./chunk-6CS3UQTN.js";import{a as S,b as y,j as _}from"./chunk-C7QOQX32.js";import{a as x}from"./chunk-TIIC3ZE7.js";import{d as k}from"./chunk-FETNQCFO.js";import{f as v,g as R}from"./chunk-CWONGW6P.js";import{c as p}from"./chunk-NNJ2KZZG.js";function L(e,t){let a=p(t),n=[],r="complete",i=x(a);i==="entry"&&s(n,"operational-root","structural entrypoint path"),i==="worker"&&s(n,"operational-root","worker launch convention"),_(a)&&s(n,"operational-root","framework-discovered entrypoint"),M(e,a)&&s(n,"operational-root","configured entry root");let l=!1;try{l=S(e,a),l&&s(n,"published-api","package manifest export");for(let o of y(e,a))s(n,"operational-root",o)}catch(o){r="partial",s(n,"metadata-unavailable",`package metadata unavailable: ${I(o)}`)}try{let o=v(e.config.projectRoot,a,{maxBytes:8388608,inputKind:"change-surface source"});N(o)&&s(n,"operational-root","module contains a direct-execution process guard")}catch(o){r="partial",s(n,"metadata-unavailable",R(o)?"indexed source file is unavailable on disk":`source metadata unavailable: ${I(o)}`)}return{operationalRoot:n.some(o=>o.kind==="operational-root"),publishedApi:l,coverage:r,reasons:n}}function M(e,t){let a=e.config.entryRoots;return a?a.files?.some(n=>p(n)===t)?!0:a.pathPrefixes?.some(n=>t.startsWith(p(n)))??!1:!1}function N(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,t,a){e.some(n=>n.kind===t&&n.detail===a)||e.push({kind:t,detail:a})}function I(e){return e instanceof Error?e.message:String(e)}function V(e,t,a={}){let n=F(e,t);if(!n)return null;let r=T(e,n);if(!r||e.isIgnored(r.relative_path))return null;let i=[],l=0,o=!0,h=j(e,r.relative_path),f=L(e,r.relative_path),b=a.semantic===!1?{callers:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set}:E(e,h);for(let u of h){let c=O(e,r,u,b.callers.get(u.symbolId)??new Set);l+=c;let m=P(a.semantic!==!1,u.symbolId,b),d=m==="complete"||m==="disabled";d||(o=!1);let g=d?c:null,C=g===null?void 0:$(g),D=[...f.reasons,...c>0?[{kind:"external-consumers",detail:`${c} known external consumer${c===1?"":"s"}`}]:[],...d?[]:[{kind:"semantic-consumer-coverage",detail:`compiler-resolved consumer evidence is ${m}`}]];i.push({symbol:u.symbol,shortName:k(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:g,knownExternalConsumers:c,consumerCoverage:m,externalConsumerRiskLevel:C,riskLevel:A(C,f,!d),riskReasons:D})}return{file:r.relative_path,symbols:i,totalExternalConsumers:o?l:null,knownTotalExternalConsumers:l,fileRisk:f}}function P(e,t,a){if(!e)return"disabled";let n=a.incompleteSymbolIds.has(t),r=a.unavailableSymbolIds.has(t);return n&&r?"incomplete-and-unavailable":n?"incomplete":r?"unavailable":"complete"}function T(e,t){return e.get(`SELECT id, relative_path FROM documents
1
+ import{a as F}from"./chunk-HIEXRDJF.js";import{c as w}from"./chunk-NK76RSB6.js";import{k as E}from"./chunk-VCL7FK3E.js";import{a as S,b as y,j as _}from"./chunk-JN5LIBT3.js";import{a as x}from"./chunk-ZOEDRCR4.js";import{d as k}from"./chunk-AM5SUGHF.js";import{f as v,g as R}from"./chunk-IOVPAZWP.js";import{c as p}from"./chunk-327YK6TB.js";function L(e,t){let a=p(t),n=[],r="complete",i=x(a);i==="entry"&&s(n,"operational-root","structural entrypoint path"),i==="worker"&&s(n,"operational-root","worker launch convention"),_(a)&&s(n,"operational-root","framework-discovered entrypoint"),M(e,a)&&s(n,"operational-root","configured entry root");let l=!1;try{l=S(e,a),l&&s(n,"published-api","package manifest export");for(let o of y(e,a))s(n,"operational-root",o)}catch(o){r="partial",s(n,"metadata-unavailable",`package metadata unavailable: ${I(o)}`)}try{let o=v(e.config.projectRoot,a,{maxBytes:8388608,inputKind:"change-surface source"});N(o)&&s(n,"operational-root","module contains a direct-execution process guard")}catch(o){r="partial",s(n,"metadata-unavailable",R(o)?"indexed source file is unavailable on disk":`source metadata unavailable: ${I(o)}`)}return{operationalRoot:n.some(o=>o.kind==="operational-root"),publishedApi:l,coverage:r,reasons:n}}function M(e,t){let a=e.config.entryRoots;return a?a.files?.some(n=>p(n)===t)?!0:a.pathPrefixes?.some(n=>t.startsWith(p(n)))??!1:!1}function N(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,t,a){e.some(n=>n.kind===t&&n.detail===a)||e.push({kind:t,detail:a})}function I(e){return e instanceof Error?e.message:String(e)}function V(e,t,a={}){let n=F(e,t);if(!n)return null;let r=T(e,n);if(!r||e.isIgnored(r.relative_path))return null;let i=[],l=0,o=!0,h=j(e,r.relative_path),f=L(e,r.relative_path),b=a.semantic===!1?{callers:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set}:E(e,h);for(let u of h){let c=O(e,r,u,b.callers.get(u.symbolId)??new Set);l+=c;let m=P(a.semantic!==!1,u.symbolId,b),d=m==="complete"||m==="disabled";d||(o=!1);let g=d?c:null,C=g===null?void 0:$(g),D=[...f.reasons,...c>0?[{kind:"external-consumers",detail:`${c} known external consumer${c===1?"":"s"}`}]:[],...d?[]:[{kind:"semantic-consumer-coverage",detail:`compiler-resolved consumer evidence is ${m}`}]];i.push({symbol:u.symbol,shortName:k(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:g,knownExternalConsumers:c,consumerCoverage:m,externalConsumerRiskLevel:C,riskLevel:A(C,f,!d),riskReasons:D})}return{file:r.relative_path,symbols:i,totalExternalConsumers:o?l:null,knownTotalExternalConsumers:l,fileRisk:f}}function P(e,t,a){if(!e)return"disabled";let n=a.incompleteSymbolIds.has(t),r=a.unavailableSymbolIds.has(t);return n&&r?"incomplete-and-unavailable":n?"incomplete":r?"unavailable":"complete"}function T(e,t){return e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${e.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,t)??null}function j(e,t){return new w(e).definitionsForFile(t).sort((a,n)=>a.startLine-n.startLine||a.endLine-n.endLine)}function O(e,t,a,n){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
@@ -8,4 +8,4 @@ import{a as F}from"./chunk-GTXSJDCO.js";import{c as w}from"./chunk-7FND7D7N.js";
8
8
  WHERE m.symbol_id = ?
9
9
  AND m.role != 1
10
10
  AND c.document_id != ?`,a.symbolId,t.id);return new Set([...r.map(i=>i.relative_path),...[...n].filter(i=>i!==t.relative_path)]).size}function $(e){return e>10?"high":e>0?"medium":"low"}function A(e,t,a){return e==="high"?"high":a||e==="medium"||t.operationalRoot||t.publishedApi||t.coverage==="partial"?"medium":"low"}export{V as a};
11
- //# sourceMappingURL=chunk-ANFVSJWQ.js.map
11
+ //# sourceMappingURL=chunk-SJZQ2PTZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as U}from"./chunk-SELM5MER.js";import{c as T}from"./chunk-7FND7D7N.js";import{a as R}from"./chunk-UZGZB3VB.js";import{d as x}from"./chunk-FETNQCFO.js";import{a as v}from"./chunk-ADTBPVUZ.js";import{b}from"./chunk-NNJ2KZZG.js";import{posix as p}from"path";var G=20,O=1,q=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"]]),K=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 Ae(e,n={}){let t=D(n.limit,G),i=D(n.minConsumers,O),r=new T(e),s=r.fileDependencyGraph(n.scope),o=fe(v(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?J(e,r,n.target):Q(e,n.scope,n.scanLimit)).map(l=>V(e,r,s,l,n,o,a)).filter(l=>l.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function J(e,n,t){let i=ee(e,t);if(i)return[P(i)];let r=R(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ne(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:x(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function Q(e,n,t){let i=v(e,{scope:n,includeIgnored:!1}),r=D(t,i.length);return i.slice(0,r).map(s=>P(s))}function V(e,n,t,i,r,s,o){let a=i.definition?X(e,n,i.definition,r.semantic):null,c=a?.files??Z(t,i.unit.file),u=i.definition?a.coverage==="complete"?c.length>0?"exact":"none":a.coverage:c.length>0?"file-level":"none",l=u==="incomplete"||u==="unavailable"||u==="incomplete-and-unavailable",y=i.unit.file,g=d(p.dirname(y)),f=ie(c),j=te(g),z=C([...F(g),...f?F(f):[]]),S=l?"repository-level-review":re(i.unit,g,f,c),h=l?{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:`Compiler-resolved consumer evidence is ${u}; no relocation destination is safe to score.`}:oe(S,i.unit,g,f,c,s,o),A=ue(i.unit,u,f,c,g,h.whyNoSuggestedHome),_=de(i.unit,g,f,c,h.suggestedHome,h.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:y,currentDirectory:g,directoryAncestry:j,consumerFiles:c,consumerCoverage:u,nearestCommonOwner:f,boundaryMarkers:z,recommendedTier:S,suggestedHome:h.suggestedHome,destinationConfidence:h.confidence,whyNoSuggestedHome:h.whyNoSuggestedHome,counterevidence:l?[...A,"Known consumer files are retained, but missing compiler evidence can hide additional owners."]:A,reasons:_,recommendation:l?"Retain the current location until compiler-resolved consumer evidence is complete.":me(S,h.suggestedHome,u)}}function X(e,n,t,i){let r=U(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}).get(t.symbolId),s=r?.semanticIncomplete?r.semanticUnavailable?"incomplete-and-unavailable":"incomplete":r?.semanticUnavailable?"unavailable":"complete";return{files:W(r?.files.map(o=>o.file)??[]),coverage:s}}function Z(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return W(t)}function ee(e,n){let t=b(n),i=v(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 ne(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:x(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function P(e){return{unit:{kind:"file",file:e,shortName:p.basename(e)}}}function te(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:k(r)})}return n}function F(e){return e==="."?[]:H(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function k(e){return C(H(e).map(({marker:n})=>n))}function H(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=q.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function ie(e){if(e.length===0)return null;let n=e.map(i=>d(p.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 re(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":I(t,"package")?"package-level-shared":I(t,"app")?"app-level-shared":$(t,["feature","domain","module"])||$(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function oe(e,n,t,i,r,s,o){let a=se(e,i);if(a)return m(a);let c=he(n.file),u=ae(e,t,c,r,o);if(u)return u;let l=i;if(d(t)===d(l))return m(`${t} is already the nearest common owner for its consumers.`);let y=ce(l,t,c,o);return y||le(l,t,c,s,o)}function se(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 ae(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?L(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=d(p.dirname(i[0])),o=B(n,t,s,r);return o?m(o):L(s)}return null}function ce(e,n,t,i){return ve(e)?M(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=M(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 M(e,n,t,i,r){if(!E(e,t))return m(r);let s=B(n,t,e,i);return s?m(s):L(e)}function L(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(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 de(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 me(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 ge(e,n){return N(n)-N(e)||e.candidatePath.localeCompare(n.candidatePath)}function N(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 fe(e){let n=new Set(["."]);for(let t of e){let i=d(p.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=d(p.dirname(i))}return n}function he(e){let n=w(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function E(e,n){let t=d(e),i=d(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=w(e),r=w(n);return(E(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function B(e,n,t,i){return d(e)===d(t)||!pe(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function I(e,n){return k(e).includes(n)}function $(e,n){let t=k(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?K.has(t):!1}function d(e){let n=b(e);return n===""?".":n}function w(e){let n=b(e);return n==="."?[]:n.split("/").filter(Boolean)}function D(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function W(e){return C([...e]).sort((n,t)=>n.localeCompare(t))}function C(e){return[...new Set(e)]}export{Ae as a};
2
- //# sourceMappingURL=chunk-4XTAUQFD.js.map
1
+ import{a as U}from"./chunk-NIO346UL.js";import{c as T}from"./chunk-NK76RSB6.js";import{a as R}from"./chunk-3XFJUWJE.js";import{d as x}from"./chunk-AM5SUGHF.js";import{a as v}from"./chunk-RVYLJDXC.js";import{b}from"./chunk-327YK6TB.js";import{posix as p}from"path";var G=20,O=1,q=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"]]),K=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 Ae(e,n={}){let t=D(n.limit,G),i=D(n.minConsumers,O),r=new T(e),s=r.fileDependencyGraph(n.scope),o=fe(v(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?J(e,r,n.target):Q(e,n.scope,n.scanLimit)).map(l=>V(e,r,s,l,n,o,a)).filter(l=>l.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function J(e,n,t){let i=ee(e,t);if(i)return[P(i)];let r=R(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ne(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:x(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function Q(e,n,t){let i=v(e,{scope:n,includeIgnored:!1}),r=D(t,i.length);return i.slice(0,r).map(s=>P(s))}function V(e,n,t,i,r,s,o){let a=i.definition?X(e,n,i.definition,r.semantic):null,c=a?.files??Z(t,i.unit.file),u=i.definition?a.coverage==="complete"?c.length>0?"exact":"none":a.coverage:c.length>0?"file-level":"none",l=u==="incomplete"||u==="unavailable"||u==="incomplete-and-unavailable",y=i.unit.file,g=d(p.dirname(y)),f=ie(c),j=te(g),z=C([...F(g),...f?F(f):[]]),S=l?"repository-level-review":re(i.unit,g,f,c),h=l?{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:`Compiler-resolved consumer evidence is ${u}; no relocation destination is safe to score.`}:oe(S,i.unit,g,f,c,s,o),A=ue(i.unit,u,f,c,g,h.whyNoSuggestedHome),_=de(i.unit,g,f,c,h.suggestedHome,h.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:y,currentDirectory:g,directoryAncestry:j,consumerFiles:c,consumerCoverage:u,nearestCommonOwner:f,boundaryMarkers:z,recommendedTier:S,suggestedHome:h.suggestedHome,destinationConfidence:h.confidence,whyNoSuggestedHome:h.whyNoSuggestedHome,counterevidence:l?[...A,"Known consumer files are retained, but missing compiler evidence can hide additional owners."]:A,reasons:_,recommendation:l?"Retain the current location until compiler-resolved consumer evidence is complete.":me(S,h.suggestedHome,u)}}function X(e,n,t,i){let r=U(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}).get(t.symbolId),s=r?.semanticIncomplete?r.semanticUnavailable?"incomplete-and-unavailable":"incomplete":r?.semanticUnavailable?"unavailable":"complete";return{files:W(r?.files.map(o=>o.file)??[]),coverage:s}}function Z(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return W(t)}function ee(e,n){let t=b(n),i=v(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 ne(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:x(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function P(e){return{unit:{kind:"file",file:e,shortName:p.basename(e)}}}function te(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:k(r)})}return n}function F(e){return e==="."?[]:H(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function k(e){return C(H(e).map(({marker:n})=>n))}function H(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=q.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function ie(e){if(e.length===0)return null;let n=e.map(i=>d(p.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 re(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":I(t,"package")?"package-level-shared":I(t,"app")?"app-level-shared":$(t,["feature","domain","module"])||$(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function oe(e,n,t,i,r,s,o){let a=se(e,i);if(a)return m(a);let c=he(n.file),u=ae(e,t,c,r,o);if(u)return u;let l=i;if(d(t)===d(l))return m(`${t} is already the nearest common owner for its consumers.`);let y=ce(l,t,c,o);return y||le(l,t,c,s,o)}function se(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 ae(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?L(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=d(p.dirname(i[0])),o=B(n,t,s,r);return o?m(o):L(s)}return null}function ce(e,n,t,i){return ve(e)?M(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=M(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 M(e,n,t,i,r){if(!E(e,t))return m(r);let s=B(n,t,e,i);return s?m(s):L(e)}function L(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(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 de(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 me(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 ge(e,n){return N(n)-N(e)||e.candidatePath.localeCompare(n.candidatePath)}function N(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 fe(e){let n=new Set(["."]);for(let t of e){let i=d(p.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=d(p.dirname(i))}return n}function he(e){let n=w(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function E(e,n){let t=d(e),i=d(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=w(e),r=w(n);return(E(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function B(e,n,t,i){return d(e)===d(t)||!pe(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function I(e,n){return k(e).includes(n)}function $(e,n){let t=k(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?K.has(t):!1}function d(e){let n=b(e);return n===""?".":n}function w(e){let n=b(e);return n==="."?[]:n.split("/").filter(Boolean)}function D(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function W(e){return C([...e]).sort((n,t)=>n.localeCompare(t))}function C(e){return[...new Set(e)]}export{Ae as a};
2
+ //# sourceMappingURL=chunk-SRY26ITJ.js.map
@@ -0,0 +1,2 @@
1
+ function a(r,l){let t=s(r),e=s(l);if(t.endsWith("/**")){let n=t.slice(0,-3);return e===n||e.startsWith(`${n}/`)}if(t.endsWith("/*")){let n=t.slice(0,-2);if(!e.startsWith(`${n}/`))return!1;let i=e.slice(n.length+1);return i.length>0&&!i.includes("/")}return t==="**"?!0:t==="*"?e.length>0&&!e.includes("/"):t===e}function s(r){return r.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}export{a};
2
+ //# sourceMappingURL=chunk-SV2LEFVM.js.map
@@ -1,2 +1,2 @@
1
- import{e as M}from"./chunk-T3DGWPXM.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{o as I}from"./chunk-6CS3UQTN.js";import{d as D}from"./chunk-SGX43S2L.js";import{d as b,j as h,p as x,q as y,u as L}from"./chunk-FETNQCFO.js";import{a as g,e as S}from"./chunk-O6QTXQPJ.js";import{u as d}from"./chunk-BMYOV5GP.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
2
- //# sourceMappingURL=chunk-7XAN6GKB.js.map
1
+ import{e as M}from"./chunk-CSZOQ7YO.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{o as I}from"./chunk-VCL7FK3E.js";import{d as D}from"./chunk-SGX43S2L.js";import{d as b,j as h,p as x,q as y,u as L}from"./chunk-AM5SUGHF.js";import{a as g,e as S}from"./chunk-JOALNFY3.js";import{w as d}from"./chunk-PLZXWZHY.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
2
+ //# sourceMappingURL=chunk-T3YFIJ5P.js.map
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{e as p,o as x,q as l,r as g,u as v}from"./chunk-CIVYHK7U.js";import{M as h,P as u,da as f}from"./chunk-W3FK73MD.js";import{d}from"./chunk-D62CTZX6.js";import{l as m}from"./chunk-G2XUZCF2.js";import{existsSync as C}from"fs";var E=5e3,S=100,R={prepare:f,freshness:h,ensureService:l,inspectService:g,requestRefresh:v,async reindex(e,t,n,o){let{reindexConfiguredProject:a}=await import("./project-reindex-7HZSLLLY.js");return a(e,t,n,o)},indexExists:C,wait(e){return new Promise(t=>setTimeout(t,e))},now:Date.now};async function I(e,t=R,n={}){if(e.dbPathSource==="env")return{source:"explicit-index",service:{kind:"skipped",reason:"environment"}};if(p(e.commandName,e.config)&&t.indexExists(e.paths.dbPath))return{source:"published-generation",service:{kind:"skipped",reason:"excluded-command"}};let o=y(e,t),a=t.prepare(e.projectRoot,e.config,e.paths,{gitContext:e.gitContext,...o?{watcherGeneration:o}:{}}),r=t.freshness(e.projectRoot,e.config,e.paths),i=t.ensureService({commandName:e.commandName,projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:m,config:e.config,gitContext:e.gitContext});if(r.state==="fresh")return{source:a.kind==="local-fresh"?"existing":"shared-generation",service:i};if((i.kind==="started"||i.kind==="reused")&&(t.requestRefresh(d(e.paths.cacheDir).activityPath,`evidence command ${e.commandName} requires a fresh generation`),r=await F(e,r,t,n,i),r.state==="fresh"))return{source:"watcher",service:i};try{await t.reindex(e.projectRoot,e.config,e.paths,{allowPartial:!1,skipAutoInstall:!0,trigger:{kind:"watch-demand",detail:`codebaseiq ${e.commandName}`},onStatus:()=>{}})}catch(s){throw new Error(`Could not prepare fresh evidence for codebaseiq ${e.commandName}: ${s instanceof Error?s.message:String(s)}`,{cause:s})}if(r=t.freshness(e.projectRoot,e.config,e.paths),r.state!=="fresh")throw new Error(`Could not prepare fresh evidence for codebaseiq ${e.commandName}: index remained ${r.state} (${r.reason})`);return{source:"synchronous-reindex",service:i}}function y(e,t){if(e.config.watch?.enabled===!0)try{return x(t.inspectService({projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:m,gitContext:e.gitContext}))}catch{return}}async function F(e,t,n,o,a){if(a.state.watcher.state==="budget-paused")return t;let r=Math.max(0,o.waitMs??E),i=Math.max(1,o.pollMs??S),s=n.now()+r,c=t;for(;n.now()<s;)if(await n.wait(Math.min(i,Math.max(1,s-n.now()))),u(),c=n.freshness(e.projectRoot,e.config,e.paths),c.state==="fresh")return c;return c}export{I as a};
3
+ //# sourceMappingURL=chunk-T55YPJGB.js.map
@@ -0,0 +1,21 @@
1
+ import{V as Ue,W as Be}from"./chunk-BLKYYQ7C.js";import{U as ce,V as de,X as C,Y as M,Z as N}from"./chunk-IGQQUENU.js";import{A as $e,B as je,K as L,P as Fe,l as le,m as Me,ma as Ge,n as I,p as Ne,q as Le,z as W}from"./chunk-WJOQC4P7.js";import{b as E,j as re,k as ie,l as He,m as se,n as _e,p as De,r as ae,s as D}from"./chunk-ACZDU5GK.js";import{a as We,b as ee,c as te,d as _}from"./chunk-6URCE5QY.js";import{J as y,N as qe,U as Oe,W as oe,X as Pe,Y as k,a as Ie,f as Z,h as f,v as ne,w as x,x as Te}from"./chunk-4O52YNKL.js";import{spawn as Zt}from"child_process";import{existsSync as en,rmSync as rt}from"fs";import{dirname as tn,resolve as V}from"path";import{fileURLToPath as nn}from"url";import{createHash as Lt,randomUUID as ue}from"crypto";import{existsSync as $t,linkSync as jt,readdirSync as Ft,rmSync as w}from"fs";import{basename as Gt,dirname as Ut,join as h}from"path";var S=1,Bt=10*6e4,Vt=10080*6e4,j="requests",T="claims",$="completions",Ke="staging";function Je(e,t,n={}){let r=n.now?.()??new Date,o=zt(n.ttlMs),i=Qt(n.idempotencyKey),s=i?`key-${Lt("sha256").update(i).digest("hex")}`:`request-${(n.randomId??ue)()}`,a={version:S,requestId:s,...i?{idempotencyKey:i}:{},createdAt:r.toISOString(),deadlineAt:new Date(r.getTime()+o).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},c=et(e,s),d=he(e,c,a,n.onStage);if(d.published)return{disposition:"accepted",request:a,achievedDurability:d.achievedDurability,directorySync:d.directorySync};let p=pe(c);if(!p)throw new Error(`Watch refresh request identity ${s} exists but is malformed.`);return{disposition:"duplicate",request:p}}function er(e,t={}){let n=t.now?.()??new Date,r=`claim-${(t.randomId??ue)()}`,o=Math.max(1,Math.floor(t.limit??64)),i=Xe(e).sort(Xt),s=[];for(let a of i){if(s.length>=o)break;if(Ve(e,a.requestId))continue;if(Date.parse(a.deadlineAt)<=n.getTime()){Qe(e,{version:S,requestId:a.requestId,outcome:"expired",completedAt:n.toISOString()});continue}let c={version:S,requestId:a.requestId,claimId:r,claimedAt:n.toISOString()};if(he(e,tt(e,a.requestId),c).published){if(Ve(e,a.requestId)){Ye(e,a.requestId,r);continue}s.push(a)}}return{claimId:r,requests:s}}function tr(e,t,n=()=>new Date,r){let o=n().toISOString();for(let i of t.requests)Qe(e,{version:S,requestId:i.requestId,claimId:t.claimId,outcome:"completed",completedAt:o});r?.("after-completion"),Kt(e,t),r?.("after-claim-release")}function Kt(e,t){for(let n of t.requests)Ye(e,n.requestId,t.claimId)}function nr(e){let t=0;for(let n of b(h(e,T)))w(n,{force:!0}),t++;return t>0&&x(h(e,T)),Ze(e),t}function rr(e){let t=Xe(e),n=new Map,r=Jt(h(e,j),pe);for(let c of b(h(e,$))){let d=F(c);if(!d){r++;continue}n.set(d.requestId,d)}let o=new Set;for(let c of b(h(e,T))){let d=ze(c);if(!d){r++;continue}o.add(d.requestId)}let i=t.filter(c=>!n.has(c.requestId)&&!o.has(c.requestId)),s=[...n.values()].filter(c=>c.outcome==="completed").length,a=[...n.values()].filter(c=>c.outcome==="expired").length;return{pending:i.length,claimed:t.filter(c=>!n.has(c.requestId)&&o.has(c.requestId)).length,completed:s,expired:a,invalid:r,...i.length>0?{oldestPendingAt:i.map(c=>c.createdAt).reduce((c,d)=>Yt(c,d))}:{}}}function or(e,t={}){let n=(t.now?.()??new Date).getTime(),r=Math.max(0,t.retentionMs??Vt),o=0;for(let i of b(h(e,$))){let s=F(i);!s||n-Date.parse(s.completedAt)<r||(w(i,{force:!0}),w(et(e,s.requestId),{force:!0}),o++)}return o>0&&(x(h(e,$)),x(h(e,j))),Ze(e),o}function pe(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&(n.idempotencyKey===void 0||typeof n.idempotencyKey=="string")&&E(n.createdAt)&&E(n.deadlineAt)&&Date.parse(n.deadlineAt)>=Date.parse(n.createdAt)&&typeof n.detail=="string"&&n.detail.length>0})}function ze(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&q(n.claimId)&&E(n.claimedAt)})}function F(e){return fe(e,t=>{let n=t;return n.version===S&&q(n.requestId)&&(n.claimId===void 0||q(n.claimId))&&(n.outcome==="completed"||n.outcome==="expired")&&E(n.completedAt)})}function Qe(e,t){let n=nt(e,t.requestId);if(he(e,n,t).published)return;let r=F(n);if(!r||r.requestId!==t.requestId||r.outcome!==t.outcome)throw new Error(`Watch refresh completion ${t.requestId} conflicts with an existing record.`)}function he(e,t,n,r){let o=h(e,Ke),i=Ut(t),s=ne(o),a=ne(i),c=h(o,`${Gt(t)}.${process.pid}.${ue()}.tmp`);try{let d=D(c,n,{spacing:2,trailingNewline:!0});r?.("after-staged");try{jt(c,t)}catch(u){if(u.code==="EEXIST")return{published:!1};throw u}let p=Te(s,a,d.directorySync,x(i));return r?.("after-published"),{published:!0,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}finally{w(c,{force:!0})}}function Xe(e){let t=[];for(let n of b(h(e,j))){let r=pe(n);r&&t.push(r)}return t}function Ye(e,t,n){let r=tt(e,t),o=ze(r);!o||o.claimId!==n||(w(r,{force:!0}),x(h(e,T)))}function Ze(e){for(let t of b(h(e,Ke),".tmp"))w(t,{force:!0})}function Jt(e,t){return b(e).filter(n=>!t(n)).length}function b(e,t=".json"){return $t(e)?Ft(e,{withFileTypes:!0}).filter(n=>n.isFile()&&n.name.endsWith(t)).map(n=>h(e,n.name)).sort():[]}function fe(e,t){try{let n=JSON.parse(f(e,"watch refresh request record"));return t(n)?n:null}catch{return null}}function et(e,t){return h(e,j,`${t}.json`)}function tt(e,t){return h(e,T,`${t}.json`)}function nt(e,t){return h(e,$,`${t}.json`)}function Ve(e,t){return F(nt(e,t))!==null}function zt(e){if(e===void 0)return Bt;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Qt(e){let t=e?.trim();return t?t.slice(0,512):void 0}function q(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function Xt(e,t){return Date.parse(e.createdAt)-Date.parse(t.createdAt)||e.requestId.localeCompare(t.requestId)}function Yt(e,t){return Date.parse(t)<Date.parse(e)?t:e}var ot=5e3,rn=6e3,on=1e3,ge=10,sn=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","watch"]);function Rr(e){let t=e.classification;if(t.kind!=="live")return;let{state:n}=t;return n.watcher.state==="idle"&&n.lastError===void 0?n.indexGeneration:void 0}function an(e,t=process.env){return t.CODEBASEIQ_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!sn.has(e)}function Ar(e){let t=e.env??process.env;if(t.CODEBASEIQ_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!an(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let n=cn({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:n.disposition,state:n.state}}catch(n){return{kind:"failed",message:n instanceof Error?n.message:String(n)}}}function at(e,t,n){let r=k(V(e));if(n&&k(n.projectRoot)===r)return{projectRoot:r,worktreeKind:"git",worktreeId:n.worktreeId,cliVersion:t};let o=Oe(r);if(o.kind==="error")throw new Error(`Could not establish Git worktree identity for ${r}: ${o.message}`);return o.kind==="non-git"?{projectRoot:r,worktreeKind:"non-git",cliVersion:t}:{projectRoot:r,worktreeKind:"git",worktreeId:o.identity.worktreeId,cliVersion:t}}function Er(e){return U(e,at(e.projectRoot,e.cliVersion,e.gitContext))}function U(e,t){let n=e.runtime??Se,r=C(e.cacheDir),o=M(r.statePath),i=ke(r.lockPath);return{identity:t,classification:dn(o,t,n.now(),n.isProcessAlive),lock:i,lockIsLive:i!==null&&n.isProcessAlive(i.pid),paths:r}}function cn(e){let t=e.runtime??Se,n=at(e.projectRoot,e.cliVersion,e.gitContext),r=U(e,n),o=ye("ensure",r.classification);if(o.kind==="reuse")return G(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} is still alive but its heartbeat is old. Refusing automatic replacement because civil-clock age alone cannot authorize a process signal.`);if(o.kind==="replace")ve(o.state,e,t),O(r.paths,o.state.pid,t);else if(o.kind==="start"){if(r.lockIsLive){let a=it(e,n,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(a)return G(r.paths.activityPath,t),{disposition:"reused",state:a};throw new Error(`codebaseiq watch is already running for ${V(e.projectRoot)} (pid ${r.lock?.pid}; lock: ${r.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}r.classification.kind==="stale"&&O(r.paths,r.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${o.kind}`);if(r=U(e,n),o=ye("ensure",r.classification),o.kind==="reuse")return G(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} remains alive with an old heartbeat; automatic replacement is not authorized.`);let i=e.serverPath??nn(new URL("./watch-server.js",import.meta.url));t.spawnServer(i,n.projectRoot,e.cliVersion,e.watchOverrides??{},e.spawnEnv);let s=it(e,n,t,e.startupTimeoutMs??ot);if(!s)throw new Error(`codebaseiq watch service did not become ready within ${e.startupTimeoutMs??ot}ms.`);return G(r.paths.activityPath,t),{disposition:"started",state:s}}function Cr(e){let t=e.runtime??Se,n=C(e.cacheDir),r=M(n.statePath),o=r?t.isProcessAlive(r.pid)?{kind:"live",state:r}:{kind:"stale",state:r,reason:"dead-process"}:{kind:"stopped"},i=ye("stop",o);if(i.kind==="signal-stop")return ve(i.state,e,t),O(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};if(i.kind==="clean-stale")return O(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};let s=ke(n.lockPath);return i.kind==="already-stopped"&&s&&t.isProcessAlive(s.pid)?(ve(s,e,t),O(n,s.pid,t),{disposition:"stopped",pid:s.pid}):{disposition:"already-stopped"}}function Ir(e,t,n={}){let{durability:r="durable",...o}=n;r==="durable"?D(e,t,o):ae(e,t,o)}function ct(e,t=Date.now()){ae(e,{version:1,at:new Date(t).toISOString()})}function Wr(e,t,n=Date.now(),r={}){Je(C(tn(e)).refreshRequestsPath,t,{...r,now:()=>new Date(n)}),ct(e,n)}function Tr(e){try{let t=JSON.parse(f(e,"watch activity record"));return t.version!==1||!N(t.at)||t.refreshRequestedAt!==void 0&&!N(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function qr(e,t,n={}){let r=n.pid??process.pid,o=n.isProcessAlive??re,i=()=>{},s=n.readProcessIdentity??te,a=n.now??(()=>new Date),c={...ie,wallNow:()=>a().getTime(),isProcessAlive:o,readProcessIdentity:s},d=He(e,{kind:"watch",pid:r,processIdentity:s(r),detail:{projectRoot:V(t)},parseLegacy:B,runtime:c});if(d.kind==="contended"){let p=dt(d.observation);return{acquired:!1,lockPath:e,message:ln(e,t,p),release:i}}return{acquired:!0,lockPath:e,message:"",release:()=>{d.lock.release()}}}function ke(e){return dt(se(e,{parseLegacy:B}))}var B=e=>{let t=lt(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function dt(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return lt(e.parsed)}function lt(e){try{let t=e;if(t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!N(t.startedAt))return null;let n=t.processIdentity===void 0?null:We(t.processIdentity);return t.processIdentity!==void 0&&(!n||n.pid!==t.pid)?null:{version:1,pid:t.pid,...n?{processIdentity:n}:{},projectRoot:t.projectRoot,startedAt:t.startedAt}}catch{return null}}function dn(e,t,n,r){if(!e)return{kind:"stopped"};if(e.protocolVersion!==ce)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let o=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==o)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!r(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let i=Date.parse(e.heartbeatAt);return n-i>de?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function ye(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"refuse-replace",state:t.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return me(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return me(t)}default:return me(e)}}function Or(e){return e.idleTimeoutMs===0||e.watcher.state!=="idle"||(e.liveSessions??0)>0?!1:e.nowMs-e.lastActivityAtMs>=e.idleTimeoutMs}function it(e,t,n,r){let o=n.monotonicNow??_,i=o()+r;for(;o()<=i;){let s=U(e,t).classification;if(s.kind==="live")return s.state;n.sleep(ge)}return null}function ve(e,t,n){let{pid:r}=e;if(!n.isProcessAlive(r))return;st(e,n),n.signalProcess(r);let o=t.stopTimeoutMs??rn,i=n.monotonicNow??_,s=i()+o;for(;i()<=s;){if(!n.isProcessAlive(r))return;n.sleep(ge)}if(!n.forceSignalProcess)throw new Error(`codebaseiq watch service pid ${r} did not stop within ${o}ms and forced termination is unavailable.`);st(e,n),n.forceSignalProcess(r);let a=t.forceStopTimeoutMs??on,c=i()+a;for(;i()<=c;){if(!n.isProcessAlive(r))return;let d=n.readProcessIdentity(r);if(e.processIdentity&&d&&!ee(e.processIdentity,d))return;n.sleep(ge)}throw new Error(`codebaseiq watch service pid ${r} remained alive ${a}ms after forced termination.`)}function O(e,t,n){if(rt(e.statePath,{force:!0}),rt(e.activityPath,{force:!0}),ke(e.lockPath)?.pid===t&&!n.isProcessAlive(t)){let o={...ie,wallNow:n.now,isProcessAlive:n.isProcessAlive,readProcessIdentity:n.readProcessIdentity},i=se(e.lockPath,{parseLegacy:B,runtime:o});_e(e.lockPath,i,{parseLegacy:B,runtime:o})}}function ln(e,t,n){return`error: codebaseiq watch is already running for ${V(t)}${n?` (pid ${n.pid}, started ${n.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function G(e,t){try{(t.recordActivity??ct)(e,t.now())}catch(n){let r=un(n);if(r!=="EPERM"&&r!=="EACCES"&&r!=="EROFS")throw n}}function un(e){return e.code}var Se={now:Date.now,monotonicNow:_,isProcessAlive:re,readProcessIdentity:te,spawnServer(e,t,n,r,o){if(!en(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);Zt(process.execPath,[e,t,n,JSON.stringify(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:{...process.env,...o,CODEBASEIQ_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function st(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its ownership record has no process identity.`);let n=t.readProcessIdentity(e.pid);if(!n)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity is unavailable.`);if(!ee(e.processIdentity,n))throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity does not match the ownership record.`)}function me(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}import{existsSync as m,mkdirSync as pn,rmdirSync as hn,unlinkSync as fn}from"fs";import{homedir as mn}from"os";import{basename as vt,dirname as Q,isAbsolute as gn,join as l,resolve as xe}from"path";import{fileURLToPath as yn}from"url";var ut=["- `codebaseiq search <exact-text>` \u2014 Where does this exact text occur in current project text, and which aligned compiler symbol owns each line? Requires: One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.","- `codebaseiq outline <file>` \u2014 What symbols and nesting exist in this file? Requires: One exact current project file path.","- `codebaseiq entrypoints [text]` \u2014 Which detected external roots or entry-surface candidates match this text? Requires: Optional exact text to filter candidates; otherwise the current indexed repository.","- `codebaseiq evidence` \u2014 Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap? Requires: One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.","- `codebaseiq inspect` \u2014 Which related source units across several known text, symbol, or location anchors should be read together? Requires: One or more exact text, symbol, or file:line selectors naming the unresolved behavior.","- `codebaseiq code <selectors...>` \u2014 What exact source defines these symbols, ranges, or file surfaces? Requires: One or more exact symbols, file:line ranges, or file paths.","- Choose graph controls explicitly: `execution incoming` \u2014 Who can call or reach this?; `execution outgoing` \u2014 What can this call or reach?; `dataflow incoming` \u2014 Where can this value come from?; `dataflow outgoing` \u2014 Where can this value go?; `runtime both` \u2014 Which producer and consumer rendezvous?; `state both` \u2014 What resource is observed or changed?; `temporal both` \u2014 What occurs before or after this?; `contract both` \u2014 What interface constrains this?; `identity both` \u2014 Are these observations the same entity?; `ownership both` \u2014 What contains or owns this?; `dependencies outgoing` \u2014 What does this statically rely on?. The CLI does not infer them from English intent.","- Calibration: exact is directly observed; derived is deterministically computed; candidate needs confirmation; mixed discloses its constituents; unknown cannot support a stronger claim. Read coverage and recovery before making absence claims.","- The controls above are complete for ordinary exploration. Run `codebaseiq capabilities --matrix` only when a named claim depends on uncertain provider support; do not run it for routine orientation."],_r=[{stage:"locate",id:"search",command:"search <exact-text>",question:"Where does this exact text occur in current project text, and which aligned compiler symbol owns each line?",requiredInput:"One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.",returnedFact:"exact cardinality, bounded identities and source, and scope commands that recover withheld matches",evidenceCeiling:"Exact current-text cardinality and locations within reported text coverage; compiler ownership only where aligned.",nonClaim:"Structural source ranking orders exact matches but does not establish task relevance. A literal co-occurrence does not establish a graph relationship.",outputCost:"small",contrasts:["outline: search locates exact text across files; outline enumerates compiler-owned constructs in one known file."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"outline",command:"outline <file>",question:"What symbols and nesting exist in this file?",requiredInput:"One exact current project file path.",returnedFact:"symbol names, nesting, and line ranges",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay.",nonClaim:"File ownership and nesting do not establish execution or task relevance.",outputCost:"small",contrasts:["search: outline enumerates constructs in one known file; search locates exact text across current project text.","code: outline returns identities and ranges; code materializes exact source for selected identities."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"entrypoints",command:"entrypoints [text]",question:"Which detected external roots or entry-surface candidates match this text?",requiredInput:"Optional exact text to filter candidates; otherwise the current indexed repository.",returnedFact:"entry symbols with files, confidence, evidence, and indexed caller counts",evidenceCeiling:"Source/compiler-grounded entry evidence and indexed caller counts; exported-only candidates remain candidates.",nonClaim:"A package-public export or zero indexed callers is an entry candidate, not proof of runtime ingress. Entry classification does not establish that the callable executes.",outputCost:"bounded",contrasts:["entry-map: entrypoints locates possible external roots; entry-map traverses static calls from one selected root.","search: entrypoints classifies callable roots; search only locates exact text and ownership."],gapClosingCommands:["evidence","inspect","code"]},{stage:"project",id:"evidence",command:"evidence",question:"Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap?",requiredInput:"One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.",returnedFact:"batched exact selectors and typed graph relationships; compact endpoints with exact locations and follow-up commands; coverage and recoverable omissions; exact source-recovery command when source was requested with a graph projection; explicit ambiguity failure with exact rerun commands",evidenceCeiling:"Typed edges only to each registered provider ceiling within the explicitly selected projection and reported coverage.",nonClaim:"The projection does not infer which relationships are relevant to the user task. Reference, dependency, data, state, temporal, contract, and identity edges do not become execution claims.",outputCost:"bounded",contrasts:["refs: refs enumerates direct reference sites; evidence traverses explicitly selected typed relationships.","call-graph: call-graph specializes in static calls; evidence can combine execution with other selected families.","value-flow: value-flow specializes in proved transfers; evidence projects bounded dataflow alongside other families.","dependence-slice: dependence-slice computes a program-dependence slice; evidence performs bounded graph projection."],gapClosingCommands:["inspect","code"]},{stage:"read",id:"inspect",command:"inspect",question:"Which related source units across several known text, symbol, or location anchors should be read together?",requiredInput:"One or more exact text, symbol, or file:line selectors naming the unresolved behavior.",returnedFact:"one ranked, deduplicated semantic packet plus exact selector cardinality and explicit expansion coverage",evidenceCeiling:"Complete current source for every materialized syntax unit; bounded selector and packet coverage remain explicit.",nonClaim:"A source packet does not choose which implementation details are relevant to the user task. A reference mention does not establish executable reachability.",outputCost:"potentially-large",contrasts:["code: inspect batches bounded behavior or source gaps; code materializes complete exact source.","evidence: inspect reads implementation units; evidence projects typed relationships without source."],gapClosingCommands:[]},{stage:"read",id:"code",command:"code <selectors...>",question:"What exact source defines these symbols, ranges, or file surfaces?",requiredInput:"One or more exact symbols, file:line ranges, or file paths.",returnedFact:"per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed.",nonClaim:"Source materialization does not establish callers, runtime reachability, or task relevance by itself.",outputCost:"potentially-large",contrasts:["inspect: code materializes complete exact source; inspect batches bounded behavior or source gaps.","outline: code reads selected implementations; outline enumerates file structure without reading every body."],gapClosingCommands:[]}];var g="<!-- codebaseiq:agent-setup:begin -->",R="<!-- codebaseiq:agent-setup:end -->",vn="# codebaseiq:agent-setup",X=[".codex/hooks.json",".claude/settings.local.json"],pt="# codebaseiq:local-agent-hooks:begin",ht="# codebaseiq:local-agent-hooks:end",we="hook-architecture-stop",kt=["claude","codex"],P={claude:".claude/settings.local.json",codex:".codex/hooks.json"},St="sentinel-hook.mjs",kn=l("dist","sentinel-hook.js"),Sn=l("dist","cli.js"),bn="cli-path",xn="installed-projects.json";function Yr(e){let t=e.written.length+e.unchanged.length,n=e.skipped.length;return{verdict:n===0?"ready":t===0?"blocked":"partial",ready:t,skipped:n}}function Zr(e,t={}){let n={written:[],unchanged:[],skipped:[]};return wn(e,n),t.architectureHook!==!1&&En(e,n,t.architectureHook),n}function eo(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return mt(e,"AGENTS.md",t,n),mt(e,"CLAUDE.md",t,n),xt(e,t,n,r=>Ot(Wn(r))),qt(e,t,n),An(e,t,n),n}function wn(e,t){let n=[g,"## codebaseiq","","This repository uses codebaseiq as its primary code exploration surface.","","codebaseiq separates two responsibilities: the agent decides what repository fact it needs, while the tool locates exact referents and reports compiler, runtime, data, state, temporal, contract, identity, ownership, and dependency evidence without guessing task relevance. The ordinary loop is locate an exact root, project explicitly chosen relationships, read behavior only for a named remaining gap, then stop when the requested claims are established.","","- Use codebaseiq for repository exploration, including literal search and exact source reads. Native tools are for applying edits, running checks, binary content, or a specific unsupported gap that codebaseiq has explicitly reported\u2014not a parallel exploration workflow.","- Before exploring, state the few material repository facts the answer depends on. Include behavior-changing predicates, authorization checks, data reshaping, hard bounds, runtime crossings, durable state changes, emitted notifications, returned values, relevant sibling outcomes, and externally visible ordering only when the request depends on them.","- For end-to-end explanations, use the installed codebaseiq-explore guidance to maintain the evidence ledger and audit the final answer; codebaseiq supplies the repository observations.",...ut,"- Any exact symbol or `file:line` returned by a locator is immediately usable as a graph root. There is no required anchor-discovery phase and locator ordering never proves task relevance. For an end-to-end question, include the initiating owner as a root or request incoming execution capable of exposing it; do not assume a core type is the ingress. Locate independent roots together when the question already implies several participants.","- A materialized evidence projection requires repeated `--symbol`, `--at`, or `--search` selectors plus one or more repeated `--edge <family>` flags, explicit `--direction incoming|outgoing|both`, `--depth <n>`, and `--max-edges <n>`. The agent chooses the relationships capable of establishing its claim; the CLI resolves identity, direction, evidence strength, provider support, and coverage. Use optional exact `--subtype <subtype>` and `--connecting` only when the selected roots themselves must be connected. Never request `complete`, `all`, or every family merely to discover what exists; use `--inventory-only` when only counts can determine the next bounded projection.","- Treat execution calls and exact runtime handoffs as executable reachability. Dataflow, state, temporal, contract, identity, ownership, and dependency edges say what a path carries, changes, orders, constrains, identifies, contains, or relies on; they do not become call claims. Treat exact edges as facts only within their stated coverage and candidate edges as leads requiring source confirmation.","- Read every packet as a coverage contract. `accounted` means the requested bounded projection reports every omission; `bounded` means requested edges were placed in stable recoverable folds by the output budget; `incomplete` means a selector or provider could not be resolved. None proves the user task complete, and missing output is no evidence of absence.","- Prefer batched locators, projections, and gap reads. Query count measures exploration efficiency; it never makes a known recoverable material fact optional. Before drilling down, name the still-missing fact. Expand only a printed fold or exact adjacent identity that can establish it; batch independent roots and gaps instead of shuttling between abstraction levels, and repeat only while a named fact remains unresolved.","- Use `codebaseiq inspect --symbol <symbol> --symbol <symbol> --at <file:line> --view behavior` for several named behavioral gaps. Connected behavior is already source evidence; do not reread lines it rendered. Use `codebaseiq code <symbol-or-range>` only when exact implementation syntax can change the decision. Do not replace these reads with `rg`, `grep`, `sed`, or `nl`.","- For a multi-step mutation, preserve later compaction, rollback, and cleanup. For every event, log, or outbox write, preserve its operation and record identity. For coordination, state the lock scope and which checks and writes occur inside it. State whether interruption is prevented, atomic, rolled back, or repaired later. Resolve exact constant values when they can change the answer.","- For a tiered policy or dispatcher, preserve the precedence of its tiers and the exact scope of every bypass; never imply that a later bypass can skip an earlier hard rejection unless the rendered condition proves it.","- For a stateful owner, preserve its lifetime and sharing scope, including whether it is a singleton, shared registry, per-session instance, or per-invocation value.","- Use `codebaseiq diff-impact` to map changed symbols and downstream consumers after a nontrivial edit.","- Use `codebaseiq architecture` to inspect explicit structural rules.","- Use `codebaseiq health` to find React, Vue, duplication, complexity, drift, and cleanup candidates.","- Before claiming a complete relationship set or an absence, inspect coverage and use `--full` only when complete coverage can change the decision. A bounded or unsupported result cannot establish that no caller, route, branch, poller, or consumer exists.","- Before claiming what every callsite passes, read the `trace` or `evidence` claim-support section. Only an eligible callsite-argument claim is backed by complete syntactic invocations; bounded context is not proof.","- Prefer human output for agent reading. Use `--json --result-only` only for a programmatic consumer.","- Never rerun a successful human command as JSON. Before each drilldown, name the still-unanswered fact and check whether an earlier packet already establishes it; if so, update the ledger or draft without another query. Stop when no unanswered fact remains because every additional reasoning step pays again for the accumulated context.","- Before answering, compare the draft to selected statement-complete behavior. Preserve every material behavior-changing predicate, returned default, separately merged field, cache invalidation, and cleanup effect. Do not collapse fields with different operations into a generic summary, and do not re-query evidence already in context.","- With an explicit CODEBASEIQ_SESSION, a complete source unit, a byte-identical exact subset of a prior exact source read, or a graph unit/edge may be replaced by a visible receipt from the same index generation. Preview coverage never suppresses an exact unit; changed bytes, changed graph content, a new generation, or --reemit force full evidence.","- If output emits `Continue exactly:`, run that command unchanged until transport is complete.","- When architecture rules are configured and clean, setup installs one checkout-local Stop hook. It checks architecture only after indexed source changes.","- Commit relevant `.codebaseiq/suppressions/*.json` records with the change. Do not commit local agent-tool settings.",R].join(`
2
+ `);ft(e,"AGENTS.md",n,t);let r=[g,"@AGENTS.md",R].join(`
3
+ `);ft(e,"CLAUDE.md",r,t,o=>o.includes("@AGENTS.md")&&!o.includes(g))}function ft(e,t,n,r,o){let i=l(e,t),s=!1,a=Re(i,t,r,c=>{if(o?.(c.text))return s=!0,{kind:"unchanged"};let d=Rn(c.text,n);return d===c.text?{kind:"unchanged"}:{kind:"write",text:d,...c.revision.exists?{}:{mode:420}}});a&&(!a.changed||s?r.unchanged.push(t):r.written.push(t))}function mt(e,t,n,r){let o=l(e,t);if(n.dryRun){if(!m(o)){r.unchanged.push(t);return}try{let s=f(o,"agent instruction file");s.includes(g)?(gt(s),r.removed.push(t)):r.unchanged.push(t)}catch(s){r.skipped.push({target:t,reason:s instanceof Error?s.message:String(s)})}return}let i=Re(o,t,r,s=>{if(!s.revision.exists||!s.text.includes(g))return{kind:"unchanged"};let a=gt(s.text);return a.length===0?{kind:"delete"}:{kind:"write",text:a}});i&&(i.changed?r.removed.push(t):r.unchanged.push(t))}function Rn(e,t){if(bt(e)==="present"){let r=new RegExp(`${g}[\\s\\S]*?${R}`);return e.replace(r,t)}return e.length>0?`${e.replace(/\n*$/,`
4
+
5
+ `)}${t}
6
+ `:`${t}
7
+ `}function gt(e){bt(e);let t=new RegExp(`${g}[\\s\\S]*?${R}`),n=e.replace(t,"").replace(/\n{3,}/g,`
8
+
9
+ `).trim();return n.length===0?"":`${n}
10
+ `}function bt(e){let t=e.split(g).length-1,n=e.split(R).length-1;if(t===0&&n===0)return"absent";if(t===1&&n===1&&e.indexOf(g)<e.indexOf(R))return"present";throw new Error("managed codebaseiq markers are incomplete, duplicated, or out of order")}function Re(e,t,n,r){try{return W(e,r,{maxRetries:0})}catch(o){n.skipped.push({target:t,reason:o instanceof Error?o.message:String(o)});return}}function An(e,t,n){let r=".git/hooks/pre-commit",o=l(e,r);if(!m(o)){n.unchanged.push(r);return}if(!f(o,"pre-commit hook").includes(vn)){n.skipped.push({target:r,reason:"pre-commit hook is not managed by codebaseiq"});return}if(t.dryRun){n.removed.push(r);return}Re(o,r,n,()=>({kind:"delete"}))?.changed&&n.removed.push(r)}function En(e,t,n={}){let r=(n.inspectReadiness??Cn)(e);if(r.state==="not-configured")return;if(r.state==="blocked"){t.skipped.push({target:"architecture Stop hook",reason:r.reason});return}let o=n.commandPrefix??"codebaseiq";for(let i of X){if(L(e,i)){t.skipped.push({target:i,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}Ee(l(e,i),i,t,s=>In(s,o))}Ct(e,t)}function xt(e,t,n,r){for(let o of X){let i=l(e,o);if(m(i)){if(L(e,o)){n.skipped.push({target:o,reason:"tracked repository config; the checkout-local hook remover will not modify it"});continue}if(t.dryRun){try{let s=At(i);JSON.stringify(r(s))!==JSON.stringify(s)&&n.removed.push(o)}catch(s){n.skipped.push({target:o,reason:v(s)})}continue}Ee(i,o,n,r,!0)}}}function Cn(e){let t=je(e);if(!t.architecture||t.architecture.boundaries.length===0)return{state:"not-configured"};let n=qe(e,t),r=Fe(e,t,n);if(r.state!=="fresh")return{state:"blocked",reason:`the index is ${r.state}; refresh it before installing a persistent architecture grader`};let o;try{o=Ge(e);let i=Be(Ue(o));return i.length>0?{state:"blocked",reason:`the current architecture baseline has ${i.length} enforced violation(s); make the declared policy clean before installing the Stop hook`}:{state:"ready"}}catch(i){return{state:"blocked",reason:v(i)}}finally{o?.close()}}function In(e,t="codebaseiq"){let n=H(e.hooks),r=Array.isArray(n.Stop)?n.Stop:[],o={type:"command",command:`${t} ${we}`,timeout:120,statusMessage:"Checking architecture boundaries"};return{...e,hooks:{...n,Stop:wt(r,{hook:o},Rt)}}}function to(e,t){return e===we&&t.sentinel?.enabled===!0}function Wn(e){let t=H(e.hooks),n=Array.isArray(t.Stop)?t.Stop:[],r=Tn(n),o={...t};r.length>0?o.Stop=r:delete o.Stop;let i={...e};return Object.keys(o).length>0?i.hooks=o:delete i.hooks,i}function H(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Tn(e){return e.map(t=>({...t,hooks:Array.isArray(t.hooks)?t.hooks.filter(n=>!Rt(n)):[]})).filter(t=>t.hooks.length>0)}function Ae(e){return typeof e=="object"&&e!==null&&Array.isArray(e.hooks)}function wt(e,t,n){let r=!1,o=[];for(let i of e){if(!Ae(i)||!i.hooks.some(n)){o.push(i);continue}let s=i.hooks.every(n),a=[],c=!1;for(let d of i.hooks)n(d)?r||(a.push(t.hook),r=!0,c=!0):a.push(d);a.length!==0&&o.push(c&&s?qn({...i,hooks:a},t.matcher):{...i,hooks:a})}return r||o.push({...t.matcher!==void 0?{matcher:t.matcher}:{},hooks:[t.hook]}),o}function qn(e,t){let{matcher:n,...r}=e;return t===void 0?r:{matcher:t,...r}}function Rt(e){if(!e||typeof e!="object")return!1;let t=e.command;return typeof t=="string"&&new RegExp(`(?:^|\\s)${we}$`,"u").test(t)}function Ee(e,t,n,r,o=!1){try{W(e,s=>{let a=s.revision.exists?Et(s.text,e):{},c=r(a);return JSON.stringify(c)===JSON.stringify(a)?{kind:"unchanged"}:o&&Object.keys(c).length===0?{kind:"delete"}:{kind:"write",text:`${JSON.stringify(c,null,2)}
11
+ `,mode:384}}).changed?"written"in n?n.written.push(t):n.removed.push(t):o||n.unchanged.push(t)}catch(i){n.skipped.push({target:t,reason:v(i)})}}function At(e){return Et(f(e,"agent hook settings"),e)}function Et(e,t){let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`Cannot update ${t}: the hook config is not a JSON object.`);return n}function Ct(e,t){let n=oe(e,["rev-parse","--git-path","info/exclude"]),r=n?Pe(e,n):void 0;if(!r||!m(Q(r))){t.skipped.push({target:".git/info/exclude",reason:"Git metadata was not found; local hook files may appear as untracked"});return}let o=On(oe(e,["rev-parse","--show-prefix"])??"");try{W(r,i=>{let s=new RegExp(`${pt}([\\s\\S]*?)${ht}\\n?`,"gu"),a=[...i.text.matchAll(s)].flatMap(A=>A[1].split(`
12
+ `).filter(Nt=>Nt!=="")),c=i.text.replace(s,"").replace(/\n*$/u,""),d=[...X,$e].map(A=>`/${o}${A}`),p=[pt,...new Set([...a,...d]),ht].join(`
13
+ `),u=`${c}${c?`
14
+
15
+ `:""}${p}
16
+ `;return u===i.text?{kind:"unchanged"}:{kind:"write",text:u,mode:420}})}catch(i){t.skipped.push({target:".git/info/exclude",reason:v(i)})}}function On(e){return e.replace(/[\\*?[]/gu,"\\$&")}function v(e){return e instanceof Error?e.message:String(e)}var It={claude:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",timeout:15,async:!0},{event:"Stop",timeout:30},{event:"SessionEnd",timeout:2}],codex:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"apply_patch|Edit|Write",timeout:15},{event:"Stop",timeout:30}]};function Y(e){let t=l(e,"bin");return{directory:t,script:l(t,St),version:l(t,"sentinel-hook.version"),manifest:l(t,"package.json"),cliPath:l(t,bn)}}function Wt(e={}){let t=Pn(e.packageRoot??Q(yn(import.meta.url)));if(!t)return{state:"skipped",reason:"the codebaseiq package root was not found"};let n=l(t.root,kn);if(!m(n))return{state:"skipped",reason:"build the package first (dist/sentinel-hook.js was not found)"};let r=Y(e.cacheRoot??y());try{let o=`${JSON.stringify({name:"codebaseiq",version:t.version,private:!0},null,2)}
17
+ `,i=[K(r.script,Z(n,Tt("sentinel hook bundle"))),K(r.version,Buffer.from(`${t.version}
18
+ `)),K(r.manifest,Buffer.from(o)),K(r.cliPath,Buffer.from(`${xe(t.root,Sn)}
19
+ `))];return{state:"installed",script:r.script,version:t.version,changed:i.some(Boolean)}}catch(o){return{state:"skipped",reason:`the hook binary could not be installed: ${v(o)}`}}}function no(e,t={}){let n=Y(t.cacheRoot??y());if(!(be(n.version,"sentinel hook version")===e&&m(n.cliPath)))return Wt(t)}function Pn(e){let t=e;for(;;){try{let r=JSON.parse(f(l(t,"package.json"),"package manifest"));if(r.name==="codebaseiq"&&typeof r.version=="string")return{root:t,version:r.version}}catch{}let n=Q(t);if(n===t)return;t=n}}function Tt(e){return{maxBytes:Ie,inputKind:e}}function K(e,t){try{if(Z(e,Tt("sentinel hook file")).equals(t))return!1}catch{}return De(e,t),!0}function ro(e,t={}){let n=t.hosts??kt,r=t.cacheRoot??y(),o=Wt({packageRoot:t.packageRoot,cacheRoot:r}),i={written:[],unchanged:[],skipped:[],binary:o,notices:[]};if(o.state==="skipped")return i.skipped.push({target:"sentinel hook binary",reason:o.reason}),i;for(let a of n){let c=P[a];if(L(e,c)){i.skipped.push({target:c,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}let d=[];Ee(l(e,c),c,i,p=>{let u=Dn(p,Mn(a,o.script,t.nodeExecutable));return d=Hn(p,u),u}),a==="codex"&&d.length>0&&i.written.includes(c)&&i.notices.push(`Codex must re-approve the changed hooks (${d.join(", ")}): open Codex once in this project and approve them. The approval it recorded for the old command no longer applies, and codebaseiq can only see that an approval exists, not that it still matches.`)}if(Ct(e,i),n.map(a=>P[a]).some(a=>i.written.includes(a)||i.unchanged.includes(a)))try{Vn(r,e)}catch(a){i.skipped.push({target:"sentinel project registry",reason:v(a)})}return i}function Hn(e,t){let n=o=>`${o.event}:${o.group}:${o.index}:${JSON.stringify(o.hook)}`,r=new Set(z(t).map(n));return[...new Set(z(e).filter(o=>!r.has(n(o))).map(o=>o.event))]}function _n(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return xt(e,t,n,Ot),qt(e,t,n),n}function oo(e={}){let t=e.cacheRoot??y(),n={removed:[],unchanged:[],skipped:[]};for(let o of Bn(t)){if(!m(o)){e.dryRun||Mt(t,o);continue}let i=_n(o,{dryRun:e.dryRun,cacheRoot:t});n.removed.push(...i.removed.map(s=>l(o,s))),n.skipped.push(...i.skipped.map(s=>({...s,target:l(o,s.target)})))}let r=Y(t);if(n.skipped.length>0)return m(r.script)&&n.skipped.push({target:r.script,reason:"kept: hooks that run it could not be removed from every project; run uninstall again once they can"}),n;for(let o of[r.script,r.version,r.manifest,r.cliPath])if(m(o)&&(n.removed.push(o),!e.dryRun))try{fn(o)}catch(i){n.skipped.push({target:o,reason:v(i)})}if(!e.dryRun)try{hn(r.directory)}catch{}return n}function qt(e,t,n){let r=X;if(!(t.dryRun||n.skipped.some(o=>r.includes(o.target))))try{Mt(t.cacheRoot??y(),e)}catch(o){n.skipped.push({target:"sentinel project registry",reason:v(o)})}}function J(e){if(!e||typeof e!="object")return!1;let{command:t,args:n}=e;return Array.isArray(n)&&n.includes(I)?!0:typeof t=="string"&&t.split(/\s+/u).includes(I)}function Dn(e,t){let n={...H(e.hooks)};for(let{event:r,...o}of t){let i=n[r];n[r]=wt(Array.isArray(i)?i:[],o,J)}return{...e,hooks:n}}function Ot(e){let t=H(e.hooks),n={},r=!1;for(let[i,s]of Object.entries(t)){if(!Array.isArray(s)){n[i]=s;continue}let a=[];for(let c of s){if(!Ae(c)||!c.hooks.some(J)){a.push(c);continue}r=!0;let d=c.hooks.filter(p=>!J(p));d.length>0&&a.push({...c,hooks:d})}(a.length>0||s.length===0)&&(n[i]=a)}if(!r)return e;let o={...e};return Object.keys(n).length>0?o.hooks=n:delete o.hooks,o}function Mn(e,t,n=process.execPath){return It[e].map(r=>({event:r.event,...r.matcher!==void 0?{matcher:r.matcher}:{},hook:e==="claude"?Nn(t,r):Ln(t,r,n)}))}function Nn(e,t){return{type:"command",command:"node",args:[e,"--host","claude",...t.async?["--async"]:[],I],...t.async?{async:!0,asyncRewake:!0}:{},timeout:t.timeout}}function Ln(e,t,n){let r=gn(n)&&/^node(?:\.exe)?$/iu.test(vt(n))?n:"node";return{type:"command",command:`${process.platform==="win32"?"& ":""}${yt(r)} ${yt(e)} --host codex ${I}`,timeout:t.timeout}}function yt(e){if((process.platform==="win32"?/["\r\n%$`]/u:/["\r\n$`]/u).test(e))throw new Error(`${JSON.stringify(e)} cannot be quoted in a Codex hook command`);return`"${e}"`}function z(e){let t=[];for(let[n,r]of Object.entries(H(e.hooks)))Array.isArray(r)&&r.forEach((o,i)=>{Ae(o)&&o.hooks.forEach((s,a)=>{J(s)&&t.push({event:n,group:i,index:a,hook:s})})});return t}function Pt(e){if(m(e))try{return At(e)}catch{return}}function io(e,t={}){let n=Y(t.cacheRoot??y()),r=be(n.version,"sentinel hook version"),o=be(n.cliPath,"sentinel hook CLI path");return{binary:{script:n.script,present:m(n.script),...r?{version:r}:{},...o?{cliTarget:o}:{}},hosts:kt.map(i=>{let s=P[i],a=Pt(l(e,s)),c=a?z(a):[],d=It[i].map(u=>u.event),p=new Set(c.map(u=>u.event));return{host:i,file:s,events:d.filter(u=>p.has(u)),missing:d.filter(u=>!p.has(u)),scripts:[...new Set(c.flatMap(u=>$n(u.hook)))]}})}}function be(e,t){try{return f(e,t).trim()||void 0}catch{return}}function $n(e){return(Array.isArray(e.args)?e.args.filter(n=>typeof n=="string"):[...e.command.matchAll(/"([^"]*)"|(\S+)/gu)].map(n=>n[1]??n[2]??"")).filter(n=>vt(n)===St)}function so(e,t={}){let n=l(e,P.codex),r=Pt(n),o=r?z(r):[];if(o.length===0)return;let i=l(t.codexHome??process.env.CODEX_HOME??l(mn(),".codex"),"config.toml"),s=Gn(i),a=[...new Set([n,l(k(e),P.codex)])];return{configPath:i,hooks:o.map(({event:c,group:d,index:p})=>{let u=`:${Un(c)}:${d}:${p}`;return{event:c,key:`${n}${u}`,trusted:a.some(A=>s.has(Ht(`${A}${u}`)))}})}}var jn=/^\s*\[hooks\.state\.(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\]\s*(?:#.*)?$/u,Fn=/^\s*trusted_hash\s*=\s*"sha256:[0-9a-f]+"/u;function Gn(e){let t=new Set,n;try{n=f(e,"Codex config")}catch{return t}let r;for(let o of n.split(/\r?\n/u)){let i=jn.exec(o);i?r=Ht(i[1]??(i[2]??"").replace(/\\(["\\])/gu,"$1")):/^\s*\[/u.test(o)?r=void 0:r!==void 0&&Fn.test(o)&&t.add(r)}return t}function Un(e){return e.replace(/([a-z])([A-Z])/gu,"$1_$2").toLowerCase()}function Ht(e){return process.platform==="win32"?e.replaceAll("/","\\").toLowerCase():e}function ao(e){let t={...Le.delivery};try{let n=JSON.parse(f(l(e,le,Me),"sentinel settings")).delivery;for(let r of Ne){let o=n?.[r];(o==="shadow"||o==="live")&&(t[r]=o)}}catch{}return t}function Ce(e){return l(e,le,xn)}function Bn(e=y()){try{return _t(f(Ce(e),"sentinel project registry"))}catch{return[]}}function _t(e){try{let{projects:t}=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Dt(e,t){let n=Ce(e);pn(Q(n),{recursive:!0}),W(n,r=>{let o=t(r.revision.exists?_t(r.text):[]);return o===void 0?{kind:"unchanged"}:{kind:"write",text:`${JSON.stringify({projects:o},null,2)}
20
+ `,mode:384}})}function Vn(e,t){let n=k(xe(t));Dt(e,r=>r.includes(n)?void 0:[...r,n].sort())}function Mt(e,t){if(!m(Ce(e)))return;let n=k(xe(t));Dt(e,r=>r.includes(n)?r.filter(o=>o!==n):void 0)}export{Je as a,er as b,tr as c,Kt as d,nr as e,rr as f,or as g,Rr as h,an as i,Ar as j,at as k,Er as l,cn as m,Cr as n,Ir as o,Wr as p,Tr as q,qr as r,Or as s,_r as t,Yr as u,Zr as v,eo as w,to as x,Ct as y,no as z,ro as A,_n as B,oo as C,io as D,so as E,ao as F};
21
+ //# sourceMappingURL=chunk-TAJ6UGCO.js.map