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
@@ -1,5 +0,0 @@
1
- import{closeSync as te,fstatSync as N,openSync as re,readFileSync as mt,readSync as Ce}from"fs";import{createHash as yt}from"crypto";var ke=8*1024*1024,Fe=64*1024*1024,St=512*1024*1024,xt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function Ee(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);Ie(i,t,r);let o=mt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return Ee(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:ke,inputKind:t})}function bt(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=Ce(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function Pt(e,t,r="utf8"){return ne(e,t).toString(r)}function ve(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function jt(e,t,r="utf8"){return ve(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);Ie(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=Ce(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function wt(e,t){let r=yt("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function Ie(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(_e.has(n)||r.some(o=>M(n,o))||t.some(o=>Be(n,o)))return"config";if(t.some(Ne)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Le(n);return t.some(o=>(ze[o]??[]).includes(i))?"source":"other"}function Te(e,t,r){let n=se(e);if(_e.has(n)||r?.some(o=>M(n,o))||Be(n,t)||Ne(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Le(n);return(ze[t]??[]).includes(i)}function jn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!De(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!De(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(Ct)?null:t}function wn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Re(e?.files??[])||Re(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(kt)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Ft(e,t):!0,uncertainty:[...s].sort()}}function De(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Re(e){return new Set(e.map(t=>t.path)).size!==e.length}function Ct(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function kt(e){return e.hash==="unreadable"||e.size<0}function Ft(e,t){return Oe(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Oe(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Oe(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var _e=new Set([".codebaseiq.json"]),Et={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},vt={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Ae=new Map;function Be(e,t){return Et[t].some(r=>M(e,r))||vt[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Ae.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Ae.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Le(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function Ne(e){return e==="typescript"||e==="javascript"}var ze={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as It}from"module";var Dt=It(import.meta.url),Me=Rt().version;function Rt(){for(let e of["../package.json","../../package.json"])try{return Dt(e)}catch{}return{version:"0.0.0"}}import{createHash as Ke,randomUUID as Nt}from"crypto";import{chmodSync as Xe,existsSync as k,linkSync as zt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Mt,writeSync as Gt}from"fs";import{homedir as Wt}from"os";import{basename as $t,dirname as U,isAbsolute as qe,join as y,resolve as q}from"path";import{closeSync as Ot,existsSync as At,fsyncSync as Tt,mkdirSync as _t,openSync as Bt}from"fs";import{dirname as We}from"path";function Ge(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>At(e),makeDirectory:e=>_t(e,{recursive:!0}),openFile:(e,t,r)=>Bt(e,t,r),syncFile:e=>Tt(e),closeFile:e=>Ot(e)});function $e(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=We(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G(We(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Ue,relative as Lt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function An(e){return e.replace(/\\/g,"/")}function Tn(e,t){return ce(e)===ce(t)}function He(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function _n(e,t){return He(e)===He(t)}function S(e,t){let r=Lt(e,t);return r===""||!r.startsWith("..")&&!Ue(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Ue(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ye=1,A=".codebaseiq-cache-owner.json",Ht=16*1024,Ve=Object.freeze({...R,randomToken:()=>Nt(),linkFile:(e,t)=>zt(e,t),removeFile:e=>Mt(e),writeFile:(e,t,r,n)=>Gt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Ut(e,t){let r=x(e);return Jt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?q(n):t?.dbPath?Xt(r,t.dbPath):qt(r)}function Qe(){let e=process.env.XDG_CACHE_HOME;return y(e||y(Wt(),".cache"),"codebaseiq")}function qt(e){let t=q(e);try{t=x(t)}catch{}let r=Ke("sha256").update(t).digest("hex").slice(0,12);return y(Qe(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Qe(),"repositories",e);return tt(t),x(t)}function Jn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Kn(e,t){let r=Ut(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Jt(e,t,r=Ve){return Kt(e,t,r).cacheDir}function Kt(e,t,r=Ve){let n=x(e),i=k(t)?"synced":tt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Je(o),er(o),Je(o);let c=`${JSON.stringify({schemaVersion:Ye,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Me},null,2)}
2
- `;try{let u=tr(s,c,r),l=W(i,u);return{kind:"published",cacheDir:o,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}catch(u){if(nr(u))return ue(n,o),{kind:"existing",cacheDir:o};throw u}}function ue(e,t){let r=x(e),n=x(t);return Vt(n,r,n)}function Xn(e,t){return k(y(t,A))?(ue(e,t),Ze(t),!0):!1}function Xt(e,t){let r;try{r=C(t)}catch(s){throw s instanceof m?$(t,s.reason):s}let n=q(e,...r.split("/"));if(n===e||!S(e,n))throw $(t,"outside-project");let i=Yt(n),o=x(i);if(!S(e,o)&&o!==e)throw $(t,"symlink-escape");return n}function Yt(e){let t=e;for(;!k(t);){let r=U(t);if(r===t)throw $(e,"no-existing-ancestor");t=r}return t}function Vt(e,t,r){let n=y(e,A);if(!k(n)||H(n).isSymbolicLink())throw b(e,"missing regular ownership record");let i=H(n);if(!i.isFile()||i.size>Ht)throw b(e,"invalid ownership record file");let o=D(n,"cache ownership record"),s=Qt(o,e);if(s.canonicalProjectRoot!==t)throw b(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw b(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Ke("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Qt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Ye||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!qe(r.canonicalProjectRoot)||!qe(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw b(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Je(e){let t=le(e).filter(r=>r!==A&&!Zt(r));if(t.length>0)throw b(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function Zt(e){return e.startsWith(`${A}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function er(e){for(let t of le(e)){let r=y(e,t);try{let n=H(r);if(n.isSymbolicLink())throw b(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())O(r);else if(n.isFile())pe(r);else throw b(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(et(n))continue;throw n}}O(e)}function Ze(e,t=!1){try{let r=H(e);if(r.isSymbolicLink())throw b(e,"managed cache tree contains a symlink");if(r.isFile()){pe(e);return}if(!r.isDirectory())throw b(e,"managed cache tree contains a special file");O(e);for(let n of le(e))Ze(y(e,n),!0)}catch(r){if(t&&et(r))return;throw r}}function et(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function tt(e,t=R){let r=$e(e,t);return O(e),r}function tr(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,i,o=!1;try{i=r.openFile(n,"wx",384),o=!0,Ge(i,Buffer.from(t),r,"cache ownership record"),r.syncFile(i),r.closeFile(i),i=void 0,r.linkFile(n,e);let s=G(U(e),r);return r.removeFile(n),o=!1,W(s,G(U(e),r))}finally{if(i!==void 0)try{r.closeFile(i)}catch{}if(o)try{r.removeFile(n)}catch{}}}function O(e){process.platform!=="win32"&&Xe(e,448)}function pe(e){process.platform!=="win32"&&Xe(e,384)}function rr(e){if(k(e))return x(e);let t=[],r=e;for(;;){let n=U(r);if(n===r)return e;if(t.unshift($t(r)),k(n))return y(x(n),...t);r=n}}function Yn(e){return rr(q(e))}function nr(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as ir}from"child_process";import{createHash as or}from"crypto";import{existsSync as sr,lstatSync as ar,realpathSync as cr}from"fs";import{dirname as ur,isAbsolute as lr,join as dr,resolve as K}from"path";var T={run(e,t){let r=rt(e,t);return r.kind==="success"?r.output:void 0},runResult:rt},pr=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],fe=/^[0-9a-f]{40,64}$/;function ri(e,t,r=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!fe.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function ni(e,t=T){let r=t.runResult(e,pr);if(r.kind==="success"){let n=fr(r.output);if(n)return gr(n,t)}return hr(e,t)}function fr(e){let t=e.split(`
3
- `).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!fe.test(o)||!fe.test(s))return;let a=P(r);return{root:a,gitDir:P(J(a,n)),commonDir:P(J(a,i)),headCommit:o,treeOid:s}}function gr(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...nt(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:he("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function hr(e,t){let r=mr(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=P(J(i,o)),a=ge(t.run(i,["rev-parse","--verify","HEAD"])),c=ge(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(u!==void 0)return{...n,commonDir:s,repositoryId:he("repository",s),headCommit:a,treeOid:c,clean:u.length===0}}function mr(e,t=T){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=P(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=P(J(i,o));return{kind:"worktree",identity:nt(i,s)}}function nt(e,t){return{projectRoot:e,gitDir:t,worktreeId:he("worktree",`${e}\0${t}`)}}function ii(e,t=T){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:yr(r)}function yr(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:P(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function oi(e,t,r=T){return ge(r.run(e,t))}function J(e,t){return lr(t)?t:K(e,t)}function P(e){try{return cr(e)}catch{return K(e)}}function he(e,t){return or("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ge(e){return e?.trim()||void 0}function rt(e,t){let r=ir("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&sr(K(e)))&&!Sr(e)?{kind:"not-repository"}:{kind:"error",message:i}}function Sr(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=K(e);for(;;){try{return ar(dr(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=ur(t);if(r===t)return!1;t=r}}import{execFileSync as Kr}from"child_process";import{createHash as pt}from"crypto";import{closeSync as Xr,fstatSync as ft,lstatSync as xe,openSync as Yr,readdirSync as Vr,readFileSync as Qr,readlinkSync as Zr,realpathSync as V}from"fs";import{isAbsolute as en,join as be,relative as tn,resolve as rn,sep as nn}from"path";import{execFileSync as me}from"child_process";import{createHash as xr}from"crypto";import{mkdirSync as br,renameSync as Pr,writeFileSync as jr}from"fs";import{basename as wr,dirname as Cr,join as kr}from"path";var Fr="git-content-hashes.json",Er=32*1024*1024,vr=2e5,X=3e4,ye={encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:X,killSignal:"SIGKILL"};function it(e){let t,r;try{t=me("git",["-C",e,"ls-files","-s","-z","--","."],{...ye,timeout:X}),r=me("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...ye,timeout:X})}catch{return null}let n=new Map,i=[];for(let l of t.split("\0")){if(!l)continue;let f=l.indexOf(" "),p=f>0?l.slice(0,f).split(" "):[];if(p.length!==3)continue;let[h,g,L]=p,w=l.slice(f+1);if(h!=="100644"&&h!=="100755"||L!=="0"){n.delete(w);continue}n.set(w,g),wr(w)===".gitattributes"&&i.push(`${w}:${g}`)}let o=new Set;for(let l of r.split("\0"))l.length>=4&&l[2]===" "&&o.add(l.slice(3));let s=Ir(e,i),a=kr(de(e),Fr),c=Dr(a,s),u=new Map;return{lookup(l){if(o.has(l))return;let f=n.get(l);if(f)return u.get(f)??c.entries[f]},seed(l,f){if(o.has(l))return;let p=n.get(l);!p||c.entries[p]||u.has(p)||u.set(p,f)},persist(){if(u.size===0)return;let l=new Set(n.values()),f={};for(let[p,h]of Object.entries(c.entries))l.has(p)&&(f[p]=h);for(let[p,h]of u)f[p]=h;if(!(Object.keys(f).length>vr))try{br(Cr(a),{recursive:!0});let p=`${a}.${process.pid}.tmp`;jr(p,JSON.stringify({version:1,salt:s,entries:f})),Pr(p,a)}catch{}}}}function Ir(e,t){let r="";try{r=me("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...ye,timeout:X})}catch{}return xr("sha256").update(JSON.stringify([r.trim(),t.sort()])).digest("hex")}function Dr(e,t){let r={version:1,salt:t,entries:{}};try{let n=I(e,{maxBytes:Er,inputKind:"git-content-hash-store"}),i=JSON.parse(n);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return r;let o={};for(let[s,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(s)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[s]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return r}}import{AsyncLocalStorage as Rr}from"async_hooks";var Or=new Rr;function E(e,t){let r=Y(e);if(!r||r.missing.has(t))return;let n=r.files.get(t);if(n)return n;let i=r.readBaseFile?.(t);return i&&r.files.set(t,i),i}function v(e,t){let r=Y(e);if(r)return r.missing.has(t)?"missing":r.paths.includes(t)?"present":"missing"}function ot(e,t){return Y(e)?.fingerprints.get(t)}function F(e){return Y(e)?.paths}function Y(e){let t=Or.getStore();if(t)return t.projectRoot===P(e)?t:void 0}import{createRequire as Ar}from"module";import{existsSync as Tr,readdirSync as _r,statSync as Br}from"fs";import d from"path";var Lr=Ar(import.meta.url),st=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function Nr(e,t=[]){let r=d.resolve(e),n=t.flatMap(c=>Mr(r,c));if(n.length>0)return at(r,ut(n));let i=zr(r),o=ut(i),s=Gr(r,o)?[r,...o]:o,a=s.length>0?s:[r];return at(r,a)}function lt(e,t,r=[]){let n;try{n=Lr("ts-morph")}catch{return null}let i=d.resolve(e),o=t==="workspace"?Nr(i,r):["."],s=new Set;for(let a of o){let c=a==="."?i:d.join(i,a),u=d.join(c,"tsconfig.json"),l=Ur(n.ts,i);if(!l.fileExists(u))return null;let f=n.ts.readConfigFile(u,l.readFile);if(f.error)return null;let p=n.ts.parseJsonConfigFileContent(f.config,l,c);if(p.errors.length>0)return null;for(let h of p.fileNames){let g=d.resolve(h);S(i,g)&&s.add(d.relative(i,g).split(d.sep).join("/"))}}return s}function at(e,t){return[...new Set(t.map(r=>_(e,r)))].sort((r,n)=>r.localeCompare(n))}function zr(e){let t=F(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>st.has(s)))return[];let o=d.join(e,...i.split("/"));return ct(e,o)?[d.dirname(o)]:[]});let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=_r(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=d.join(i,s.name);if(s.isDirectory()){!st.has(s.name)&&!s.name.startsWith(".")&&n.push(a);continue}s.isFile()&&ct(e,a)&&r.push(d.dirname(a))}}return r}function Mr(e,t){let r=t.trim();if(!r)return[];let n=d.resolve(e,r);if(!S(e,n))return[];let i=F(e);if(i){let o=_(e,n);if(i.includes(o)&&Se(d.basename(n)))return[d.dirname(n)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[n]:[]}try{let o=Br(n);if(o.isDirectory())return[n];if(o.isFile()&&Se(d.basename(n)))return[d.dirname(n)]}catch{return[]}return[]}function ct(e,t){if(!Se(d.basename(t)))return!1;let r=dt(e,t);return r?d.basename(t)==="tsconfig.json"||"include"in r||"files"in r||"references"in r:!1}function Se(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function ut(e){let t=[...new Set(e.map(r=>d.resolve(r)))].sort((r,n)=>r.localeCompare(n));return t.length<=1?t:t.filter(r=>!t.some(n=>n!==r&&Jr(r,n)))}function Gr(e,t){if(t.length===0||t.some(n=>d.resolve(n)===e))return!1;let r=d.join(e,"tsconfig.json");return $r(e,r)&&Wr(e,r)}function Wr(e,t){let n=dt(e,t)?.include;return Array.isArray(n)?n.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!d.extname(i))):!1}function dt(e,t){try{let r=JSON.parse(Hr(e,t));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function $r(e,t){let r=_(e,t),n=v(e,r);return n?n==="present":Tr(t)}function Hr(e,t){let r=_(e,t);if(F(e)){let i=E(e,r);if(!i)throw Object.assign(new Error(`Snapshot file ${r} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return D(t,"TypeScript project config")}function Ur(e,t){let r=F(t);if(!r)return e.sys;let n=d.resolve(t),i=new Set(r),o=qr(n,r),s=e,a=c=>{let u=d.resolve(c);return S(n,u)?_(n,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):E(n,u)?.content.toString("utf8")},readDirectory(c,u,l,f,p){let h=d.resolve(c);return S(n,h)?s.matchFiles(h,u,l,f,e.sys.useCaseSensitiveFileNames,n,p,g=>o.get(d.resolve(g))??{files:[],directories:[]},g=>g):e.sys.readDirectory(c,u,l,f,p)}}}function qr(e,t){let r=new Map,n=new Map,i=o=>{r.has(o)||r.set(o,new Set),n.has(o)||n.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),n.get(a).add(u),a=d.join(a,u),i(a)}r.get(a).add(s.at(-1))}return new Map([...r].map(([o,s])=>[o,{files:[...s].sort(),directories:[...n.get(o)??[]].sort()}]))}function _(e,t){let r=d.relative(e,t);return r?r.split(d.sep).join("/"):"."}function Jr(e,t){let r=d.relative(e,t);return!!r&&!r.startsWith("..")&&!d.isAbsolute(r)}var Q=64*1024*1024,B=class extends Error{constructor(r,n,i,o){super(`${r} ${JSON.stringify(n)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=r;this.inputPath=n;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function on(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function gt(e,t,r={}){let n=C(t),i=V(e),o=rn(i,...n.split("/"));if(!S(i,o)||o===i)throw new m(t,"outside-project");let s=V(o);if(!S(i,s)||s===i)throw new m(t,"outside-project");let a=xe(s);if(!a.isFile())throw new m(t,"not-a-file");let c={projectRoot:i,relativePath:n,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=r.maxBytes??Q;if(ht(u),c.size>u)throw new B(r.inputKind??"project file",c.relativePath,c.size,u);return c}function sn(e,t,r={}){let n=C(t),i=v(e,n);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(n)} does not exist.`),{code:"ENOENT"});let c=E(e,n);if(!c)throw new m(n,"changed-during-read");let u=r.maxBytes??Q;if(ht(u),c.size>u)throw new B(r.inputKind??"project file",n,c.size,u);return Buffer.from(c.content)}let o=gt(e,t,r),s=r.maxBytes??Q,a=Yr(o.absolutePath,"r");try{let c=ft(a);if(!c.isFile()||c.dev!==o.device||c.ino!==o.inode||c.size!==o.size)throw new m(t,"changed-during-read");if(c.size>s)throw new B(r.inputKind??"project file",o.relativePath,c.size,s);let u=Qr(a),l=ft(a);if(l.dev!==c.dev||l.ino!==c.ino||l.size!==c.size||u.byteLength!==c.size)throw new m(t,"changed-during-read");return u}finally{Xr(a)}}function Ti(e,t,r={}){return sn(e,t,r).toString("utf8")}function Pe(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function _i(e,t){try{return gt(e,t),!0}catch(r){if(Pe(r))return!1;throw r}}function ht(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function an(e){return(F(e)??fn(e)??gn(e)).filter(t=>t&&!je(t)).sort()}function cn(e,t={}){let r=(t.includePaths??[]).map(C),n=[...new Set([...an(e),...r])].filter(c=>!je(c)).filter(c=>!t.language||Te(c,t.language,t.markerFiles)).filter(c=>!t.includePath||t.includePath(c)).sort(),i=V(e),o,s=()=>o??=it(i),a=n.flatMap(c=>{let u=ot(e,c);if(u)return[{path:c,size:u.fingerprintSize??u.size,hash:u.sha256}];let l=v(e,c);if(l==="present"){let g=E(e,c);if(g)return[{path:c,size:g.fingerprintSize??g.size,hash:g.sha256}]}let f=l===void 0?s():null,p=f?.lookup(c);if(p)return[{path:c,size:p.size,hash:p.hash}];let h=be(e,c);try{if(xe(h).isSymbolicLink()){let Z=V(h),ee=tn(i,Z);if(ee===".."||ee.startsWith(`..${nn}`)||en(ee))throw new Error("external symlink");let we=Zr(h);return[{path:c,size:Buffer.byteLength(we),hash:pt("sha256").update("symlink\0").update(we).digest("hex")}]}let g=pt("sha256"),L=z(h,{inputKind:"project fingerprint input",maxBytes:Q},Z=>g.update(Z)),w=g.digest("hex");return f?.seed(c,{size:L,hash:w}),[{path:c,size:L,hash:w}]}catch(g){return Pe(g)?[]:[{path:c,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Bi(e,t,r){let n=dn(t,r),i=[...n.typescriptProjects.filter(s=>ln(e,s)),...n.clojureConfigPath?[n.clojureConfigPath]:[]],o=n.languages.includes("typescript")?lt(e,n.typescriptProjectMode,n.typescriptProjects):null;return{...n,files:cn(e,{includePath:s=>{let a=oe(s,t,i);return a==="other"?!1:a!=="source"||!un(s)||!o?!0:o.has(s)},includePaths:i})}}function un(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function ln(e,t){let r;try{r=C(t)}catch{return!1}let n=v(e,r);if(n)return n==="present";try{return xe(be(e,r)).isFile()}catch(i){if(Pe(i))return!1;throw i}}function dn(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:on(t.typescriptProjects),clojureConfigPath:pn(t.clojureConfigPath)}}function pn(e){return e?.trim()||void 0}function fn(e){try{return Kr("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
4
- `).filter(Boolean)}catch{return null}}function gn(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?be(e,n):e,o;try{o=Vr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){je(a)||r.push(a);continue}t.push(a)}}return t}function je(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(r=>hn.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var hn=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{ke as a,Fe as b,St as c,xt as d,j as e,Ee as f,I as g,D as h,bt as i,Pt as j,jt as k,z as l,wt as m,oe as n,jn as o,wn as p,Ct as q,Et as r,Ge as s,ae as t,R as u,$e as v,G as w,W as x,m as y,ce as z,An as A,Tn as B,He as C,_n as D,S as E,C as F,Me as G,A as H,de as I,Qe as J,qt as K,qn as L,Jn as M,Kn as N,Xn as O,Yn as P,T as Q,ri as R,ni as S,mr as T,ii as U,oi as V,J as W,P as X,Nr as Y,B as Z,on as _,gt as $,sn as aa,Ti as ba,Pe as ca,_i as da,an as ea,cn as fa,Bi as ga,dn as ha};
5
- //# sourceMappingURL=chunk-WE5RZHZ7.js.map
@@ -1,3 +0,0 @@
1
- import{I as je,L as Me,Q as Ne,R as Fe,a as J,b as ye,d as be,n as Pe,o as ke,q as Ae,r as Te}from"./chunk-QW7EP6WI.js";import{e as _e}from"./chunk-FM5BPL4V.js";import{a as f,c as he,g as y,l as Oe,p as we,q as Ee,u as z,v as $e,x as X,y as De}from"./chunk-RDBI2RXU.js";import{i as Se}from"./chunk-R2NOK63J.js";import{d as ve}from"./chunk-EF2R3WNQ.js";import{N as Ce,X as Re,a as le,b as fe,g as me,ga as Ie,h as F,j as ge,w as xe}from"./chunk-WE5RZHZ7.js";import{existsSync as W,statSync as Yn}from"fs";import{join as Wn}from"path";import{existsSync as E}from"fs";import{randomUUID as st}from"crypto";import{isAbsolute as tt,join as x,relative as nt,resolve as rt}from"path";var C=1,R=2,It="./node_modules/codebaseiq/docs/schemas/project-config.schema.json";function Q(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(a){return{kind:"malformed",reason:`invalid JSON: ${a instanceof Error?a.message:String(a)}`}}if(!f(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?C:n;if(r!==C&&r!==R)return{kind:"unsupported",schemaVersion:r,direction:r<C?"older":"future"};let i=t.$schema;if(i!==void 0&&(typeof i!="string"||i.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let o=$(t),s=r!==R||typeof t.$schema!="string";return r===C?{kind:"legacy",sourceVersion:C,config:o,needsMigration:s}:{kind:"supported",sourceVersion:R,config:o,needsMigration:s}}function $(e){let t=e,{$schema:n,schemaVersion:r,...i}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:It,schemaVersion:R,...i}}function Ve(e){return`${JSON.stringify($(e),null,2)}
2
- `}import{createHash as wt}from"crypto";var v=1,A=2,Ue=1,ne=1,te="sha256",Et=1;function ir(e,t,n){if(!y(e)||!Je(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:Ue,canonicalizationVersion:ne,hashAlgorithm:te,projection:{name:e,version:t},digest:wt(te).update(Pt(e,t,n)).digest("hex")}}function Pt(e,t,n){return`{"canonicalizationVersion":${ne},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function kt(e){if(!f(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===v)return Ft(e)?{kind:"legacy",schemaVersion:v,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===A)return $t(e)?{kind:"supported",schemaVersion:A,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<v?"older":"future"}}function He(e){let t=kt(e);return t.kind==="legacy"||t.kind==="supported"}function At(e,t){return{collaborationDomain:w(b(e,n=>n.facts.collaborationDomain),b(t,n=>n.facts.collaborationDomain)),repositoryLineage:w(b(e,n=>n.facts.repositoryLineage),b(t,n=>n.facts.repositoryLineage)),workspaceInstance:w(b(e,n=>n.facts.workspaceInstance),b(t,n=>n.facts.workspaceInstance)),wholeContent:w(b(e,n=>n.facts.wholeContent),b(t,n=>n.facts.wholeContent)),relevantInputs:_t(e,t),indexInput:w(b(e,n=>n.facts.index?.inputs),b(t,n=>n.facts.index?.inputs)),indexGeneration:Tt(e,t),observationStability:Mt(e,t)}}function or(e,t,n=At(e,t)){let r=[["collaborationDomain",n.collaborationDomain],["wholeContent",n.wholeContent],["observationStability",n.observationStability]],i=[];for(let[s,a]of r)a.state!=="established"&&i.push(`${s}:${a.state}`);for(let[s,a]of[["left",e],["right",t]]){let c=Nt(a);c!=="not-applicable"&&c!=="established"&&i.push(`${s}IndexAlignment:${c}`)}let o=r.some(([,s])=>s.state==="disproven")||i.some(s=>s.endsWith(":disproven"));return{policyVersion:Et,authority:i.length===0?"completion":o?"none":"advisory",requiredRelationships:["collaborationDomain","wholeContent","observationStability"],reasons:i}}function _t(e,t){let n=qe(e),r=qe(t);return[...new Set([...n.keys(),...r.keys()])].sort().map(o=>{let s=n.get(o),a=r.get(o),c=s?.subject??a?.subject??o,p=s?.identity.projection.name??a?.identity.projection.name??o;return{subject:c,projection:p,judgment:w(s?.identity,a?.identity)}})}function qe(e){return e.schemaVersion!==A?new Map:new Map((e.facts.relevantInputs??[]).map(t=>[`${t.subject}\0${t.identity.projection.name}`,t]))}function Tt(e,t){return e.schemaVersion===v&&t.schemaVersion===v?jt(e.index?.generationIdentity,t.index?.generationIdentity):e.schemaVersion===v||t.schemaVersion===v?S("unknown",["legacy-fact-not-comparable"],Le(e),Le(t)):w(e.facts.index?.generation,t.facts.index?.generation)}function jt(e,t){let n=e?[{kind:"legacy-index-generation",value:e}]:[],r=t?[{kind:"legacy-index-generation",value:t}]:[];return e===void 0||t===void 0?Ye(n,r):S(e===t?"established":"disproven",[e===t?"identities-equal":"identities-different"],n,r)}function w(e,t){let n=e?[{kind:"identity",identity:e}]:[],r=t?[{kind:"identity",identity:t}]:[];return!e||!t?Ye(n,r):re(e,t)?S(e.digest===t.digest?"established":"disproven",[e.digest===t.digest?"identities-equal":"identities-different"],n,r):S("unknown",["identity-projections-not-comparable"],n,r)}function Mt(e,t){if(e.schemaVersion===v||t.schemaVersion===v)return S("unknown",["legacy-fact-not-comparable"],[],[]);let n=Ge(e),r=Ge(t),i=Be(e),o=Be(t);return i==="invalidated"||o==="invalidated"?S("disproven",[...i==="invalidated"?["left-observation-invalidated"]:[],...o==="invalidated"?["right-observation-invalidated"]:[]],n,r):i!=="fixed"||o!=="fixed"?S("unknown",[...i==="no-repository-source"?["left-observation-has-no-repository-source"]:i!=="fixed"?["left-observation-not-fixed"]:[],...o==="no-repository-source"?["right-observation-has-no-repository-source"]:o!=="fixed"?["right-observation-not-fixed"]:[]],n,r):S("established",["all-observed-sources-fixed"],n,r)}function Be(e){let t=e.observedSources.filter(r=>r.kind!=="process");if(t.length===0)return"no-repository-source";let n=new Map(e.stabilityProofs.map(r=>[r.source,r.kind]));return t.some(r=>n.get(r.kind)==="invalidated")?"invalidated":t.every(r=>{let i=n.get(r.kind);return i==="immutable"||i==="fixed-snapshot"})?"fixed":"unknown"}function Nt(e){if(e.schemaVersion!==A)return e.index?"unknown":"not-applicable";if(!e.observedSources.some(r=>r.kind==="index-generation"))return"not-applicable";let t=e.facts.index?.inputs;if(!t)return"unknown";let n=(e.facts.relevantInputs??[]).find(r=>re(r.identity,t))?.identity;return n?n.digest===t.digest?"established":"disproven":"unknown"}function b(e,t){return e.schemaVersion===A?t(e):void 0}function Le(e){return e.schemaVersion===v&&e.index?[{kind:"legacy-index-generation",value:e.index.generationIdentity}]:e.schemaVersion===A&&e.facts.index?[{kind:"identity",identity:e.facts.index.generation}]:[]}function Ge(e){return e.stabilityProofs.map(t=>({kind:"stability",proof:t}))}function Ye(e,t){let n=e.length===0&&t.length===0?"both-facts-missing":e.length===0?"left-fact-missing":"right-fact-missing";return S("unknown",[n],e,t)}function S(e,t,n,r){return{state:e,reasons:t,facts:{left:n,right:r}}}function re(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function Ft(e){if(!f(e))return!1;let t=e.index,n=e.worktree;return Ke(e.observedAt)&&y(e.projectIdentity)&&Ut(e.authorityKind)&&(t===void 0||f(t)&&y(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||f(n)&&y(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||y(n.headCommit))&&(n.treeOid===void 0||y(n.treeOid)))&&Gt(e.authorityKind,t,n)}function $t(e){if(!f(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!Ke(e.observedAt)||!f(t)||!Array.isArray(n)||n.length===0||!n.every(Vt)||!ee(n,c=>c.kind)||!Array.isArray(r)||!r.every(qt)||!ee(r,c=>c.source)||r.some(c=>!n.some(p=>p.kind===c.source))||!r.every(c=>Lt(c,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(c=>t[c]!==void 0&&!O(t[c])))return!1;let o=t.relevantInputs;if(o!==void 0&&(!Array.isArray(o)||!o.every(Dt)||!ee(o,c=>`${c.subject}\0${c.identity.projection.name}`)))return!1;let s=t.index;if(s!==void 0&&(!f(s)||!O(s.generation)||s.inputs!==void 0&&!O(s.inputs)||s.source!=="immutable"&&s.source!=="legacy"))return!1;let a=e.diagnostics;return(a===void 0||f(a)&&(a.clean===void 0||typeof a.clean=="boolean")&&(a.headCommit===void 0||y(a.headCommit))&&(a.treeOid===void 0||y(a.treeOid)))&&Bt(t,n)}function O(e){return!f(e)||!f(e.projection)?!1:e.schemaVersion===Ue&&e.canonicalizationVersion===ne&&e.hashAlgorithm===te&&y(e.projection.name)&&Je(e.projection.version)&&typeof e.digest=="string"&&/^[a-f0-9]{64}$/u.test(e.digest)}function Dt(e){return f(e)&&y(e.subject)&&O(e.identity)}function Vt(e){return f(e)&&We(e.kind)&&(e.identity===void 0||O(e.identity))}function qt(e){return f(e)&&We(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Bt(e,t){let n=e.index,r=t.find(c=>c.kind==="index-generation");if(r){if(!f(n)||!O(n.generation)||r.identity&&!Z(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let i=e.workspaceInstance,o=t.find(c=>c.kind==="live-workspace");if(o?.identity&&(!O(i)||!Z(o.identity,i)))return!1;let s=e.wholeContent,a=t.find(c=>c.kind==="repository-snapshot");return!(a?.identity&&(!O(s)||!Z(a.identity,s)))}function Lt(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&f(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function Z(e,t){return re(e,t)&&e.digest===t.digest}function Gt(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Ut(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function We(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function Ke(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function Je(e){return Number.isSafeInteger(e)&&e>0}function ee(e,t){return new Set(e.map(t)).size===e.length}function D(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&ye.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(Ht)&&(t.observation===void 0||He(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function Ht(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var V=class extends Error{constructor(n,r,i){super(`${n} is ${r} characters; the safety limit is ${i} characters`);this.inputKind=n;this.observedCharacters=r;this.limitCharacters=i;this.name="RegExpPatternBudgetError"}inputKind;observedCharacters;limitCharacters;code="CODEBASEIQ_REGEXP_PATTERN_BUDGET"};function ie(e,t,n,r=4096){if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`maxCharacters must be a non-negative safe integer; received ${r}`);if(e.length>r)throw new V(t,e.length,r);return new RegExp(e,n)}import{createHash as ze}from"crypto";import{closeSync as Yt,fstatSync as Xe,openSync as Wt,rmSync as Kt}from"fs";import{dirname as Jt}from"path";var zt=2e3,Xt=10,Qt=3,B=class extends Error{constructor(n,r,i){super(`Concurrent edit detected for ${n}; expected revision ${Ze(r)}, but found ${Ze(i)}. The latest file was left untouched.`);this.path=n;this.original=r;this.latest=i;this.name="FileRevisionConflictError"}path;original;latest},T=class extends Error{constructor(n,r){super(`Concurrent edit detected for ${n}: ${r} changed since it was read. The latest file was left untouched; reload it and retry.`);this.path=n;this.field=r;this.name="FileContentConflictError"}path;field};function j(e,t,n={}){let r=Zt(e,n.lockTimeoutMs??zt,n.monotonicNow??ve);try{let i=Math.max(0,Math.floor(n.maxRetries??Qt));for(let o=0;;o+=1){let s=q(e),a=t(s,o);if(a.kind==="unchanged")return{changed:!1,attempts:o+1,previous:s,current:s};n.onBeforeCommit?.({attempt:o,snapshot:s,mutation:a});let c=q(e);if(!tn(s.revision,c.revision)){if(o<i)continue;throw new B(e,s.revision,c.revision)}try{en(e,a,s.revision)}catch(p){if(p.code==="EEXIST"){let l=q(e);if(o<i)continue;throw new B(e,s.revision,l.revision)}throw p}return{changed:!0,attempts:o+1,previous:s,current:q(e)}}}finally{r.release()}}function q(e){for(let t=0;t<4;t+=1){let n;try{n=Wt(e,"r");let r=Qe(Xe(n)),i=ge(n,{maxBytes:fe,inputKind:"revisioned text file"}),o=Qe(Xe(n));if(!et(r,o))continue;return{path:e,text:i,revision:{exists:!0,hash:ze("sha256").update(i).digest("hex"),identity:o}}}catch(r){if(r.code==="ENOENT")return{path:e,text:"",revision:{exists:!1,hash:ze("sha256").update("").digest("hex")}};throw r}finally{n!==void 0&&Yt(n)}}throw new Error(`Could not read a stable revision of ${e}; the file is changing continuously.`)}function Zt(e,t,n){let r=`${e}.codebaseiq-write.lock`,i=n()+Math.max(0,t);for(;;){let o=Oe(r,{kind:"revisioned-file-mutation",detail:{target:e}});if(o.kind==="acquired")return o.lock;if(n()>=i)throw new Error(`Timed out after ${t}ms waiting to update ${e}; the file was left untouched.`);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,Xt)}}function en(e,t,n){if(t.kind==="delete"){if(!n.exists)return;Kt(e),xe(Jt(e));return}let r=t.mode??n.identity?.mode;n.exists?we(e,t.text,{durability:"durable",mode:r}):Ee(e,t.text,{durability:"durable",mode:r})}function tn(e,t){return e.exists===t.exists&&e.hash===t.hash&&(e.identity===void 0?t.identity===void 0:t.identity!==void 0&&et(e.identity,t.identity))}function Qe(e){return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs,mode:e.mode&511}}function et(e,t){return e.dev===t.dev&&e.ino===t.ino&&e.size===t.size&&e.mtimeMs===t.mtimeMs&&e.mode===t.mode}function Ze(e){return e.exists?e.hash.slice(0,12):"<absent>"}var I=".codebaseiq.json",at=2e3,L=5e3,oe=L,se=3*6e4,nn=60*6e4,ae={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},rn={enabled:!1,debounceMs:at,cooldownMs:oe,gitPollMs:2e3,idleTimeoutMs:se,autoRefresh:!0,ignore:[],resourceBudget:ae};var on=new Set(["$schema","schemaVersion","collaborationDomainId","languages","indexerConcurrency","watch","indexer","dbPath","entryRoots","semantic","suppressions","declaredCouplings","locality","architecture","coverageContracts","docs"]),sn=new Set(["enabled","debounceMs","cooldownMs","gitPollMs","idleTimeoutMs","autoRefresh","ignore","resourceBudget"]),an=new Set(["enabled","windowMs","maxRebuilds","maxEstimatedWriteBytes"]),cn=new Set(["pathPrefixes","files","symbolPatterns","qualifiedVars"]),dn=new Set(["typescript","rust"]),un=new Set(["tsconfigs"]),pn=new Set(["rustAnalyzerPath"]),it=new Set(J),ln=new Set(["pnpmWorkspaces","projectMode","projects","configPath"]),fn=new Set(["architecturalBoundarySegments"]),mn=new Set(["boundaries","allowedDependencies","requireCompletePolicy","requireCompleteCoverage","requireAcyclic","requireResolvedBoundaries","requireMinimalPolicy","maxBoundaryFanOut","maxBoundaryFiles","testPaths"]),gn=new Set(["name","paths","subUnits","maxFiles"]),hn=new Set(["snapshotPaths"]),yn=new Set(["name","files","reason"]),bn=new Set(["id","check","file","reason","expiresAt","createdAt","decision"]),vn=new Set(["kind","reasonCode","decidedBy","policyVersion","observation","evidence","invalidateOn"]),Sn=new Set(["kind","referent","claim","contentHash","generation"]),xn=new Set(["targetContentChange","detectorMajorChange"]),Cn=new Set(["name","file","keys","mustEqual","allowExtra"]),Rn=new Set(["type","identifier","marker"]),On=new Set(["type","path","pattern"]),In=new Set(["object-literal-keys","string-array","markdown-list"]),wn=new Set(["top-level-dirs","file-glob","registered-commands","builtin-skills"]);function ct(e){let t=x(e,I);if(!E(t))return{};let n;try{n=me(t,{maxBytes:le,inputKind:"codebaseiq project config"})}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${I} at ${t}: ${i}`,{cause:r})}return ut(Q(n),t,"read").config}function Tr(e,t={}){let n=[];_n(e,n);let r=e;r.schemaVersion!==void 0&&r.schemaVersion!==R&&n.push({level:"error",path:"schemaVersion",message:`Must be ${R}; unversioned and v${C} files are migrated while loading.`}),r.$schema!==void 0&&(typeof r.$schema!="string"||r.$schema.trim()==="")&&n.push({level:"error",path:"$schema",message:"Must be a non-empty string."}),e.collaborationDomainId!==void 0&&!/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/iu.test(e.collaborationDomainId)&&n.push({level:"error",path:"collaborationDomainId",message:"Must be a lowercase or uppercase UUID v4 generated for this collaboration domain."});let i=new Set(J);for(let[l,d]of(e.languages??[]).entries())i.has(d)||n.push({level:"error",path:`languages[${l}]`,message:`Unsupported language: ${d}`});for(let[l,d]of(e.entryRoots?.symbolPatterns??[]).entries())try{ie(d,`entryRoots.symbolPatterns[${l}]`)}catch(u){n.push({level:"error",path:`entryRoots.symbolPatterns[${l}]`,message:u instanceof Error?u.message:String(u)})}e.indexerConcurrency!==void 0&&(!Number.isInteger(e.indexerConcurrency)||e.indexerConcurrency<=0)&&n.push({level:"error",path:"indexerConcurrency",message:"Must be a positive integer."}),e.watch?.debounceMs!==void 0&&e.watch.debounceMs<=0&&n.push({level:"error",path:"watch.debounceMs",message:"Must be greater than 0."}),e.watch?.cooldownMs!==void 0&&(!Number.isInteger(e.watch.cooldownMs)||e.watch.cooldownMs<0)?n.push({level:"error",path:"watch.cooldownMs",message:"Must be a non-negative integer."}):e.watch?.cooldownMs!==void 0&&e.watch.cooldownMs<L&&n.push({level:"warning",path:"watch.cooldownMs",message:`Values below ${L}ms are raised to the safety floor at runtime.`}),e.watch?.gitPollMs!==void 0&&e.watch.gitPollMs<=0&&n.push({level:"error",path:"watch.gitPollMs",message:"Must be greater than 0."}),e.watch?.idleTimeoutMs!==void 0&&(!Number.isInteger(e.watch.idleTimeoutMs)||e.watch.idleTimeoutMs<0)&&n.push({level:"error",path:"watch.idleTimeoutMs",message:"Must be a non-negative integer; 0 disables idle shutdown."}),e.watch?.autoRefresh!==void 0&&typeof e.watch.autoRefresh!="boolean"&&n.push({level:"error",path:"watch.autoRefresh",message:"Must be a boolean."});let o=e.watch?.resourceBudget;o?.enabled!==void 0&&typeof o.enabled!="boolean"&&n.push({level:"error",path:"watch.resourceBudget.enabled",message:"Must be a boolean."});for(let[l,d]of[["windowMs",o?.windowMs],["maxRebuilds",o?.maxRebuilds],["maxEstimatedWriteBytes",o?.maxEstimatedWriteBytes]])d!==void 0&&(!Number.isSafeInteger(d)||d<=0)&&n.push({level:"error",path:`watch.resourceBudget.${l}`,message:"Must be a positive safe integer."});let s=e.indexer?.typescript;if(s?.projectMode!==void 0&&s.projectMode!=="single"&&s.projectMode!=="workspace"&&n.push({level:"error",path:"indexer.typescript.projectMode",message:'Must be "single" or "workspace".'}),s?.projects!==void 0)if(!Array.isArray(s.projects))n.push({level:"error",path:"indexer.typescript.projects",message:"Must be an array."});else for(let[l,d]of s.projects.entries()){let u=`indexer.typescript.projects[${l}]`;if(typeof d!="string"||d.trim()==="")n.push({level:"error",path:u,message:"Project path must be a non-empty string."});else if(t.projectRoot){let m=rt(t.projectRoot,d),h=nt(t.projectRoot,m);h.startsWith("..")||tt(h)?n.push({level:"error",path:u,message:"Project path must stay inside the project root."}):E(m)||n.push({level:"warning",path:u,message:`TypeScript project path does not exist: ${d}`})}}s?.projectMode==="workspace"&&s.pnpmWorkspaces===!0&&n.push({level:"warning",path:"indexer.typescript.pnpmWorkspaces",message:'Ignored when projectMode is "workspace"; explicit TypeScript projects are indexed directly.'});let a=e.semantic?.rust;a?.rustAnalyzerPath!==void 0&&(typeof a.rustAnalyzerPath!="string"||a.rustAnalyzerPath.trim()==="")&&n.push({level:"error",path:"semantic.rust.rustAnalyzerPath",message:"Rust analyzer path must be a non-empty string."});let c=e.indexer?.clojure;if(c?.configPath!==void 0){let l="indexer.clojure.configPath";if(typeof c.configPath!="string"||c.configPath.trim()==="")n.push({level:"error",path:l,message:"Config path must be a non-empty string."});else if(t.projectRoot){let d=rt(t.projectRoot,c.configPath),u=nt(t.projectRoot,d);u.startsWith("..")||tt(u)?n.push({level:"error",path:l,message:"Config path must stay inside the project root."}):E(d)||n.push({level:"warning",path:l,message:`Clojure indexer config path does not exist: ${c.configPath}`})}}if(e.locality!==void 0)if(!f(e.locality))n.push({level:"error",path:"locality",message:"Must be an object."});else{let l=e.locality.architecturalBoundarySegments;if(l!==void 0)if(!Array.isArray(l))n.push({level:"error",path:"locality.architecturalBoundarySegments",message:"Must be an array."});else for(let[d,u]of l.entries()){let m=`locality.architecturalBoundarySegments[${d}]`;typeof u!="string"||u.trim()===""?n.push({level:"error",path:m,message:"Boundary segment must be a non-empty string."}):(u.includes("/")||u.includes("\\"))&&n.push({level:"error",path:m,message:"Boundary segment must be a single folder name, not a path."})}}if(En(e,n),e.declaredCouplings!==void 0&&!Array.isArray(e.declaredCouplings))n.push({level:"error",path:"declaredCouplings",message:"Must be an array."});else for(let[l,d]of(e.declaredCouplings??[]).entries()){let u=`declaredCouplings[${l}]`;if((!d.name||d.name.trim()==="")&&n.push({level:"error",path:`${u}.name`,message:"Declared coupling name is required."}),!Array.isArray(d.files)||d.files.length<2)n.push({level:"error",path:`${u}.files`,message:"Declared coupling needs at least two files."});else for(let[m,h]of d.files.entries())!h||h.trim()===""?n.push({level:"error",path:`${u}.files[${m}]`,message:"Declared coupling file path is required."}):t.projectRoot&&!E(x(t.projectRoot,h))&&n.push({level:"warning",path:`${u}.files[${m}]`,message:`Declared coupling file does not exist: ${h}`});d.reason!==void 0&&d.reason.trim()===""&&n.push({level:"error",path:`${u}.reason`,message:"Declared coupling reason cannot be blank."})}let p=t.now??new Date;e.suppressions!==void 0&&!Array.isArray(e.suppressions)&&n.push({level:"error",path:"suppressions",message:"Must be an array."});for(let[l,d]of(Array.isArray(e.suppressions)?e.suppressions:[]).entries()){let u=`suppressions[${l}]`;if(!f(d)){n.push({level:"error",path:u,message:"Suppression must be an object."});continue}if((!d.reason||d.reason.trim()==="")&&n.push({level:"error",path:`${u}.reason`,message:"Suppression reason is required."}),d.id!==void 0&&d.id.trim()===""&&n.push({level:"error",path:`${u}.id`,message:"Suppression id cannot be blank."}),d.check!==void 0&&d.check.trim()===""&&n.push({level:"error",path:`${u}.check`,message:"Suppression check cannot be blank."}),!d.id&&(!d.check||!d.file)?n.push({level:"error",path:u,message:"Suppression must include id or both check and file."}):!d.id&&d.check&&d.file&&n.push({level:"warning",path:u,message:"Check+file suppressions waive every matching finding in that file; prefer a stable id when available."}),d.file!==void 0&&(d.file.trim()===""?n.push({level:"error",path:`${u}.file`,message:"Suppression file path cannot be blank."}):t.projectRoot&&!E(x(t.projectRoot,d.file))&&n.push({level:"warning",path:`${u}.file`,message:`Suppression file does not exist: ${d.file}`})),d.expiresAt){let m=Date.parse(d.expiresAt);Number.isNaN(m)?n.push({level:"error",path:`${u}.expiresAt`,message:"Must be an ISO date string."}):m<=p.getTime()&&n.push({level:"warning",path:`${u}.expiresAt`,message:"Suppression has expired."})}if(d.decision!==void 0&&!D(d.decision))n.push({level:"error",path:`${u}.decision`,message:"Must be a valid automated-adjudication decision with reason code, evidence, and invalidation rules."});else if(d.decision&&t.projectRoot)for(let[m,h]of d.decision.evidence.entries())h.kind!=="graph"&&!E(x(t.projectRoot,h.referent))&&n.push({level:"error",path:`${u}.decision.evidence[${m}].referent`,message:`Suppression counterevidence does not exist: ${h.referent}`})}return An(e,n,t),kn(e,n),n}function En(e,t){if(e.architecture===void 0)return;if(!f(e.architecture)){t.push({level:"error",path:"architecture",message:"Must be an object."});return}let n=e.architecture.boundaries;if(!Array.isArray(n)||n.length===0){t.push({level:"error",path:"architecture.boundaries",message:"Must be a non-empty array."});return}let r=new Set,i=new Set;for(let[a,c]of n.entries()){let p=`architecture.boundaries[${a}]`;if(!f(c)){t.push({level:"error",path:p,message:"Architecture boundary must be an object."});continue}let l=c.name;typeof l!="string"||l.trim()===""?t.push({level:"error",path:`${p}.name`,message:"Boundary name is required."}):r.has(l)?t.push({level:"error",path:`${p}.name`,message:`Duplicate boundary name: ${l}`}):r.add(l);let d=c.subUnits;d!==void 0&&d!=="directory"&&d!=="file"&&t.push({level:"error",path:`${p}.subUnits`,message:"Must be 'directory' or 'file'."});let u=c.maxFiles;u!==void 0&&(typeof u!="number"||!Number.isInteger(u)||u<0)&&t.push({level:"error",path:`${p}.maxFiles`,message:"Must be a non-negative integer."});let m=c.paths;if(!Array.isArray(m)||m.length===0){t.push({level:"error",path:`${p}.paths`,message:"Boundary paths must be a non-empty array."});continue}for(let[h,k]of m.entries()){let K=`${p}.paths[${h}]`;if(typeof k!="string"||k.trim()===""){t.push({level:"error",path:K,message:"Boundary path must be a non-empty string."});continue}Pn(k)||t.push({level:"error",path:K,message:"Boundary path must be project-relative and may use only one trailing /* or /** glob."}),i.has(k)?t.push({level:"error",path:K,message:`Duplicate boundary path: ${k}`}):i.add(k)}}let o=e.architecture.allowedDependencies;if(o!==void 0&&!f(o))t.push({level:"error",path:"architecture.allowedDependencies",message:"Must be an object keyed by boundary name."});else if(f(o))for(let[a,c]of Object.entries(o)){let p=`architecture.allowedDependencies.${a}`;if(r.has(a)||t.push({level:"error",path:p,message:`Unknown source boundary: ${a}`}),!Array.isArray(c)){t.push({level:"error",path:p,message:"Dependency row must be an array."});continue}let l=new Set;for(let[d,u]of c.entries()){let m=`${p}[${d}]`;typeof u!="string"||u.trim()===""?t.push({level:"error",path:m,message:"Target boundary name is required."}):r.has(u)?l.has(u)?t.push({level:"error",path:m,message:`Duplicate target boundary: ${u}`}):l.add(u):t.push({level:"error",path:m,message:`Unknown target boundary: ${u}`})}}e.architecture.requireAcyclic!==void 0&&typeof e.architecture.requireAcyclic!="boolean"&&t.push({level:"error",path:"architecture.requireAcyclic",message:"Must be a boolean."});for(let a of["requireCompleteCoverage","requireResolvedBoundaries","requireMinimalPolicy"])e.architecture[a]!==void 0&&typeof e.architecture[a]!="boolean"&&t.push({level:"error",path:`architecture.${a}`,message:"Must be a boolean."});for(let a of["maxBoundaryFanOut","maxBoundaryFiles"]){let c=e.architecture[a];c!==void 0&&(typeof c!="number"||!Number.isInteger(c)||c<0)&&t.push({level:"error",path:`architecture.${a}`,message:"Must be a non-negative integer."})}let s=e.architecture.testPaths;if(s!==void 0&&(!Array.isArray(s)||s.some(a=>typeof a!="string"))&&t.push({level:"error",path:"architecture.testPaths",message:"Must be an array of strings."}),e.architecture.requireCompletePolicy!==void 0&&typeof e.architecture.requireCompletePolicy!="boolean")t.push({level:"error",path:"architecture.requireCompletePolicy",message:"Must be a boolean."});else if(e.architecture.requireCompletePolicy===!0){let a=f(o)?o:{};for(let c of[...r].sort())Object.hasOwn(a,c)||t.push({level:"error",path:`architecture.allowedDependencies.${c}`,message:"A dependency row is required by architecture.requireCompletePolicy."})}}function Pn(e){let t=e.replace(/\\/g,"/");if(t.startsWith("/")||t==="."||t===".."||t.split("/").includes(".."))return!1;let n=t.replace(/\/\*\*?$/,"");return n.length>0&&!/[*?[\]]/.test(n)}function kn(e,t){let n=e.docs?.snapshotPaths;if(n!==void 0){if(!Array.isArray(n)){t.push({level:"error",path:"docs.snapshotPaths",message:"Must be an array."});return}for(let[r,i]of n.entries())(typeof i!="string"||i.trim()==="")&&t.push({level:"error",path:`docs.snapshotPaths[${r}]`,message:"Snapshot path glob must be a non-empty string."})}}function An(e,t,n){if(e.coverageContracts!==void 0){if(!Array.isArray(e.coverageContracts)){t.push({level:"error",path:"coverageContracts",message:"Must be an array."});return}for(let[r,i]of e.coverageContracts.entries()){let o=`coverageContracts[${r}]`;if(!f(i)){t.push({level:"error",path:o,message:"Coverage contract must be an object."});continue}(typeof i.name!="string"||i.name.trim()==="")&&t.push({level:"error",path:`${o}.name`,message:"Coverage contract name is required."}),typeof i.file!="string"||i.file.trim()===""?t.push({level:"error",path:`${o}.file`,message:"Coverage contract file is required."}):n.projectRoot&&!E(x(n.projectRoot,i.file))&&t.push({level:"warning",path:`${o}.file`,message:`Coverage contract file does not exist: ${i.file}`}),ot(t,i.keys,`${o}.keys`,In,"Unknown coverage-contract key extractor type."),ot(t,i.mustEqual,`${o}.mustEqual`,wn,"Unknown coverage-contract ground-truth source type."),i.allowExtra!==void 0&&typeof i.allowExtra!="boolean"&&t.push({level:"error",path:`${o}.allowExtra`,message:"Must be a boolean."})}}}function ot(e,t,n,r,i){if(!f(t)){e.push({level:"error",path:n,message:'Must be an object with a "type" field.'});return}if(typeof t.type!="string"||!r.has(t.type)){e.push({level:"error",path:`${n}.type`,message:`${i} Got: ${String(t.type)}`});return}let o={"object-literal-keys":["identifier"],"string-array":["identifier"],"markdown-list":["marker"],"top-level-dirs":["path"],"file-glob":["pattern"],"registered-commands":[],"builtin-skills":[]};for(let s of o[t.type]??[])(typeof t[s]!="string"||t[s].length===0)&&e.push({level:"error",path:`${n}.${s}`,message:`"${t.type}" requires a non-empty string "${s}".`})}function jr(e){return{...rn,...e.watch,idleTimeoutMs:e.watch?.idleTimeoutMs??(e.daemon?.enabled===!0?nn:se),cooldownMs:Math.max(L,e.watch?.cooldownMs??oe),resourceBudget:{...ae,...e.watch?.resourceBudget}}}function Mr(e,t){let n=x(e,I),r=st(),i={collaborationDomainId:r,languages:t,watch:{enabled:!0,debounceMs:at,cooldownMs:oe,gitPollMs:2e3,idleTimeoutMs:se,autoRefresh:!0,resourceBudget:{...ae}}},o=j(n,s=>{if(!s.revision.exists)return{kind:"write",text:M(i)};let a=U(s,i);return a.config.collaborationDomainId?{kind:"unchanged"}:{kind:"write",text:M({...a.config,collaborationDomainId:r})}});return{configPath:n,changed:o.changed}}function Nr(e,t,n=st()){let r=x(e,I),i=t,o=j(r,s=>{let a=U(s,t);if(a.config.collaborationDomainId)return i=a.config,{kind:"unchanged"};let c={...a.config,collaborationDomainId:n};return i=c,{kind:"write",text:M(c)}});return{configPath:r,config:i,changed:o.changed}}function Fr(e,t,n){let r=x(e,I),i=[...n],o=t,s=j(r,a=>{let c=U(a,t);if(dt(t.languages,c.config.languages,i))throw new T(r,"languages");let p={...c.config,languages:i};return o=p,a.revision.exists&&!c.needsMigration&&G(p,c.config)?{kind:"unchanged"}:{kind:"write",text:M(p)}});return{configPath:r,config:o,changed:s.changed}}function $r(e,t,n){let r=x(e,I),i=t,o=j(r,s=>{let a=U(s,t);if(dt(t.watch?.enabled,a.config.watch?.enabled,n))throw new T(r,"watch.enabled");let c={...a.config,watch:{...a.config.watch,enabled:n,...n&&a.config.watch?.autoRefresh===void 0?{autoRefresh:!0}:{}}};return i=c,s.revision.exists&&!a.needsMigration&&G(c,a.config)?{kind:"unchanged"}:{kind:"write",text:M(c)}});return{configPath:r,config:i,changed:o.changed}}function U(e,t){if(!e.revision.exists)return{config:$(t),needsMigration:!0};let n=ut(Q(e.text),e.path,"update");return{config:n.config,needsMigration:n.needsMigration}}function M(e){return Ve(e)}function G(e,t){return JSON.stringify(e)===JSON.stringify(t)}function dt(e,t,n){return!G(e,t)&&!G(t,n)}function ut(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let i=n==="read"?`invalid ${I} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${i} The file was left untouched.`)}let r=n==="read"?`invalid ${I} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this codebaseiq reads legacy v${C} and current v${R}). Upgrade codebaseiq before retrying; the file was left untouched.`)}function _n(e,t){if(!f(e))return;let n=e;if(g(t,n,"",on),g(t,n.watch,"watch",sn),g(t,n.watch?.resourceBudget,"watch.resourceBudget",an),g(t,n.entryRoots,"entryRoots",cn),g(t,n.semantic,"semantic",dn),g(t,n.semantic?.typescript,"semantic.typescript",un),g(t,n.semantic?.rust,"semantic.rust",pn),g(t,n.locality,"locality",fn),g(t,n.architecture,"architecture",mn),g(t,n.docs,"docs",hn),Array.isArray(n.architecture?.boundaries))for(let[r,i]of n.architecture.boundaries.entries())g(t,i,`architecture.boundaries[${r}]`,gn);if(f(n.indexer)){g(t,n.indexer,"indexer",it);for(let[r,i]of Object.entries(n.indexer))it.has(r)&&g(t,i,`indexer.${r}`,ln)}if(Array.isArray(n.declaredCouplings))for(let[r,i]of n.declaredCouplings.entries())g(t,i,`declaredCouplings[${r}]`,yn);if(Array.isArray(n.suppressions)){for(let[r,i]of n.suppressions.entries())if(g(t,i,`suppressions[${r}]`,bn),f(i.decision)){if(g(t,i.decision,`suppressions[${r}].decision`,vn),Array.isArray(i.decision.evidence))for(let[o,s]of i.decision.evidence.entries())g(t,s,`suppressions[${r}].decision.evidence[${o}]`,Sn);g(t,i.decision.invalidateOn,`suppressions[${r}].decision.invalidateOn`,xn)}}if(Array.isArray(n.coverageContracts))for(let[r,i]of n.coverageContracts.entries()){let o=`coverageContracts[${r}]`;g(t,i,o,Cn),f(i)&&(g(t,i.keys,`${o}.keys`,Rn),g(t,i.mustEqual,`${o}.mustEqual`,On))}}function g(e,t,n,r){if(f(t))for(let i of Object.keys(t))r.has(i)||e.push({level:"warning",path:n?`${n}.${i}`:i,message:"Unknown config key."})}import{existsSync as pt}from"fs";function lt(e,t,n){let r=new Date().toISOString();if(!pt(n.dbPath))return{state:"missing",checkedAt:r,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: codebaseiq reindex"};if(!pt(n.metaPath))return{state:"unknown",checkedAt:r,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: codebaseiq reindex"};try{let i=be(F(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:r,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this codebaseiq build.`,remedy:"Upgrade codebaseiq or run: codebaseiq reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:r,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: codebaseiq reindex"};let o=i.metadata,s=t.languages??Te(e),a=Tn(e,s,t),c=[...o.indexedLanguages??[]].sort(),p=i.capabilities.publishableGeneration&&JSON.stringify(o.fingerprint)===JSON.stringify(a)&&JSON.stringify(c)===JSON.stringify(a.languages),l=je(n.dbPath,n.metaPath),d=l.state==="invalid"||l.state==="drifted",u=p&&!d;return{state:u?"fresh":"stale",checkedAt:r,metaPath:n.metaPath,updatedAt:o.updatedAt,lastRefresh:o.lastRefresh,reason:d?`SQLite generation requires repair: ${l.reason}`:p?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:u?void 0:"Run: codebaseiq reindex"}}catch(i){return{state:"unknown",checkedAt:r,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: codebaseiq reindex"}}}var H=!1,ft,_=null;function Wr(e){H=!0,ft=e?{headCommit:e.headCommit,treeOid:e.treeOid,clean:e.clean}:void 0,_=null}function Kr(){H=!1,ft=void 0,_=null}function Jr(){_=null}function Tn(e,t,n){let r=H?jn(e,t,n):null;if(r&&_?.key===r)return _.value;let i=0,o=Se("freshness.fingerprint",()=>{let s=Ie(e,t,mt(n));return i=s.files.length,s},()=>({files:i,memoScope:H}));return r&&(_={key:r,value:o}),o}function mt(e){return{pnpmWorkspaces:e.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:e.indexer?.typescript?.projectMode,typescriptProjects:e.indexer?.typescript?.projects,clojureConfigPath:e.indexer?.clojure?.configPath}}function jn(e,t,n){return JSON.stringify([Re(e),[...t].sort(),mt(n)])}import{join as Mn}from"path";var gt=4,Nn=2,Fn="typescript-semantic";function ni(e){let t=Mn(e,Fn),n=$e(t);return{...n,requestDir:n.legacyRequestDir}}function yt(e){return Pe(e)}function ri(e){let t=JSON.parse(e),n=t.protocolVersion,r=n===Nn;if(!r&&n!==gt||typeof t.id!="string"||typeof t.generation!="string"||typeof t.deadlineAtMs!="number"||!Number.isFinite(t.deadlineAtMs)||t.profileEnvironment!==void 0&&!he(t.profileEnvironment)||!t.request||!$n(t.request)||!r&&(t.mailboxVersion!==z||typeof t.operationKey!="string"||!/^[a-f0-9]{64}$/.test(t.operationKey)||t.id!==De(t.operationKey)||typeof t.clientId!="string"||!t.clientId||typeof t.enqueuedAtMs!="number"||!Number.isFinite(t.enqueuedAtMs)||t.deadlineAtMs<t.enqueuedAtMs))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!r){let o=t,s=X("typescript-semantic-v4",{generation:o.generation,profileEnvironment:o.profileEnvironment,request:o.request});if(o.operationKey!==s)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return o}let i=X("typescript-semantic-v2",{id:t.id,generation:t.generation,request:t.request});return{protocolVersion:gt,mailboxVersion:z,id:t.id,operationKey:i,clientId:"legacy-v2",enqueuedAtMs:t.deadlineAtMs,deadlineAtMs:t.deadlineAtMs,generation:t.generation,...t.profileEnvironment?{profileEnvironment:t.profileEnvironment}:{},request:t.request}}function $n(e){if(!e||typeof e!="object"||!("kind"in e))return!1;let t=e;switch(t.kind){case"availability":return!0;case"import-usage":return typeof t.file=="string";case"reference-fragments":return Ae(t.files)!==null;case"references":return ht(t.definitions)&&(t.exact===void 0||typeof t.exact=="boolean");case"callees":return ht(t.definitions);case"signature":return bt(t.definition);default:return!1}}function ht(e){return Array.isArray(e)&&e.every(bt)}function bt(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.symbolId=="number"&&typeof t.documentId=="number"&&typeof t.symbol=="string"&&typeof t.relativePath=="string"&&typeof t.leaf=="string"&&typeof t.startLine=="number"&&typeof t.endLine=="number"}import{existsSync as Dn,readdirSync as Vn}from"fs";import{createHash as qn}from"crypto";import{join as ue}from"path";function de(e){let t=0,n=0,r=0,i=0,o=0,s=[];for(let p of e)switch(p.state){case"legacy":t+=1;break;case"current":n+=1;break;case"unsupported-older":r+=1,s.push(ce(p));break;case"unsupported-future":i+=1,s.push(ce(p));break;case"malformed":o+=1,s.push(ce(p));break}let a=t+n,c=r+i+o;return{complete:c===0,total:e.length,accepted:a,legacy:t,current:n,unsupportedOlder:r,unsupportedFuture:i,malformed:o,omitted:c,issues:s}}function ce(e){if(e.state==="legacy"||e.state==="current")throw new Error(`accepted record ${e.path} cannot become a compatibility issue`);return{path:e.path,state:e.state,reason:e.reason??e.state}}var xt=ue(".codebaseiq","suppressions"),vt="codebaseiq-suppression",St=1,Y=2;function Bn(e){return ue(e,xt)}function Ln(e){if(e.id&&e.id.trim()!=="")return`${e.id.trim()}.json`;let t=`${e.check??""}\0${e.file??""}`;return`CHECK-${qn("sha256").update(t).digest("hex").slice(0,12).toUpperCase()}.json`}function Gn(e){return Ln(e).slice(0,-5)}function Un(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return{state:"malformed",error:"not a suppression object"};let n=e;if(n.schemaVersion===void 0&&(n.kind!==void 0||n.suppressionIdentity!==void 0||n.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(n.schemaVersion!==void 0){if(!Number.isSafeInteger(n.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(n.schemaVersion!==St&&n.schemaVersion!==Y)return{state:n.schemaVersion>Y?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(n.schemaVersion)}`};if(n.kind!==void 0&&n.kind!==vt)return{state:"malformed",error:`kind must be ${vt}`}}if(n.schemaVersion===St&&n.decision!==void 0)return{state:"malformed",error:"schemaVersion 1 cannot carry automated adjudication metadata"};if(n.schemaVersion===Y&&!D(n.decision))return{state:"malformed",error:"schemaVersion 2 requires a valid automated adjudication decision"};if(typeof n.reason!="string"||n.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!n.id&&!n.check)return{state:"malformed",error:"needs an id or a check"};let r=Hn(n);if(n.schemaVersion===void 0)return{state:"legacy",suppression:r,record:n,schemaVersion:0};let i=Gn(r);return n.suppressionIdentity!==i||t!==void 0&&n.suppressionIdentity!==t?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!n.writer||n.writer.tool!=="codebaseiq"||typeof n.writer.version!="string"||n.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof n.createdAt!="string"||!Number.isFinite(Date.parse(n.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:n.updatedAt!==void 0&&(typeof n.updatedAt!="string"||!Number.isFinite(Date.parse(n.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:n.schemaVersion===Y?"current":"legacy",suppression:r,record:n,schemaVersion:n.schemaVersion}}function Ct(e){let t=Bn(e);if(!Dn(t))return{suppressions:[],compatibility:de([]),warnings:[]};let n=[],r=[];for(let o of Vn(t).sort()){if(!o.endsWith(".json"))continue;let s=ue(t,o),a=`${xt}/${o}`,c;try{c=JSON.parse(F(s,"suppression record"))}catch{r.push({path:a,state:"malformed",reason:"malformed JSON"});continue}let p=Un(c,o.slice(0,-5));if("error"in p){r.push({path:a,state:p.state,reason:p.error});continue}r.push({path:a,state:p.state}),n.push(p.suppression)}let i=de(r);return{suppressions:n,compatibility:i,warnings:i.issues.map(o=>`${o.path}: ${o.reason} \u2014 ignored`)}}function Hn(e){return{...typeof e.id=="string"?{id:e.id}:{},...typeof e.check=="string"?{check:e.check}:{},...typeof e.file=="string"?{file:e.file}:{},reason:e.reason,...typeof e.expiresAt=="string"?{expiresAt:e.expiresAt}:{},...typeof e.createdAt=="string"?{createdAt:e.createdAt}:{},...e.decision?{decision:e.decision}:{}}}function Rt(){return process.env.CODEBASEIQ_PROJECT_ROOT??process.cwd()}var N,P;function Ri(e){N=e}function Oi(){return P}function Ot(e=Rt(),t=void 0){if(t===void 0&&N?.projectRoot===e&&!(N.dbPathSource==="root-fallback"&&W(N.paths.dbPath)))return N;let n=ct(e),r=Ce(e,n),i=process.env.CODEBASEIQ_INDEX_DB;if(i)return{projectRoot:e,config:n,paths:r,dbPath:i,dbPathSource:"env",gitContext:t};if(W(r.dbPath))return{projectRoot:e,config:n,paths:r,dbPath:r.dbPath,dbPathSource:"configured",gitContext:t};let o=Wn(e,"index.db");return{projectRoot:e,config:n,paths:r,dbPath:o,dbPathSource:"root-fallback",rootFallbackWarning:Xn(o,r.dbPath),gitContext:t}}function Ii(e){return Ot(e).dbPath}function wi(e,t,n,r={}){return W(n.dbPath)&&r.gitContext?.clean===!1&&r.watcherGeneration!==void 0&&yt(n.dbPath)===r.watcherGeneration?Fe(e,t,n,r.gitContext):lt(e,t,n).state==="fresh"?{kind:"local-fresh"}:Ne(e,t,n,r.gitContext)}function Ei(e){return!e.startsWith("__")&&!Kn.has(e)}var Kn=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","watch"]);function Jn(){return zn(Rt(),{warnOnRootFallback:!0})}function zn(e,t={}){let{config:n,paths:r,dbPath:i,dbPathSource:o,rootFallbackWarning:s,gitContext:a}=Ot(e);if(!W(i))throw new Error("No index.db found. Run: codebaseiq reindex");t.warnOnRootFallback&&o==="root-fallback"&&s&&console.error(s);let c=Ct(e).suppressions,p={dbPath:i,indexPath:process.env.CODEBASEIQ_INDEX_SCIP??r.indexPath,projectRoot:e,collaborationDomainId:n.collaborationDomainId,sharedEvidenceDbPath:Me(e,n,a),entryRoots:n.entryRoots,semantic:n.semantic,suppressions:[...n.suppressions??[],...c],declaredCouplings:n.declaredCouplings,locality:n.locality,architecture:n.architecture,coverageContracts:n.coverageContracts,docs:n.docs},l=_e(e);return new ke(p,l)}function Xn(e,t){let n="unknown time";try{n=Yn(e).mtime.toISOString()}catch{}return`warning: using legacy project-root index.db (${e}, modified ${n}) because the configured index was not found at ${t}. This fallback may be stale; run 'codebaseiq reindex' to refresh the configured index.`}var pe;function Pi(e){pe=e}function ki(e){if(pe){let r=pe(),i=P;P=r;try{return e(r)}finally{P=i}}let t=Jn(),n=P;P=t;try{return e(t)}finally{P=n,t.close()}}function Ai(e,t){return t.concat([e])}function Qn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function _i(e){switch(e.state){case"idle":return"Watching (idle)";case"waiting":{let t=Math.round((e.reindexAt-Date.now())/1e3);return`${e.changedFiles} file(s) changed, reindexing in ${t}s...`}case"indexing":return`Reindexing... (${Math.round((Date.now()-e.startedAt)/1e3)}s)`;case"cooldown":return`Cooldown (${Math.round((e.until-Date.now())/1e3)}s)${e.dirty?" \u2014 changes pending":""}`;case"budget-paused":return`Automatic reindex paused by resource budget (${Math.max(0,Math.round((e.until-Date.now())/1e3))}s; ${e.reason}; ${e.rebuilt} rebuilds, ${Qn(e.estimatedWriteBytes)} estimated writes)${e.dirty?" \u2014 changes pending":""}`;case"draining":return`Stopping safely \u2014 ${e.reason}`;default:return Zn(e)}}function Zn(e){throw new Error(`Unhandled watcher status: ${JSON.stringify(e)}`)}export{A as a,ir as b,He as c,or as d,D as e,ie as f,j as g,ct as h,Tr as i,jr as j,Mr as k,Nr as l,Fr as m,$r as n,lt as o,Wr as p,Kr as q,Jr as r,gt as s,ni as t,yt as u,ri as v,vt as w,St as x,Y as y,Bn as z,Ln as A,Gn as B,Un as C,Ct as D,Rt as E,Ri as F,Oi as G,Ot as H,Ii as I,wi as J,Ei as K,Jn as L,zn as M,Xn as N,Pi as O,ki as P,Ai as Q,Qn as R,_i as S};
3
- //# sourceMappingURL=chunk-Z54RD7VL.js.map
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as a,D as b,E as c,F as d,G as e,H as f,I as g,J as h,K as i,L as j,M as k,N as l,O as m,P as n,Q as o}from"./chunk-G6XFR4ZL.js";import"./chunk-2X7V4HS4.js";import"./chunk-SNNWPCN7.js";export{b as activateCliProjectContext,m as collect,c as currentCliDatabase,n as formatBytes,o as formatStatus,h as openDb,i as openProjectDb,f as prepareWorktreeIndex,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,j as rootIndexFallbackWarning,k as setResidentDatabaseProvider,g as sharedCachePreparationEligible,l as withDb};
3
- //# sourceMappingURL=cli-context-3SNLDYBM.js.map
@@ -1,2 +0,0 @@
1
- import{E as a,F as b,G as c,H as d,I as e,J as f,K as g,L as h,M as i,N as j,O as k,P as l,Q as m,R as n,S as o}from"./chunk-Z54RD7VL.js";import"./chunk-QW7EP6WI.js";import"./chunk-FM5BPL4V.js";import"./chunk-RDBI2RXU.js";import"./chunk-R2NOK63J.js";import"./chunk-EF2R3WNQ.js";import"./chunk-WE5RZHZ7.js";export{b as activateCliProjectContext,m as collect,c as currentCliDatabase,n as formatBytes,o as formatStatus,h as openDb,i as openProjectDb,f as prepareWorktreeIndex,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,j as rootIndexFallbackWarning,k as setResidentDatabaseProvider,g as sharedCachePreparationEligible,l as withDb};
2
- //# sourceMappingURL=cli-context-T3B7W6GG.js.map
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as Y,c as Z,d as h,e as ee,h as te,j as g}from"./chunk-DR2LURYU.js";import{c as G,d as B,e as J,f as K,g as Q,h as X}from"./chunk-UXM43C7T.js";import{n as L,p as q,r as H}from"./chunk-ECQBG7PW.js";import{a as y,b as k}from"./chunk-XZEE23VG.js";import{C as M,D as u,F,H as U,I as V,N as W,o as I,p as $,q as T,r as _}from"./chunk-G6XFR4ZL.js";import{e as z}from"./chunk-3JSXXYTZ.js";import{d as D}from"./chunk-DO6WQD2T.js";import{$ as j,Z as R,_ as N,aa as A,ba as O,l as c}from"./chunk-2X7V4HS4.js";import{c as P,q as S}from"./chunk-SNNWPCN7.js";import{c as ne}from"./chunk-C74PPYLA.js";import{c as re}from"./chunk-B3UYV66Z.js";import"./chunk-362QOSFD.js";import"./chunk-B2OB55RR.js";import{Command as _e,Help as Me}from"commander";import{Option as pe}from"commander";function x(e){return e.evidence?e.evidence:ue.has(e.id)?"mixed":e.heuristic?"heuristic":"graph-fact"}var ue=new Set(["health","context","co-change"]);function oe(e){if(e.claims){if(e.claims.origin==="mixed"&&!e.claims.families?.length)throw new Error(`Mixed command ${e.id} must declare at least one claim family.`);return e.claims}let t=x(e);if(t==="mixed")throw new Error(`Mixed command ${e.id} must declare claim families.`);let n=e.agent?B(e.agent.operation):[];return n.length>0&&n.every(r=>r==="repository-observation"||r==="repository-preview")?{origin:t==="heuristic"?"heuristic":"compiler-graph",observedSources:["index-generation"],producerValidation:{status:"not-evaluated"}}:{origin:"unknown",observedSources:["process"],producerValidation:{status:"not-evaluated"}}}var ie;function ae(){return ie||{argv:process.argv.slice(2),execPath:process.execPath,...process.argv[1]!==void 0?{scriptPath:process.argv[1]}:{},cwd:process.cwd()}}function se(e,t){return K(new Map(t.map(n=>[n.id,x(n)]))),X(new Map(t.map(n=>[n.id,oe(n)]))),Q(new Map(t.flatMap(n=>n.agent?[[n.id,{...n.agent,resultUnits:he(n)}]]:[]))),t.map(n=>{let i=n.hidden?e.command(n.command,{hidden:!0}):e.command(n.command);i.description(n.description),n.helpAfter&&i.addHelpText("after",`
3
- ${n.helpAfter.trim()}
4
- `);for(let r of n.arguments??[])i.argument(r.name);for(let r of n.options??[])if(r.hidden){let o=new pe(r.flags,r.description).hideHelp();r.parser&&o.argParser(r.parser),Object.hasOwn(r,"defaultValue")&&o.default(r.defaultValue),i.addOption(o)}else r.parser&&Object.hasOwn(r,"defaultValue")?i.option(r.flags,r.description,r.parser,r.defaultValue):r.parser?i.option(r.flags,r.description,r.parser):Object.hasOwn(r,"defaultValue")?i.option(r.flags,r.description,r.defaultValue):i.option(r.flags,r.description);return i.action(async(...r)=>{try{let o=i.optsWithGlobals();fe(o);let a=ae(),s=()=>n.id===L?n.handler(...r):q({command:n.id,producerVersion:c,invocationPrefix:a.scriptPath?[a.execPath,a.scriptPath]:["codebaseiq"],argv:[...a.argv],cwd:a.cwd,json:o.json===!0,sourceSession:o.session!==!1,reemitSource:o.reemit===!0,...typeof o.outputPageSize=="number"?{pageSize:o.outputPageSize}:{},...typeof o.outputCursor=="string"?{cursor:o.outputCursor}:{}},()=>n.handler(...r)),m=n.agent?G(n.agent.operation,{args:r.slice(0,-1),options:o}):void 0;await(m?J(m,s):s())}catch(o){ge(o)}finally{u(void 0),T()}}),{descriptor:n,command:i}})}function fe(e){if(e.resultOnly===!0&&e.json!==!0)throw new Error("--result-only requires --json.");if(e.compact===!0&&e.json!==!0)throw new Error("--compact requires --json.")}function he(e){let t=e.agent?.resultUnits;if(t?.kind==="field"&&t.field.trim()==="")throw new Error(`Command ${e.id} declares an empty result-unit field.`);return t||(e.renderShape==="list"||e.renderShape==="table"||e.renderShape==="grouped-by-file"?{kind:"rows"}:{kind:"report"})}function ge(e){let t=e instanceof Error?e.message:String(e);console.error(`error: ${k(t)}`),process.exitCode=1}import{existsSync as Ce,mkdirSync as ve,writeFileSync as ye}from"fs";import{homedir as xe}from"os";import{join as C}from"path";var Ee=1440*60*1e3,me="update-check.json",be="https://registry.npmjs.org/codebaseiq/latest";async function E(e={}){let t=e.env??process.env;if(t.CODEBASEIQ_UPDATE_CHECK==="0"||t.NO_UPDATE_NOTIFIER)return;let n=e.cacheDir??Se(t),i=e.now??Date.now(),r=e.currentVersion??c,o=De(n),a=o&&i-o.checkedAt<Ee?o.latestVersion:await Re(n,e.fetchLatestVersion??je,i);if(!a||!Pe(a,r))return;(e.writeNotice??(m=>console.error(m)))(we(r,a))}function we(e,t){return[`codebaseiq update available: ${e} -> ${t}.`,"Agent: tell your human to update with: npm install -g codebaseiq@latest",""].join(`
5
- `)}function Pe(e,t){let n=ce(e),i=ce(t);if(!n||!i)return e!==t;for(let r=0;r<n.length;r++){let o=n[r]-i[r];if(o>0)return!0;if(o<0)return!1}return!1}function Se(e){let t=e.XDG_CACHE_HOME||C(xe(),".cache");return C(t,"codebaseiq")}function De(e){let t=C(e,me);if(!Ce(t))return null;try{let n=JSON.parse(S(t,"update notice cache"));return typeof n.checkedAt=="number"&&(typeof n.latestVersion=="string"||n.latestVersion===null)?{checkedAt:n.checkedAt,latestVersion:n.latestVersion}:null}catch{return null}}async function Re(e,t,n){let i;try{i=await t()}catch{i=null}return Ne(e,{checkedAt:n,latestVersion:i}),i}function Ne(e,t){try{ve(e,{recursive:!0}),ye(C(e,me),`${JSON.stringify(t,null,2)}
6
- `)}catch{}}async function je(){let e=await fetch(be,{signal:AbortSignal.timeout(1e3)});if(!e.ok)return null;let t=await e.json();return typeof t.version=="string"?t.version:null}function ce(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}var Ae=5e3,Oe=100,Ie={prepare:U,freshness:I,ensureService:h,inspectService:ee,requestRefresh:te,async reindex(e,t,n,i){let{reindexConfiguredProject:r}=await import("./project-reindex-UQBIKO4M.js");return r(e,t,n,i)},wait(e){return new Promise(t=>setTimeout(t,e))},now:Date.now};async function de(e,t=Ie,n={}){if(e.dbPathSource==="env")return{source:"explicit-index",service:{kind:"skipped",reason:"environment"}};let i=$e(e,t),r=t.prepare(e.projectRoot,e.config,e.paths,{gitContext:e.gitContext,...i?{watcherGeneration:i}:{}}),o=t.freshness(e.projectRoot,e.config,e.paths),a=t.ensureService({commandName:e.commandName,projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:c,config:e.config,gitContext:e.gitContext});if(o.state==="fresh")return{source:r.kind==="local-fresh"?"existing":"shared-generation",service:a};if((a.kind==="started"||a.kind==="reused")&&(t.requestRefresh(D(e.paths.cacheDir).activityPath,`evidence command ${e.commandName} requires a fresh generation`),o=await Te(e,o,t,n,a),o.state==="fresh"))return{source:"watcher",service:a};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(o=t.freshness(e.projectRoot,e.config,e.paths),o.state!=="fresh")throw new Error(`Could not prepare fresh evidence for codebaseiq ${e.commandName}: index remained ${o.state} (${o.reason})`);return{source:"synchronous-reindex",service:a}}function $e(e,t){if(e.config.watch?.enabled===!0)try{return Y(t.inspectService({projectRoot:e.projectRoot,cacheDir:e.paths.cacheDir,cliVersion:c,gitContext:e.gitContext}))}catch{return}}async function Te(e,t,n,i,r){if(r.state.watcher.state==="budget-paused")return t;let o=Math.max(0,i.waitMs??Ae),a=Math.max(1,i.pollMs??Oe),s=n.now()+o,m=t;for(;n.now()<s;)if(await n.wait(Math.min(a,Math.max(1,s-n.now()))),_(),m=n.freshness(e.projectRoot,e.config,e.paths),m.state==="fresh")return m;return m}async function Pt(e={}){let t=new _e;e.resident&&t.exitOverride(),e.terminalOutput&&t.configureOutput({writeOut:r=>process.stdout.write(y(r)),writeErr:r=>process.stderr.write(y(r))}),t.name("codebaseiq").description("Language-agnostic code intelligence CLI powered by SCIP indexes").version(c).option("--output-page-size <characters>","Return bounded output pages with an exact continuation command",H).option("--output-cursor <cursor>","Continue a bounded output page").option("--no-session","Disable the explicit exploration evidence ledger").option("--reemit","Recovery only: render source and graph evidence again instead of citing session receipts").option("--help-all","Display every command, including compatibility and deprecated controls");let n=await ne(e.invocationCommand);se(t,n);let i=new Me;return t.configureHelp({formatHelp:(r,o)=>r===t?re(t,n):i.formatHelp(r,o)}),t.hook("preAction",async(r,o)=>{let a=o.name();if(e.resident){await e.resident.preAction(a);return}let s=V(a),m=Z(a);if(!s&&!m){le(),await E({commandName:a});return}let d=M(),p=P(d);$(p);let v=F(d,p);u(v),le(),await E({commandName:a});let{config:b,paths:w}=v;if(s){let l=await de({commandName:a,projectRoot:d,config:b,paths:w,dbPathSource:v.dbPathSource,gitContext:p});process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-freshness: ${l.source}`),l.service.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${l.service.message}`),(l.service.kind==="failed"||l.service.kind==="skipped")&&g(d,c);return}if(!m){g(d,c);return}let f=h({commandName:a,projectRoot:d,cacheDir:w.cacheDir,cliVersion:c,config:b,gitContext:p});f.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${f.message}`),(f.kind==="failed"||f.kind==="skipped")&&g(d,c)}),t.hook("postAction",()=>u(void 0)),{program:t,descriptors:n}}function le(){if(j(),!R()||A())return;let e=null;try{e=W(t=>z(t))}catch{}O({command:N()??`codebaseiq ${process.argv.slice(2).join(" ")}`,toolVersion:c,projectFingerprint:e})}export{Pt as createCliProgram};
7
- //# sourceMappingURL=cli-program-YNOXO72B.js.map