codebaseiq 0.1.0 → 0.3.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 (447) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +1 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-23C5AD3B.js} +2 -2
  5. package/dist/chunk-2E6OUPCF.js +2 -0
  6. package/dist/chunk-2EDX3JT5.js +3 -0
  7. package/dist/chunk-2I2UHZET.js +2 -0
  8. package/dist/{chunk-T3DGWPXM.js → chunk-2OMXFE64.js} +2 -2
  9. package/dist/chunk-2PRONPAS.js +3 -0
  10. package/dist/{chunk-GW6Z3WGY.js → chunk-356EZBIP.js} +2 -2
  11. package/dist/{chunk-UDS562V4.js → chunk-36JC5BG2.js} +2 -2
  12. package/dist/chunk-3RR2K7EZ.js +20 -0
  13. package/dist/{chunk-JE3WZ6II.js → chunk-3RSBGWGL.js} +2 -2
  14. package/dist/{chunk-VE5AVNMP.js → chunk-3VJ3OCRE.js} +2 -2
  15. package/dist/{chunk-FDGD5AB5.js → chunk-4LK5OIPW.js} +2 -2
  16. package/dist/chunk-5DSL3NT2.js +17 -0
  17. package/dist/chunk-5FWR5HLG.js +90 -0
  18. package/dist/chunk-5IC2WZAL.js +22 -0
  19. package/dist/{chunk-MVB3DAEY.js → chunk-5IZRKWTZ.js} +2 -2
  20. package/dist/{chunk-Q65CQ4XL.js → chunk-5LL4KEHO.js} +2 -2
  21. package/dist/chunk-5T44HG5Y.js +88 -0
  22. package/dist/{chunk-TRRC4ZJ7.js → chunk-5ZI2PPI7.js} +2 -2
  23. package/dist/{chunk-7XAN6GKB.js → chunk-67VJAYVR.js} +2 -2
  24. package/dist/{chunk-MOVBWNIP.js → chunk-6BF3VYEF.js} +2 -2
  25. package/dist/chunk-6JMAVFL4.js +3 -0
  26. package/dist/chunk-6O3KXIDL.js +2 -0
  27. package/dist/{chunk-JOIRNPPY.js → chunk-6VREELBC.js} +2 -2
  28. package/dist/chunk-6WAPPQ5F.js +82 -0
  29. package/dist/{chunk-FW53T7EB.js → chunk-75KJGYX7.js} +2 -2
  30. package/dist/chunk-7GAK2F3H.js +77 -0
  31. package/dist/{chunk-UBGWN7I4.js → chunk-7JELP5YE.js} +2 -2
  32. package/dist/chunk-7UCDGXRW.js +8 -0
  33. package/dist/{chunk-L57ZKWVG.js → chunk-AEXQYQD7.js} +2 -2
  34. package/dist/chunk-AQI4N64O.js +22 -0
  35. package/dist/{chunk-ICFDQHAM.js → chunk-AURCQHSG.js} +2 -2
  36. package/dist/{chunk-I2T2LLK2.js → chunk-BBP7HVBJ.js} +2 -2
  37. package/dist/{chunk-OFBE4NGP.js → chunk-BFBIMTCJ.js} +2 -2
  38. package/dist/{chunk-JEJLSICM.js → chunk-BGGB5N53.js} +2 -2
  39. package/dist/{chunk-TIIC3ZE7.js → chunk-BRQL7AFJ.js} +2 -2
  40. package/dist/{chunk-YSNONTJ2.js → chunk-BWL3PMPT.js} +2 -2
  41. package/dist/chunk-C6WKPKCF.js +127 -0
  42. package/dist/{chunk-YESXMKX3.js → chunk-C7OUW52M.js} +2 -2
  43. package/dist/chunk-C7QWUBR2.js +545 -0
  44. package/dist/{chunk-4WKDMDEW.js → chunk-CCIYWXX6.js} +2 -2
  45. package/dist/{chunk-FAJQ7LWY.js → chunk-CIYA2KZN.js} +2 -2
  46. package/dist/{chunk-VEXUL62T.js → chunk-CR3OG6SQ.js} +2 -2
  47. package/dist/{chunk-JSOYNVWH.js → chunk-CVHOQONG.js} +2 -2
  48. package/dist/{chunk-LU3BMVH2.js → chunk-CW6AXOLR.js} +2 -2
  49. package/dist/{chunk-TXXOEMZJ.js → chunk-D53LWANR.js} +2 -2
  50. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  51. package/dist/{chunk-N3IQCBCF.js → chunk-D7AZAOZX.js} +2 -2
  52. package/dist/{chunk-RDBI2RXU.js → chunk-D7DOB27N.js} +7 -7
  53. package/dist/chunk-DAKIGMIK.js +21 -0
  54. package/dist/chunk-DDN2F6GB.js +2 -0
  55. package/dist/chunk-DUKHVPU5.js +4 -0
  56. package/dist/chunk-DVWO7RBC.js +2 -0
  57. package/dist/{chunk-HKQUXIFO.js → chunk-E52K4L2W.js} +2 -2
  58. package/dist/chunk-EIBGSU2R.js +2 -0
  59. package/dist/chunk-EN4AHLL3.js +3 -0
  60. package/dist/chunk-EQNMD62X.js +51 -0
  61. package/dist/{chunk-ENCCHKM6.js → chunk-EXZ7VLRY.js} +4 -4
  62. package/dist/{chunk-NEDP5RFQ.js → chunk-F3QSL4W2.js} +2 -2
  63. package/dist/{chunk-O6QTXQPJ.js → chunk-F74LZWCE.js} +2 -2
  64. package/dist/{chunk-BH5F2Q4O.js → chunk-FEIZXBLH.js} +2 -2
  65. package/dist/chunk-FH5WG4LE.js +2 -0
  66. package/dist/{chunk-BVAJLC5A.js → chunk-FOZ74V56.js} +2 -2
  67. package/dist/{chunk-L4NRUAGJ.js → chunk-FQTIFWLR.js} +2 -2
  68. package/dist/chunk-FTTV7IRX.js +355 -0
  69. package/dist/chunk-FWQGH2N2.js +2 -0
  70. package/dist/{chunk-CAUCPUOF.js → chunk-GDHWOA57.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-GIDCP7KV.js} +2 -2
  72. package/dist/{chunk-ZV3JV5G5.js → chunk-GL6UTNUB.js} +2 -2
  73. package/dist/chunk-GP7C5VAE.js +2 -0
  74. package/dist/{chunk-FQKZWM4L.js → chunk-GQLDYCWS.js} +5 -5
  75. package/dist/chunk-GQXXOS55.js +2 -0
  76. package/dist/{chunk-H3LGFZVK.js → chunk-GUFPEFBG.js} +2 -2
  77. package/dist/{chunk-NNOKTMZT.js → chunk-GV2CEZCW.js} +2 -2
  78. package/dist/{chunk-FETNQCFO.js → chunk-GVAF222T.js} +2 -2
  79. package/dist/chunk-GWYZVVKY.js +21 -0
  80. package/dist/{chunk-7FND7D7N.js → chunk-HENP2O4A.js} +2 -2
  81. package/dist/{chunk-LZYFLFEH.js → chunk-HINZQKSY.js} +2 -2
  82. package/dist/{chunk-RR7SX44N.js → chunk-HQA7EBSK.js} +2 -2
  83. package/dist/{chunk-XMQ23E27.js → chunk-HVFB3PME.js} +2 -2
  84. package/dist/chunk-I22IZYDI.js +2 -0
  85. package/dist/chunk-ICUL7XRT.js +21 -0
  86. package/dist/{chunk-CQP3THUZ.js → chunk-IHSLIIL3.js} +2 -2
  87. package/dist/{chunk-34WBMAYK.js → chunk-ITSJMNUD.js} +2 -2
  88. package/dist/{chunk-PX4RYAAK.js → chunk-IZDPGOZR.js} +2 -2
  89. package/dist/chunk-J3GLP7Q5.js +3 -0
  90. package/dist/{chunk-CVYSU6BX.js → chunk-J7AMBVWF.js} +2 -2
  91. package/dist/{chunk-Y6KHROC3.js → chunk-JCMFBF4Z.js} +2 -2
  92. package/dist/chunk-JFIA2JI3.js +3 -0
  93. package/dist/chunk-JLZLLLW5.js +3 -0
  94. package/dist/{chunk-5PUWMSDU.js → chunk-JSNTHRLQ.js} +2 -2
  95. package/dist/{chunk-C6SBF2WH.js → chunk-JX6ZWDOS.js} +2 -2
  96. package/dist/{chunk-4XTAUQFD.js → chunk-JYI7CV25.js} +2 -2
  97. package/dist/chunk-K7JLSGCJ.js +8 -0
  98. package/dist/{chunk-XWUOUWYI.js → chunk-KPZGTB2O.js} +2 -2
  99. package/dist/{chunk-VXYS3FZD.js → chunk-LKUTSP4G.js} +2 -2
  100. package/dist/{chunk-GTXSJDCO.js → chunk-LMTSB3TB.js} +2 -2
  101. package/dist/chunk-LONKINMJ.js +543 -0
  102. package/dist/{chunk-WMPRTGH2.js → chunk-LQHYYIOB.js} +2 -2
  103. package/dist/{chunk-VUIYB2V3.js → chunk-LZSQ6X7E.js} +2 -2
  104. package/dist/{chunk-ST7V3SKN.js → chunk-M2Y6PCFE.js} +2 -2
  105. package/dist/chunk-MEUHIDI3.js +7 -0
  106. package/dist/{chunk-OZYRSMSH.js → chunk-MHWMEZDA.js} +2 -2
  107. package/dist/{chunk-RKEJ6VTF.js → chunk-MQW6SJ4P.js} +2 -2
  108. package/dist/{chunk-J77SU6VA.js → chunk-MSI3K7PJ.js} +2 -2
  109. package/dist/chunk-MVRGB4KJ.js +278 -0
  110. package/dist/{chunk-DQMDCD24.js → chunk-MZNMASFM.js} +2 -2
  111. package/dist/{chunk-ID63777H.js → chunk-NBCQZSGR.js} +2 -2
  112. package/dist/chunk-NBZKSTXP.js +2 -0
  113. package/dist/{chunk-SZD2KF7Q.js → chunk-NCJILOAK.js} +2 -2
  114. package/dist/{chunk-C7QOQX32.js → chunk-NDKOVQFG.js} +2 -2
  115. package/dist/{chunk-UNBY47BC.js → chunk-NEWHKGVD.js} +2 -2
  116. package/dist/{chunk-PYAB5SM6.js → chunk-O2M3VNDY.js} +2 -2
  117. package/dist/chunk-OFGOOL6U.js +3 -0
  118. package/dist/{chunk-SWHMHUKF.js → chunk-OQUCBKOI.js} +2 -2
  119. package/dist/{chunk-7MGU3HPH.js → chunk-P4NVCOM7.js} +2 -2
  120. package/dist/{chunk-ANFVSJWQ.js → chunk-PFC44E6D.js} +2 -2
  121. package/dist/{chunk-EZNMUY67.js → chunk-PHNCEUXX.js} +2 -2
  122. package/dist/{chunk-4FC325IF.js → chunk-PTQPPPG2.js} +2 -2
  123. package/dist/chunk-PUVNH4PO.js +3 -0
  124. package/dist/chunk-Q23IMHXS.js +343 -0
  125. package/dist/chunk-Q3ZCQY2Y.js +3 -0
  126. package/dist/{chunk-KMITESMT.js → chunk-Q4XEU3UH.js} +2 -2
  127. package/dist/{chunk-QKPLA6IC.js → chunk-QEOWONKY.js} +2 -2
  128. package/dist/{chunk-BJ6SQAEN.js → chunk-QMOZZ2VX.js} +2 -2
  129. package/dist/chunk-RCIGX23V.js +60 -0
  130. package/dist/{chunk-IOP6FWIM.js → chunk-RIYJ4L33.js} +2 -2
  131. package/dist/chunk-RJVAPMHF.js +14 -0
  132. package/dist/chunk-SB7NASHU.js +2 -0
  133. package/dist/{chunk-UZGZB3VB.js → chunk-SGMNWYTH.js} +2 -2
  134. package/dist/chunk-SMDIEDM4.js +27 -0
  135. package/dist/chunk-SV2LEFVM.js +2 -0
  136. package/dist/chunk-SX72EVMY.js +3 -0
  137. package/dist/chunk-T5X7DK6C.js +3 -0
  138. package/dist/{chunk-6NW7MU72.js → chunk-T6MQNNAC.js} +2 -2
  139. package/dist/chunk-T75DS2E6.js +21 -0
  140. package/dist/{chunk-HRWGYWRJ.js → chunk-TEANKHUU.js} +2 -2
  141. package/dist/chunk-TJBOJUVN.js +3 -0
  142. package/dist/{chunk-XLQ3GLWZ.js → chunk-TJWVT4DO.js} +2 -2
  143. package/dist/{chunk-7NVGT435.js → chunk-TNJGTQWO.js} +2 -2
  144. package/dist/{chunk-NE6IU5ZD.js → chunk-TOTWJZIX.js} +2 -2
  145. package/dist/{chunk-PBI2LFKH.js → chunk-TPO7XC5Z.js} +2 -2
  146. package/dist/{chunk-HPJRBHVT.js → chunk-U33PMPNW.js} +2 -2
  147. package/dist/{chunk-QHRNXP3C.js → chunk-U7NUXDQO.js} +2 -2
  148. package/dist/chunk-UC2FD2PS.js +4 -0
  149. package/dist/{chunk-PIOMTC27.js → chunk-UQE4XFSA.js} +2 -2
  150. package/dist/chunk-UQYQBLJX.js +5 -0
  151. package/dist/{chunk-KWVHSKHK.js → chunk-USOAJHY7.js} +2 -2
  152. package/dist/{chunk-GCHRX4YW.js → chunk-UW6KD57C.js} +2 -2
  153. package/dist/{chunk-PTAWHLVJ.js → chunk-VGWZ4MOY.js} +2 -2
  154. package/dist/{chunk-XME3HPXZ.js → chunk-VWYGCMV5.js} +2 -2
  155. package/dist/{chunk-AKB7V7TV.js → chunk-W7YLRXZE.js} +2 -2
  156. package/dist/{chunk-SYDJMPES.js → chunk-WK2IQJPK.js} +2 -2
  157. package/dist/{chunk-RBAS5ZHI.js → chunk-WWCV4E6J.js} +2 -2
  158. package/dist/{chunk-OL6KJP3N.js → chunk-XMJ53WG4.js} +2 -2
  159. package/dist/chunk-XN3EKMLI.js +4 -0
  160. package/dist/chunk-XQAVQVIL.js +3 -0
  161. package/dist/{chunk-IJ4HMYBE.js → chunk-XQPPURLQ.js} +2 -2
  162. package/dist/{chunk-OVTS4DKB.js → chunk-YHPG3S2U.js} +2 -2
  163. package/dist/{chunk-WOQBZPIF.js → chunk-YRKP7PM7.js} +2 -2
  164. package/dist/chunk-YT4DVWUV.js +11 -0
  165. package/dist/chunk-YTJHCGYB.js +61 -0
  166. package/dist/chunk-Z35GOVEH.js +2 -0
  167. package/dist/{chunk-OLF4MA5W.js → chunk-Z6RL7XOE.js} +4 -4
  168. package/dist/{chunk-UP3BUZR5.js → chunk-ZAFGY22Q.js} +2 -2
  169. package/dist/{chunk-CO5R3UNA.js → chunk-ZB4C5TTR.js} +2 -2
  170. package/dist/{chunk-ZZXSWSN6.js → chunk-ZNH33XIB.js} +2 -2
  171. package/dist/{chunk-EMNIHCRB.js → chunk-ZQ62NNKN.js} +2 -2
  172. package/dist/cli-context-FJL2JHOE.js +3 -0
  173. package/dist/cli-context-PQNWHMCQ.js +2 -0
  174. package/dist/cli-program-UO7PZD6V.js +7 -0
  175. package/dist/cli.js +1 -1
  176. package/dist/{code-DlqpBDd0.d.ts → code-DfX3xeWy.d.ts} +1 -1
  177. package/dist/code-viewer-KIXEYQNJ.js +12 -0
  178. package/dist/code-viewer-VHLBLIUM.js +11 -0
  179. package/dist/command-descriptors-F5P2V3NW.js +335 -0
  180. package/dist/command-descriptors-YCLATF5I.js +337 -0
  181. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  182. package/dist/{db-D7sauVFH.d.ts → db-BoG_PWYH.d.ts} +2 -2
  183. package/dist/direct-navigation-4XJTXIDT.js +2 -0
  184. package/dist/direct-navigation-J5MVYYAD.js +3 -0
  185. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-D1jx1Cql.d.ts} +1 -1
  186. package/dist/{health-DJaZXg8I.d.ts → health-DkYBS5BI.d.ts} +1 -1
  187. package/dist/index.d.ts +2 -2
  188. package/dist/index.js +1 -1
  189. package/dist/invocation-command-descriptors-RWV4VAI4.js +2 -0
  190. package/dist/invocation-command-descriptors-U76PN7IY.js +3 -0
  191. package/dist/{scip-cli-B7N3haxa.d.ts → maintenance-types-CdL5eQii.d.ts} +2 -21
  192. package/dist/output-continuation-command-BL25S26S.js +3 -0
  193. package/dist/output-continuation-command-BTETTXEC.js +2 -0
  194. package/dist/postinstall.js +1 -1
  195. package/dist/project-reindex-CRJU3IFG.js +2 -0
  196. package/dist/project-reindex-TQFCOA2O.js +3 -0
  197. package/dist/queries/affected.d.ts +2 -2
  198. package/dist/queries/affected.js +1 -1
  199. package/dist/queries/anchors.d.ts +2 -2
  200. package/dist/queries/anchors.js +1 -1
  201. package/dist/queries/architecture.d.ts +2 -2
  202. package/dist/queries/architecture.js +1 -1
  203. package/dist/queries/bottlenecks.d.ts +2 -2
  204. package/dist/queries/bottlenecks.js +1 -1
  205. package/dist/queries/by-kind.d.ts +2 -2
  206. package/dist/queries/by-kind.js +1 -1
  207. package/dist/queries/call-graph.d.ts +2 -2
  208. package/dist/queries/call-graph.js +1 -1
  209. package/dist/queries/change-surface.d.ts +2 -2
  210. package/dist/queries/change-surface.js +1 -1
  211. package/dist/queries/cleanup-plan.d.ts +2 -2
  212. package/dist/queries/cleanup-plan.js +1 -1
  213. package/dist/queries/co-change.d.ts +2 -2
  214. package/dist/queries/co-change.js +1 -1
  215. package/dist/queries/code.d.ts +3 -3
  216. package/dist/queries/code.js +1 -1
  217. package/dist/queries/complexity-hotspots.d.ts +2 -2
  218. package/dist/queries/complexity-hotspots.js +1 -1
  219. package/dist/queries/complexity.d.ts +2 -2
  220. package/dist/queries/complexity.js +1 -1
  221. package/dist/queries/context.d.ts +2 -2
  222. package/dist/queries/context.js +1 -1
  223. package/dist/queries/convergence.d.ts +2 -2
  224. package/dist/queries/convergence.js +1 -1
  225. package/dist/queries/coupling.d.ts +2 -2
  226. package/dist/queries/coupling.js +1 -1
  227. package/dist/queries/cycles.d.ts +2 -2
  228. package/dist/queries/cycles.js +1 -1
  229. package/dist/queries/dataflow.d.ts +2 -2
  230. package/dist/queries/dataflow.js +1 -1
  231. package/dist/queries/dead.d.ts +2 -2
  232. package/dist/queries/dead.js +1 -1
  233. package/dist/queries/decorative-checkers.d.ts +2 -2
  234. package/dist/queries/decorative-checkers.js +1 -1
  235. package/dist/queries/deep-chains.d.ts +2 -2
  236. package/dist/queries/deep-chains.js +1 -1
  237. package/dist/queries/dependence-slice.d.ts +3 -3
  238. package/dist/queries/dependence-slice.js +1 -1
  239. package/dist/queries/dependency-depth.d.ts +2 -2
  240. package/dist/queries/dependency-depth.js +1 -1
  241. package/dist/queries/deps.d.ts +2 -2
  242. package/dist/queries/deps.js +1 -1
  243. package/dist/queries/diff-impact.d.ts +2 -2
  244. package/dist/queries/diff-impact.js +1 -1
  245. package/dist/queries/doc-drift.d.ts +2 -2
  246. package/dist/queries/doc-drift.js +1 -1
  247. package/dist/queries/drift.d.ts +2 -2
  248. package/dist/queries/drift.js +1 -1
  249. package/dist/queries/duplicate-bodies.d.ts +2 -2
  250. package/dist/queries/duplicate-bodies.js +1 -1
  251. package/dist/queries/entry-map.d.ts +2 -2
  252. package/dist/queries/entry-map.js +1 -1
  253. package/dist/queries/evidence.d.ts +3 -3
  254. package/dist/queries/evidence.js +1 -1
  255. package/dist/queries/extract-candidates.d.ts +2 -2
  256. package/dist/queries/extract-candidates.js +1 -1
  257. package/dist/queries/fan.d.ts +2 -2
  258. package/dist/queries/fan.js +1 -1
  259. package/dist/queries/files.d.ts +2 -2
  260. package/dist/queries/files.js +1 -1
  261. package/dist/queries/health.d.ts +3 -3
  262. package/dist/queries/health.js +1 -1
  263. package/dist/queries/hierarchy.d.ts +2 -2
  264. package/dist/queries/hierarchy.js +1 -1
  265. package/dist/queries/hotspots.d.ts +2 -2
  266. package/dist/queries/hotspots.js +1 -1
  267. package/dist/queries/imports.d.ts +2 -2
  268. package/dist/queries/imports.js +1 -1
  269. package/dist/queries/incomplete-migration.d.ts +2 -2
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +5 -5
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.d.ts +2 -2
  274. package/dist/queries/isolated.js +1 -1
  275. package/dist/queries/locality-candidates.d.ts +2 -2
  276. package/dist/queries/locality-candidates.js +1 -1
  277. package/dist/queries/members.d.ts +2 -2
  278. package/dist/queries/members.js +1 -1
  279. package/dist/queries/methods.d.ts +2 -2
  280. package/dist/queries/methods.js +1 -1
  281. package/dist/queries/not-implemented.d.ts +2 -2
  282. package/dist/queries/not-implemented.js +1 -1
  283. package/dist/queries/outline.d.ts +2 -2
  284. package/dist/queries/outline.js +1 -1
  285. package/dist/queries/passthrough-candidates.d.ts +2 -2
  286. package/dist/queries/passthrough-candidates.js +1 -1
  287. package/dist/queries/plan-context.d.ts +2 -2
  288. package/dist/queries/plan-context.js +1 -1
  289. package/dist/queries/react-component-duplicates.d.ts +2 -2
  290. package/dist/queries/react-component-duplicates.js +1 -1
  291. package/dist/queries/react-hook-candidates.d.ts +2 -2
  292. package/dist/queries/react-hook-candidates.js +1 -1
  293. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  294. package/dist/queries/react-large-component-pressure.js +1 -1
  295. package/dist/queries/recent-duplicates.d.ts +2 -2
  296. package/dist/queries/recent-duplicates.js +1 -1
  297. package/dist/queries/redundant-reexports.d.ts +2 -2
  298. package/dist/queries/redundant-reexports.js +1 -1
  299. package/dist/queries/reference-neighborhood.d.ts +2 -2
  300. package/dist/queries/reference-neighborhood.js +1 -1
  301. package/dist/queries/reference-reachability.d.ts +2 -2
  302. package/dist/queries/reference-reachability.js +1 -1
  303. package/dist/queries/refs.d.ts +2 -2
  304. package/dist/queries/refs.js +1 -1
  305. package/dist/queries/self-audit.d.ts +2 -2
  306. package/dist/queries/self-audit.js +1 -1
  307. package/dist/queries/similar-chains.d.ts +2 -2
  308. package/dist/queries/similar-chains.js +1 -1
  309. package/dist/queries/similar-files.d.ts +2 -2
  310. package/dist/queries/similar-files.js +1 -1
  311. package/dist/queries/similar-signatures.d.ts +2 -2
  312. package/dist/queries/similar-signatures.js +1 -1
  313. package/dist/queries/similar.d.ts +2 -2
  314. package/dist/queries/similar.js +1 -1
  315. package/dist/queries/slice.d.ts +2 -2
  316. package/dist/queries/slice.js +1 -1
  317. package/dist/queries/source-inspection.d.ts +4 -4
  318. package/dist/queries/source-inspection.js +1 -1
  319. package/dist/queries/source-search.d.ts +2 -2
  320. package/dist/queries/source-search.js +1 -1
  321. package/dist/queries/stale-abstractions.d.ts +2 -2
  322. package/dist/queries/stale-abstractions.js +1 -1
  323. package/dist/queries/stats.d.ts +2 -2
  324. package/dist/queries/surface.d.ts +2 -2
  325. package/dist/queries/surface.js +1 -1
  326. package/dist/queries/symbols.d.ts +2 -2
  327. package/dist/queries/symbols.js +1 -1
  328. package/dist/queries/system-map.d.ts +2 -2
  329. package/dist/queries/system-map.js +1 -1
  330. package/dist/queries/system.d.ts +2 -2
  331. package/dist/queries/system.js +1 -1
  332. package/dist/queries/test-quality.d.ts +2 -2
  333. package/dist/queries/test-quality.js +1 -1
  334. package/dist/queries/trace.d.ts +2 -2
  335. package/dist/queries/trace.js +1 -1
  336. package/dist/queries/twin-ab.d.ts +2 -2
  337. package/dist/queries/twin-ab.js +1 -1
  338. package/dist/queries/twin-drift.d.ts +2 -2
  339. package/dist/queries/twin-drift.js +1 -1
  340. package/dist/queries/unused-imports.d.ts +2 -2
  341. package/dist/queries/unused-imports.js +1 -1
  342. package/dist/queries/unused-params.d.ts +2 -2
  343. package/dist/queries/unused-params.js +1 -1
  344. package/dist/queries/value-flow.d.ts +3 -3
  345. package/dist/queries/value-flow.js +1 -1
  346. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  347. package/dist/queries/vue-component-duplicates.js +1 -1
  348. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  349. package/dist/queries/vue-composable-candidates.js +1 -1
  350. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  351. package/dist/queries/vue-large-view-pressure.js +1 -1
  352. package/dist/queries/wrapper-candidates.d.ts +2 -2
  353. package/dist/queries/wrapper-candidates.js +1 -1
  354. package/dist/reindex-worker.js +2 -2
  355. package/dist/reindex.d.ts +3 -5
  356. package/dist/reindex.js +72 -33
  357. package/dist/runtime.d.ts +23 -4
  358. package/dist/runtime.js +3 -3
  359. package/dist/rust-semantic-session-server.js +1 -1
  360. package/dist/rust-semantic-session-worker.js +1 -1
  361. package/dist/rust-semantic-worker.js +1 -1
  362. package/dist/sentinel-ensure-command-OSWGCFFL.js +3 -0
  363. package/dist/sentinel-ensure-command-SPW7XQLB.js +2 -0
  364. package/dist/sentinel-hook.js +39 -0
  365. package/dist/sentinel-worker.js +16 -0
  366. package/dist/typescript-mailbox-worker.js +1 -1
  367. package/dist/watch-server.js +6 -6
  368. package/docs/COMMAND_REFERENCE.md +5 -3
  369. package/docs/INDEX_GENERATIONS.md +2 -2
  370. package/docs/NPM_RELEASE.md +323 -0
  371. package/docs/schemas/npm-release-state.schema.json +4 -13
  372. package/docs/schemas/project-config.schema.json +159 -0
  373. package/package.json +10 -14
  374. package/skills/codebaseiq/SKILL.md +1 -1
  375. package/skills/concrete-plan/SKILL.md +1 -1
  376. package/ui/view/api.js +450 -0
  377. package/ui/view/app.js +394 -0
  378. package/ui/view/builder.js +323 -0
  379. package/ui/view/file-panel.js +170 -0
  380. package/ui/view/focus.js +379 -0
  381. package/ui/view/index.html +54 -0
  382. package/ui/view/map.js +424 -0
  383. package/ui/view/styles.css +1125 -0
  384. package/dist/chunk-2Q2LW5JW.js +0 -14
  385. package/dist/chunk-2X7V4HS4.js +0 -88
  386. package/dist/chunk-3IER7Q6H.js +0 -12
  387. package/dist/chunk-3JSXXYTZ.js +0 -345
  388. package/dist/chunk-476NR5B7.js +0 -2
  389. package/dist/chunk-5VKBFZZU.js +0 -3
  390. package/dist/chunk-6BQ3DSPK.js +0 -2
  391. package/dist/chunk-6CS3UQTN.js +0 -3
  392. package/dist/chunk-6OAHRI2D.js +0 -6
  393. package/dist/chunk-ADTBPVUZ.js +0 -21
  394. package/dist/chunk-BFFZDZQV.js +0 -2
  395. package/dist/chunk-BMYOV5GP.js +0 -77
  396. package/dist/chunk-C74PPYLA.js +0 -3
  397. package/dist/chunk-CWONGW6P.js +0 -3
  398. package/dist/chunk-DDZ7VHWV.js +0 -20
  399. package/dist/chunk-DR2LURYU.js +0 -3
  400. package/dist/chunk-ECQBG7PW.js +0 -564
  401. package/dist/chunk-EF2R3WNQ.js +0 -2
  402. package/dist/chunk-FM5BPL4V.js +0 -60
  403. package/dist/chunk-G6XFR4ZL.js +0 -4
  404. package/dist/chunk-GTIYTDRE.js +0 -562
  405. package/dist/chunk-HOA5YGOH.js +0 -3
  406. package/dist/chunk-KUW32IRO.js +0 -2
  407. package/dist/chunk-LTA3BRZX.js +0 -2
  408. package/dist/chunk-NAUD7LCA.js +0 -2
  409. package/dist/chunk-NCZUNH3E.js +0 -109
  410. package/dist/chunk-NNJ2KZZG.js +0 -4
  411. package/dist/chunk-NNO6A2PO.js +0 -2
  412. package/dist/chunk-OGTFJ3XD.js +0 -2
  413. package/dist/chunk-Q5ELPRKQ.js +0 -2
  414. package/dist/chunk-Q72QSKXC.js +0 -308
  415. package/dist/chunk-QCN62RTF.js +0 -3
  416. package/dist/chunk-QW7EP6WI.js +0 -21
  417. package/dist/chunk-RU65DDUP.js +0 -215
  418. package/dist/chunk-SELM5MER.js +0 -2
  419. package/dist/chunk-SMRBZ6EC.js +0 -2
  420. package/dist/chunk-SNNWPCN7.js +0 -4
  421. package/dist/chunk-TFZB6XTM.js +0 -239
  422. package/dist/chunk-UCD3H3UZ.js +0 -5
  423. package/dist/chunk-UXM43C7T.js +0 -3
  424. package/dist/chunk-VFY6Y2H6.js +0 -61
  425. package/dist/chunk-WE5RZHZ7.js +0 -5
  426. package/dist/chunk-YMGZZEW4.js +0 -2
  427. package/dist/chunk-YVCIMIOC.js +0 -12
  428. package/dist/chunk-Z54RD7VL.js +0 -3
  429. package/dist/chunk-ZKX2FRS6.js +0 -15
  430. package/dist/cli-context-3SNLDYBM.js +0 -3
  431. package/dist/cli-context-T3B7W6GG.js +0 -2
  432. package/dist/cli-program-YNOXO72B.js +0 -7
  433. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  434. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  435. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  436. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  437. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  438. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  439. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  440. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  441. package/dist/project-reindex-5JOKXAXT.js +0 -2
  442. package/dist/project-reindex-UQBIKO4M.js +0 -3
  443. package/docs/WINDOWS_SIDECAR_RELEASE.md +0 -424
  444. package/docs/schemas/windows-sidecar-provenance.schema.json +0 -137
  445. package/scripts/build-codebaseiq-windows.mjs +0 -197
  446. package/scripts/codebaseiq-windows-provenance.mjs +0 -364
  447. package/scripts/verify-codebaseiq-windows.mjs +0 -29
@@ -0,0 +1,90 @@
1
+ import{d as q}from"./chunk-T75DS2E6.js";import{a as S,c as ne,d as F}from"./chunk-YT4DVWUV.js";import{a as k,c as ee,d as te}from"./chunk-RCIGX23V.js";import{a as j,f as O,i as I}from"./chunk-R2NOK63J.js";import{ca as J,da as Z}from"./chunk-UQYQBLJX.js";import{createHash as xe}from"crypto";import{existsSync as Le,mkdirSync as De}from"fs";import{dirname as re,join as ke}from"path";import V from"better-sqlite3";var Fe="evidence.db";var we=["source-facts","callable-units","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],M=new Set(we),Re=25e4,Ae=512*1024*1024,Pe=6e4,N=new WeakMap;te({name:"evidence-connections",close:se});var je=S("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),Oe=S("evidence-project-fingerprint",{clearGroups:["whole-project"]}),f="evidence-v1",_="version NOT LIKE 'evidence-%'";function ie(e){return xe("sha256").update(e).digest("hex")}function Ct(e,n,t){return je.get(e,n,()=>ie(t))}function ae(e){return Oe.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let n=q(e.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let t=n.metadata,r=[...t.indexedLanguages??[]].sort();return ie(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:r,status:t.status}))}catch(n){return y("project fingerprint unavailable",n),null}})}function y(e,n){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${n instanceof Error?n.message:String(n)}`)}function m(e){if(N.has(e))return N.get(e)??null;let n=null;try{let t=new V(k(ke(re(e.config.dbPath),Fe)));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `),n={evidence:t,shared:Ie(e.config.sharedEvidenceDbPath),readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${_}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
39
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${_}
40
+ ORDER BY version DESC
41
+ LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
42
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
43
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${_}
44
+ ORDER BY version DESC
45
+ LIMIT 1`),readCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
46
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:t.prepare(`SELECT symbol, payload FROM semantic_callees
47
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${_}
48
+ ORDER BY symbol, version DESC`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
49
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
50
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
51
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${_}
52
+ ORDER BY version DESC
53
+ LIMIT 1`),readReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
54
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:t.prepare(`SELECT symbol, payload FROM semantic_references
55
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${_}
56
+ ORDER BY symbol, version DESC`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
57
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(t){y("disabled (open failed)",t)}return N.set(e,n),n}function h(e,n,t){y(`disabled (${n})`,t);try{se(e)}catch(r){y("close failed while disabling",r)}N.set(e,null)}function se(e){let n=N.get(e);if(N.delete(e),!n)return;let t,r;try{n.shared?.evidence.close()}catch(i){t=i}try{n.evidence.close()}catch(i){r=i}if(t!==void 0&&r!==void 0)throw new AggregateError([t,r],"Shared and project evidence connections failed to close.");if(t!==void 0)throw t;if(r!==void 0)throw r}function Ie(e){if(!e)return null;try{De(re(e),{recursive:!0});let n=new V(k(e));return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
58
+ CREATE TABLE IF NOT EXISTS file_evidence (
59
+ kind TEXT NOT NULL,
60
+ relative_path TEXT NOT NULL,
61
+ content_hash TEXT NOT NULL,
62
+ version TEXT NOT NULL,
63
+ payload TEXT NOT NULL,
64
+ last_accessed_at INTEGER NOT NULL,
65
+ PRIMARY KEY (kind, relative_path, content_hash, version)
66
+ );
67
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
+ `),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
+ VALUES (?, ?, ?, ?, ?, ?)
71
+ ON CONFLICT(kind, relative_path, content_hash, version)
72
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
73
+ SET last_accessed_at = ?
74
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
+ AND last_accessed_at < ?`)}}catch(n){return y("shared cache disabled (open failed)",n),null}}function B(e,n,t){y(`shared cache disabled (${n})`,t);try{e.shared?.evidence.close()}catch{}e.shared=null}function bt(e,n={}){if(!Le(e))return null;let t;try{t=new V(k(e)),t.pragma("busy_timeout = 50"),t.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
76
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),t.pragma("wal_checkpoint(TRUNCATE)");let r=t.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=n.maxRows??Re,a=n.budgetBytes??Ae,s=Number(t.pragma("page_size",{simple:!0})),o=Number(t.pragma("page_count",{simple:!0})),l=Number(t.pragma("freelist_count",{simple:!0})),d=Math.max(0,o-l)*s,g=r>0&&d>a?Math.min(r,Math.ceil((d-a)/Math.max(1,d/r))):0,c=Math.max(r-i,g);return c>0&&(t.prepare(`DELETE FROM file_evidence WHERE rowid IN (
77
+ SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
78
+ )`).run(c),t.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:c,remainingRows:r-c}}catch(r){return y("shared cache maintenance skipped",r),null}finally{try{t?.close()}catch{}}}function oe(e,n,t,r){let i=m(e);if(!i)return null;try{let a=i.readFileEvidence.get(n,t,r,f)??i.readLegacyFileEvidence.get(n,t,r);if(a?.payload!==void 0)return a.payload;if(!M.has(n)||!i.shared)return null;try{let s=i.shared.readFileEvidence.get(n,t,r,f);return s?.payload!==void 0&&Ve(i.shared,n,t,r),s?.payload??null}catch(s){return B(i,"file_evidence read",s),null}}catch(a){return h(e,"file_evidence read",a),null}}function Ve(e,n,t,r){let i=Date.now();try{e.touchFileEvidence.run(i,n,t,r,f,i-Pe)}catch(a){y("shared file_evidence recency touch skipped",a)}}function ce(e,n,t,r,i){let a=m(e);if(a)try{if(a.writeFileEvidence.run(n,t,r,f,i),M.has(n)&&a.shared)try{a.shared.writeFileEvidence.run(n,t,r,f,i,Date.now())}catch(s){B(a,"file_evidence write",s)}}catch(s){h(e,"file_evidence write",s)}}function le(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{for(let i of n)t.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload)})();let r=n.filter(i=>M.has(i.kind));if(r.length>0&&t.shared)try{t.shared.evidence.transaction(()=>{for(let i of r)t.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,f,i.payload,Date.now())})()}catch(i){B(t,"file_evidence batch write",i)}}catch(r){h(e,"file_evidence batch write",r)}}function de(e,n,t,r){let i=m(e);if(!i)return null;try{return(i.readProjectEvidence.get(n,t,r,f)??i.readLegacyProjectEvidence.get(n,t,r))?.payload??null}catch(a){return h(e,"project_evidence read",a),null}}function pe(e,n,t,r,i){let a=m(e);if(a)try{a.writeProjectEvidence.run(n,t,r,f,i)}catch(s){h(e,"project_evidence write",s)}}function Tt(e,n,t,r){let i=m(e);if(!i)return new Map;try{let a=i.readCalleesForFile.all(n,t,r,f),s=i.readLegacyCalleesForFile.all(n,t,r);return ue([...s,...a])}catch(a){return h(e,"semantic_callees bulk read",a),new Map}}function xt(e,n,t){let r=m(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(n,t,f),a=r.readLegacyReferencesForFile.all(n,t);return ue([...a,...i])}catch(i){return h(e,"semantic_references bulk read",i),new Map}}function ue(e){let n=new Map;for(let t of e)n.set(t.symbol,t.payload);return n}function Lt(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.contentHash}`;r.has(a)||(r.add(a),t.dropStaleCallees.run(i.relativePath,i.contentHash)),t.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,f,i.payload)}})()}catch(r){h(e,"semantic_callees write",r)}}function Dt(e,n){if(n.length===0)return;let t=m(e);if(t)try{t.evidence.transaction(()=>{let r=new Set;for(let i of n){let a=`${i.relativePath}\0${i.projectFingerprint}`;r.has(a)||(r.add(a),t.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),t.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,f,i.payload)}})()}catch(r){h(e,"semantic_references write",r)}}var Me=[p("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),p("callable-units",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/source/callable-units.test.ts",owner:"src/source/facts/callable-units.ts"}),p("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),p("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),p("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),p("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),p("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),p("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),p("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),p("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),p("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),p("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),p("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),p("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),w("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),w("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function Pt(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=ae(t);if(l){let d=`${l}\0${r}\0${i}`;o=n.get(d),o||(o=O(["evidence-product-file-read-v1",e.kind,l,r,i]),n.set(d,o))}}return I("evidence-product.file.read",()=>{let l=oe(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){ce(t,e.kind,r,i,e.serialize(a))},writeBatch(t,r){le(t,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function jt(e){let n=new Map;return{kind:e.kind,read(t,r,i){let a=!1,s=0,o;if(j()){let l=`${i}\0${r}`;o=n.get(l),o||(o=O(["evidence-product-project-read-v1",e.kind,i,r]),n.set(l,o))}return I("evidence-product.project.read",()=>{let l=de(t,e.kind,r,i);if(l===null)return null;s=l.length;try{let d=e.deserialize(l);return a=d!==null,d}catch{return null}},()=>({...o?{workIdentity:o,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:a,payloadBytes:s}))},write(t,r,i,a){pe(t,e.kind,r,i,e.serialize(a))}}}function Ot(e){let n=Me.find(t=>t.kind===e);if(!n)throw new Error(`missing evidence product manifest entry for ${e}`);return n.invalidation}function p(e,n){return{scope:"file",kind:e,invalidation:{scope:"file",...n}}}function w(e,n){return{scope:"project",kind:e,invalidation:{scope:"project",...n}}}var Be=S("source-text",{clearGroups:["whole-project","source-file"]}),Ue=S("source-lines",{clearGroups:["whole-project","source-file"]});function v(e,n){let t=n.replace(/\\/g,"/");return Be.get(e,t,()=>{try{return J(e.config.projectRoot,t,{inputKind:"indexed source file"})}catch(r){if(Z(r))return"";throw r}})}function He(e,n){let t=n.replace(/\\/g,"/");return Ue.get(e,t,()=>{let r=v(e,t);return r?r.split(`
79
+ `):[]})}var Ke=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function $e(e){let n=Ke.exec(e);return n?n[1]??"":null}function Bt(e,n,t){return fe(e,n,t).length>0}function Ut(e,n,t,r){let i=r.toLowerCase();return fe(e,n,t).some(a=>a.toLowerCase()===i)}function fe(e,n,t){if(t<=0)return[];let r=He(e,n);if(r.length===0)return[];let i=[];for(let a=t-1;a>=0&&a>=t-5;a-=1){let s=(r[a]??"").trim();if(s==="")continue;let o=$e(s);if(o!==null){i.push(o);continue}if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return i}return i}function U(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e){return e.replace(/'''[\s\S]*?'''/g,E).replace(/"""[\s\S]*?"""/g,E).replace(/#.*$/gm,E).replace(/\/\/.*$/gm,E).replace(/\/\*[\s\S]*?\*\//g,E).replace(/`(?:\\[\s\S]|[^`])*`/g,E).replace(/'(?:\\.|[^'\\\r\n])*'/g,E).replace(/"(?:\\.|[^"\\\r\n])*"/g,E)}function Yt(e){return ge(e,{maskStrings:!1})}function zt(e){return ge(e,{maskStrings:!0})}function ge(e,n){let t="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let s=e.indexOf(`
80
+ `,r),o=s===-1?i:s;t+=H(e,r,o),r=o;continue}if(e[r]==="/"&&e[r+1]==="*"){let s=e.indexOf("*/",r+2),o=s===-1?i:s+2;t+=H(e,r,o),r=o;continue}let a=e[r];if(a==="`"||a==="'"||a==='"'){let s=a,o=r+1;for(;o<i;){if(e[o]==="\\"){o+=2;continue}if(e[o]===s){o+=1;break}if(s!=="`"&&e[o]===`
81
+ `)break;o+=1}t+=n.maskStrings?H(e,r,o):e.slice(r,o),r=o;continue}t+=a,r+=1}return t}function H(e,n,t){let r="";for(let i=n;i<t;i+=1)r+=e[i]===`
82
+ `?`
83
+ `:" ";return r}function E(e){return e.replace(/[^\r\n]/g," ")}var Qt=F("stripped-lines",{clearGroups:["whole-project","source-file"]});ee({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{R=null,T=""},clearFile:()=>{R=null,T=""}});var R=null,T="";function We(e){return R===e||(R=e,T=Xe(e)),T}function Gt(e,n,t){let r=We(e);return`${r.slice(0,n)}${" ".repeat(t-n)}${r.slice(t)}`}function qt(e,n){return new RegExp(`\\b${U(n)}\\b`,"m").test(e)}function Jt(e,n){let t=new Set,r=new RegExp(`\\b${U(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let a=i[1];a&&t.add(a)}return[...t]}function Zt(e){let n=0;for(let t of e)t==="("&&(n+=1),t===")"&&(n-=1);return n}import{extname as me}from"path";var Ye={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function K(e){return Ye[me(e).toLowerCase()]??null}function $(e){return me(e).toLowerCase()===".vue"}import{createRequire as ze}from"module";var u=ze(import.meta.url),x=null,X=!1;function he(){if(X)return null;if(x)return x;try{return x=u("tree-sitter"),x}catch{return X=!0,null}}function an(e){if(e==="clojure")return"reader";let n=he();if(!n)return"unavailable";let t=ye(e);if(!t)return"unavailable";try{return new n().setLanguage(t),"ast"}catch{return C.add(e),"unavailable"}}var W=new Map,C=new Set;function ye(e){if(C.has(e))return null;let n=W.get(e);if(n)return n;let t;try{switch(e){case"rust":t=u("tree-sitter-rust");break;case"typescript":t=u("tree-sitter-typescript").typescript;break;case"tsx":t=u("tree-sitter-typescript").tsx;break;case"javascript":t=u("tree-sitter-javascript");break;case"python":t=u("tree-sitter-python");break;case"java":t=u("tree-sitter-java");break;case"kotlin":t=u("tree-sitter-kotlin");break;case"scala":t=u("tree-sitter-scala");break;case"ruby":t=u("tree-sitter-ruby");break;case"c":t=u("tree-sitter-c");break;case"cpp":t=u("tree-sitter-cpp");break;case"csharp":t=u("tree-sitter-c-sharp");break;case"php":t=u("tree-sitter-php").php;break;case"vb":{let r=u("tree-sitter-vb-dotnet");t=r.language??r;break}case"clojure":return C.add(e),null}}catch{return C.add(e),null}return W.set(e,t),t}var Y=new Map;function sn(){x=null,X=!1,W.clear(),C.clear(),Y.clear(),qe.clear()}function Qe(e){let n=Y.get(e);if(n)return n;let t=ye(e);if(!t)return null;let r=he();if(!r)return null;let i=new r;try{i.setLanguage(t)}catch{return C.add(e),null}return Y.set(e,i),i}function Ge(e,n){return e.parse(r=>r>=n.length?null:n.slice(r,Math.min(n.length,r+16384)))}function L(e,n){let t=Qe(e);if(!t)return null;try{return Ge(t,n)}catch{return null}}var qe=new Map;import{posix as z}from"path";import{parse as Je}from"@vue/compiler-sfc";var Ze=ne("vue-sfc-units");function un(e,n){let t=Se(n),r=v(e,t);return Ze.get(e,t,r,()=>Q(e,t,r))}function Se(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function et(e){let n=e?.toLowerCase();return!n||n==="js"||n==="javascript"||n==="jsx"?"javascript":n==="ts"||n==="typescript"?"typescript":n==="tsx"?"tsx":null}function fn(e){return!e||e.body.length===0?0:e.body.split(`
84
+ `).length}function Q(e,n,t){let r={relativePath:n,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!t)return r;let i;try{i=Je(t,{filename:n})}catch(s){return r.errors.push(ve(s)),r}r.errors.push(...i.errors.map(ve));let{descriptor:a}=i;return a.template&&(r.template=A(e,n,"template",a.template)),a.script&&r.scripts.push(Ee(e,n,a.script,!1)),a.scriptSetup&&r.scripts.push(Ee(e,n,a.scriptSetup,!0)),r.styles=a.styles.map(s=>A(e,n,"style",s)),r.customBlocks=a.customBlocks.map(s=>A(e,n,"custom",s)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(s=>s?.errors??[])),r}function Ee(e,n,t,r){let i=A(e,n,"script",t);return{...i,kind:"script",setup:r,astLanguage:et(i.lang)}}function A(e,n,t,r){let i=nt(r.attrs),a=typeof i.lang=="string"?i.lang:null,s=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(s){let l=tt(n,s);if(!l)return{kind:t,ownerPath:n,sourcePath:n,external:!0,src:s,attrs:i,lang:a,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${t} block source: ${s}`]};let d=v(e,l),g=d?Math.max(0,d.split(`
85
+ `).length-1):0;return{kind:t,ownerPath:n,sourcePath:l,external:!0,src:s,attrs:i,lang:a,body:d,startLine:0,endLine:g,errors:d?[]:[`Vue ${t} block source not found: ${l}`]}}let o=Math.max(0,r.loc.start.line-1);return{kind:t,ownerPath:n,sourcePath:n,external:!1,attrs:i,lang:a,body:r.content,startLine:o,endLine:Math.max(o,r.loc.end.line-1),errors:[]}}function tt(e,n){let t=n.split(/[?#]/,1)[0];if(!t||t.startsWith("/")||t.includes("://"))return null;let r=Se(z.normalize(z.join(z.dirname(e),t)));return r===".."||r.startsWith("../")?null:r}function nt(e){return{...e}}function ve(e){return e instanceof Error?e.message:String(e)}function G(e,n,t){let i=Q(e,n,t).scripts.filter(s=>s.astLanguage&&s.body.length>0),a=i[0]?.astLanguage;return a?{body:i.map(s=>`${`
86
+ `.repeat(s.startLine)}${s.body}`).join(`
87
+ `),startLine:0,language:a}:null}var _e=F("ast-trees",{clearGroups:["whole-project","source-file"]});function Nn(e,n){if($(n))return rt(e,n);let t=K(n);if(!t)return null;let r=v(e,n);return r?_e.get(e,n,r,()=>L(t,r)):null}function Cn(e,n,t){if($(n)){let a=G(e,n,t);if(!a)return null;let s=L(a.language,`
88
+ `.repeat(a.startLine)+a.body);return s?{tree:s,language:a.language}:null}let r=K(n);if(!r)return null;let i=L(r,t);return i?{tree:i,language:r}:null}function rt(e,n){let t=v(e,n);return t?_e.get(e,n,t,()=>{let r=G(e,n,t);if(!r)return null;let i=`
89
+ `.repeat(r.startLine)+r.body;return L(r.language,i)}):null}function Tn(e,n){let t=at(e,n);if(!t)return null;let r=P(t);if(!r)return null;let i=st(t);return{calleeLeaf:r,calleeQualifier:i?it(t):void 0,calleeText:t.text,memberAccess:i,line:e.startPosition.row}}function it(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function at(e,n){if(n==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(n==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(n==="typescript"||n==="tsx"||n==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function st(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function P(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let n=e.namedChild(e.namedChildCount-1);return n?P(n):null}case"generic_function":{let n=e.childForFieldName("function")??e.namedChild(0);return n?P(n):null}case"scoped_identifier":{let n=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return n?P(n):null}case"super":case"self":case"this":return null;default:return null}}function D(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ot=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Ne=new Set(["arrow_function","function_expression","generator_function"]);function ct(e,n){let t=ut(e,n);if(t)return t;if(!pt(e.type,n))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,definitionNode:e,functionNode:e}:null}function kn(e,n){let t=ct(e,n);if(!t)return null;let{definitionNode:r,functionNode:i}=t;return{name:t.name,startLine:r.startPosition.row,endLine:r.endPosition.row,paramCount:ft(i),params:lt(i),paramsEndLine:dt(i),isLiteralPassthrough:gt(i,n)}}function be(e){return e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters")}function lt(e){let n=be(e);if(!n)return[];let t=[];for(let r of n.namedChildren){if(D(r))continue;if(r.type==="identifier"){t.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),a=r.childForFieldName("pattern");if(!i&&a&&a.type==="identifier"){t.push({name:a.text,simple:!0});continue}let s=r.namedChildren.find(o=>o.type==="identifier");t.push({name:a?.type==="identifier"?a.text:s?.text??"",simple:!1})}return t}function dt(e){let n=be(e);return n?n.endPosition.row:e.startPosition.row}function pt(e,n){return n==="rust"?e==="function_item"||e==="function_signature_item":n==="python"?e==="function_definition":n==="typescript"||n==="tsx"||n==="javascript"?ot.has(e):!1}function ut(e,n){if(n!=="typescript"&&n!=="tsx"&&n!=="javascript")return null;if(e.type==="variable_declarator"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=Ce(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let t=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!t||!r)return null;let i=Ce(r);return i?{name:t.text,definitionNode:e,functionNode:i}:null}return null}function Ce(e){if(Ne.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Ne.has(i.type));return r.length===1?r[0]:null}function ft(e){let n=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!n)return 0;let t=0;for(let r of n.namedChildren)D(r)||(t+=1);return t}function gt(e,n){let t=e.namedChildren.find(c=>c.type==="block"||c.type==="statement_block");if(!t)return!1;let r=t.namedChildren.filter(c=>!D(c));if(r.length!==1)return!1;let i=r[0],a=null;if(i.type==="return_statement"||i.type==="expression_statement"?a=i.namedChild(0)??null:n==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(a=i),!a)return!1;let s=n==="python"?"call":"call_expression";if(a.type!==s)return!1;let o=a.namedChildren.find(c=>c.type==="arguments"||c.type==="argument_list");if(!o)return!1;let l=o.namedChildren.filter(c=>!D(c)),d=e.namedChildren.find(c=>c.type==="parameters"||c.type==="formal_parameters");if(!d)return!1;let g=[];for(let c of d.namedChildren){if(c.type==="identifier"){g.push(c.text);continue}let b=c.namedChildren.find(Te=>Te.type==="identifier");b&&g.push(b.text)}if(l.length!==g.length)return!1;for(let c=0;c<g.length;c+=1){let b=l[c];if(b.type!=="identifier"||b.text!==g[c])return!1}return!0}export{ie as a,Ct as b,ae as c,bt as d,Tt as e,xt as f,Lt as g,Dt as h,Pt as i,jt as j,Ot as k,v as l,He as m,$e as n,Bt as o,Ut as p,U as q,Xe as r,Yt as s,zt as t,Gt as u,qt as v,Jt as w,Zt as x,K as y,$ as z,an as A,sn as B,L as C,un as D,fn as E,G as F,Nn as G,Cn as H,Tn as I,P as J,D as K,ct as L,kn as M};
90
+ //# sourceMappingURL=chunk-5FWR5HLG.js.map
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import{Z as Ne,_ as Le}from"./chunk-C7QWUBR2.js";import{H as O,M as De,ha as Me,l as ne,m as qe,n as R,o as Oe,p as Pe,w as A,x as He,y as _e}from"./chunk-7UCDGXRW.js";import{a as Q,b as X,d as w,e as T,f as we}from"./chunk-D62CTZX6.js";import{J as q,N as Z,O as Ce,P as ee,Q as Ie,V as We,X as Te,Y as te,c as Y,d as Re,e as Ae,o as g,r as Ee}from"./chunk-5T44HG5Y.js";import{C as x,e as ke,g as B,h as Se,i as k,j as V,k as be,p as K,r as f,w as xe,x as J,y as z}from"./chunk-DUKHVPU5.js";import{existsSync as h,mkdirSync as Rt,rmdirSync as At,unlinkSync as Et}from"fs";import{homedir as Ct}from"os";import{basename as Ke,dirname as D,isAbsolute as It,join as l,resolve as oe}from"path";import{fileURLToPath as Wt}from"url";var $e=["- `codebaseiq search <exact-text>` \u2014 Where does this exact text occur in current project text, and which aligned compiler symbol owns each line? Requires: One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.","- `codebaseiq outline <file>` \u2014 What symbols and nesting exist in this file? Requires: One exact current project file path.","- `codebaseiq entrypoints [text]` \u2014 Which detected external roots or entry-surface candidates match this text? Requires: Optional exact text to filter candidates; otherwise the current indexed repository.","- `codebaseiq evidence` \u2014 Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap? Requires: One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.","- `codebaseiq inspect` \u2014 Which related source units across several known text, symbol, or location anchors should be read together? Requires: One or more exact text, symbol, or file:line selectors naming the unresolved behavior.","- `codebaseiq code <selectors...>` \u2014 What exact source defines these symbols, ranges, or file surfaces? Requires: One or more exact symbols, file:line ranges, or file paths.","- Choose graph controls explicitly: `execution incoming` \u2014 Who can call or reach this?; `execution outgoing` \u2014 What can this call or reach?; `dataflow incoming` \u2014 Where can this value come from?; `dataflow outgoing` \u2014 Where can this value go?; `runtime both` \u2014 Which producer and consumer rendezvous?; `state both` \u2014 What resource is observed or changed?; `temporal both` \u2014 What occurs before or after this?; `contract both` \u2014 What interface constrains this?; `identity both` \u2014 Are these observations the same entity?; `ownership both` \u2014 What contains or owns this?; `dependencies outgoing` \u2014 What does this statically rely on?. The CLI does not infer them from English intent.","- Calibration: exact is directly observed; derived is deterministically computed; candidate needs confirmation; mixed discloses its constituents; unknown cannot support a stronger claim. Read coverage and recovery before making absence claims.","- The controls above are complete for ordinary exploration. Run `codebaseiq capabilities --matrix` only when a named claim depends on uncertain provider support; do not run it for routine orientation."],Nn=[{stage:"locate",id:"search",command:"search <exact-text>",question:"Where does this exact text occur in current project text, and which aligned compiler symbol owns each line?",requiredInput:"One exact text literal or deliberately bounded regular expression; insert `--` before a literal that starts with a dash.",returnedFact:"exact cardinality, bounded identities and source, and scope commands that recover withheld matches",evidenceCeiling:"Exact current-text cardinality and locations within reported text coverage; compiler ownership only where aligned.",nonClaim:"Structural source ranking orders exact matches but does not establish task relevance. A literal co-occurrence does not establish a graph relationship.",outputCost:"small",contrasts:["outline: search locates exact text across files; outline enumerates compiler-owned constructs in one known file."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"outline",command:"outline <file>",question:"What symbols and nesting exist in this file?",requiredInput:"One exact current project file path.",returnedFact:"symbol names, nesting, and line ranges",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay.",nonClaim:"File ownership and nesting do not establish execution or task relevance.",outputCost:"small",contrasts:["search: outline enumerates constructs in one known file; search locates exact text across current project text.","code: outline returns identities and ranges; code materializes exact source for selected identities."],gapClosingCommands:["evidence","inspect","code"]},{stage:"locate",id:"entrypoints",command:"entrypoints [text]",question:"Which detected external roots or entry-surface candidates match this text?",requiredInput:"Optional exact text to filter candidates; otherwise the current indexed repository.",returnedFact:"entry symbols with files, confidence, evidence, and indexed caller counts",evidenceCeiling:"Source/compiler-grounded entry evidence and indexed caller counts; exported-only candidates remain candidates.",nonClaim:"A package-public export or zero indexed callers is an entry candidate, not proof of runtime ingress. Entry classification does not establish that the callable executes.",outputCost:"bounded",contrasts:["entry-map: entrypoints locates possible external roots; entry-map traverses static calls from one selected root.","search: entrypoints classifies callable roots; search only locates exact text and ownership."],gapClosingCommands:["evidence","inspect","code"]},{stage:"project",id:"evidence",command:"evidence",question:"Which exact execution, runtime, data, state, temporal, contract, identity, ownership, or dependency relationships surround these referents? Which related source must be read only when graph evidence leaves a named implementation gap?",requiredInput:"One or more exact symbol, file:line, or literal roots plus explicit family, direction, depth, and output bound.",returnedFact:"batched exact selectors and typed graph relationships; compact endpoints with exact locations and follow-up commands; coverage and recoverable omissions; exact source-recovery command when source was requested with a graph projection; explicit ambiguity failure with exact rerun commands",evidenceCeiling:"Typed edges only to each registered provider ceiling within the explicitly selected projection and reported coverage.",nonClaim:"The projection does not infer which relationships are relevant to the user task. Reference, dependency, data, state, temporal, contract, and identity edges do not become execution claims.",outputCost:"bounded",contrasts:["refs: refs enumerates direct reference sites; evidence traverses explicitly selected typed relationships.","call-graph: call-graph specializes in static calls; evidence can combine execution with other selected families.","value-flow: value-flow specializes in proved transfers; evidence projects bounded dataflow alongside other families.","dependence-slice: dependence-slice computes a program-dependence slice; evidence performs bounded graph projection."],gapClosingCommands:["inspect","code"]},{stage:"read",id:"inspect",command:"inspect",question:"Which related source units across several known text, symbol, or location anchors should be read together?",requiredInput:"One or more exact text, symbol, or file:line selectors naming the unresolved behavior.",returnedFact:"one ranked, deduplicated semantic packet plus exact selector cardinality and explicit expansion coverage",evidenceCeiling:"Complete current source for every materialized syntax unit; bounded selector and packet coverage remain explicit.",nonClaim:"A source packet does not choose which implementation details are relevant to the user task. A reference mention does not establish executable reachability.",outputCost:"potentially-large",contrasts:["code: inspect batches bounded behavior or source gaps; code materializes complete exact source.","evidence: inspect reads implementation units; evidence projects typed relationships without source."],gapClosingCommands:[]},{stage:"read",id:"code",command:"code <selectors...>",question:"What exact source defines these symbols, ranges, or file surfaces?",requiredInput:"One or more exact symbols, file:line ranges, or file paths.",returnedFact:"per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed.",nonClaim:"Source materialization does not establish callers, runtime reachability, or task relevance by itself.",outputCost:"potentially-large",contrasts:["inspect: code materializes complete exact source; inspect batches bounded behavior or source gaps.","outline: code reads selected implementations; outline enumerates file structure without reading every body."],gapClosingCommands:[]}];var m="<!-- codebaseiq:agent-setup:begin -->",S="<!-- codebaseiq:agent-setup:end -->",Tt="# codebaseiq:agent-setup",M=[".codex/hooks.json",".claude/settings.local.json"],je="# codebaseiq:local-agent-hooks:begin",Fe="# codebaseiq:local-agent-hooks:end",ie="hook-architecture-stop",Je=["claude","codex"],E={claude:".claude/settings.local.json",codex:".codex/hooks.json"},ze="sentinel-hook.mjs",qt=l("dist","sentinel-hook.js"),Ot=l("dist","cli.js"),Pt="cli-path",Ht="installed-projects.json";function tr(e){let t=e.written.length+e.unchanged.length,n=e.skipped.length;return{verdict:n===0?"ready":t===0?"blocked":"partial",ready:t,skipped:n}}function nr(e,t={}){let n={written:[],unchanged:[],skipped:[]};return _t(e,n),t.architectureHook!==!1&&Nt(e,n,t.architectureHook),n}function rr(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return Ue(e,"AGENTS.md",t,n),Ue(e,"CLAUDE.md",t,n),Xe(e,t,n,r=>at(jt(r))),st(e,t,n),Mt(e,t,n),n}function _t(e,t){let n=[m,"## codebaseiq","","This repository uses codebaseiq as its primary code exploration surface.","","codebaseiq separates two responsibilities: the agent decides what repository fact it needs, while the tool locates exact referents and reports compiler, runtime, data, state, temporal, contract, identity, ownership, and dependency evidence without guessing task relevance. The ordinary loop is locate an exact root, project explicitly chosen relationships, read behavior only for a named remaining gap, then stop when the requested claims are established.","","- Use codebaseiq for repository exploration, including literal search and exact source reads. Native tools are for applying edits, running checks, binary content, or a specific unsupported gap that codebaseiq has explicitly reported\u2014not a parallel exploration workflow.","- Before exploring, state the few material repository facts the answer depends on. Include behavior-changing predicates, authorization checks, data reshaping, hard bounds, runtime crossings, durable state changes, emitted notifications, returned values, relevant sibling outcomes, and externally visible ordering only when the request depends on them.","- For end-to-end explanations, use the installed codebaseiq-explore guidance to maintain the evidence ledger and audit the final answer; codebaseiq supplies the repository observations.",...$e,"- Any exact symbol or `file:line` returned by a locator is immediately usable as a graph root. There is no required anchor-discovery phase and locator ordering never proves task relevance. For an end-to-end question, include the initiating owner as a root or request incoming execution capable of exposing it; do not assume a core type is the ingress. Locate independent roots together when the question already implies several participants.","- A materialized evidence projection requires repeated `--symbol`, `--at`, or `--search` selectors plus one or more repeated `--edge <family>` flags, explicit `--direction incoming|outgoing|both`, `--depth <n>`, and `--max-edges <n>`. The agent chooses the relationships capable of establishing its claim; the CLI resolves identity, direction, evidence strength, provider support, and coverage. Use optional exact `--subtype <subtype>` and `--connecting` only when the selected roots themselves must be connected. Never request `complete`, `all`, or every family merely to discover what exists; use `--inventory-only` when only counts can determine the next bounded projection.","- Treat execution calls and exact runtime handoffs as executable reachability. Dataflow, state, temporal, contract, identity, ownership, and dependency edges say what a path carries, changes, orders, constrains, identifies, contains, or relies on; they do not become call claims. Treat exact edges as facts only within their stated coverage and candidate edges as leads requiring source confirmation.","- Read every packet as a coverage contract. `accounted` means the requested bounded projection reports every omission; `bounded` means requested edges were placed in stable recoverable folds by the output budget; `incomplete` means a selector or provider could not be resolved. None proves the user task complete, and missing output is no evidence of absence.","- Prefer batched locators, projections, and gap reads. Query count measures exploration efficiency; it never makes a known recoverable material fact optional. Before drilling down, name the still-missing fact. Expand only a printed fold or exact adjacent identity that can establish it; batch independent roots and gaps instead of shuttling between abstraction levels, and repeat only while a named fact remains unresolved.","- Use `codebaseiq inspect --symbol <symbol> --symbol <symbol> --at <file:line> --view behavior` for several named behavioral gaps. Connected behavior is already source evidence; do not reread lines it rendered. Use `codebaseiq code <symbol-or-range>` only when exact implementation syntax can change the decision. Do not replace these reads with `rg`, `grep`, `sed`, or `nl`.","- For a multi-step mutation, preserve later compaction, rollback, and cleanup. For every event, log, or outbox write, preserve its operation and record identity. For coordination, state the lock scope and which checks and writes occur inside it. State whether interruption is prevented, atomic, rolled back, or repaired later. Resolve exact constant values when they can change the answer.","- For a tiered policy or dispatcher, preserve the precedence of its tiers and the exact scope of every bypass; never imply that a later bypass can skip an earlier hard rejection unless the rendered condition proves it.","- For a stateful owner, preserve its lifetime and sharing scope, including whether it is a singleton, shared registry, per-session instance, or per-invocation value.","- Use `codebaseiq diff-impact` to map changed symbols and downstream consumers after a nontrivial edit.","- Use `codebaseiq architecture` to inspect explicit structural rules.","- Use `codebaseiq health` to find React, Vue, duplication, complexity, drift, and cleanup candidates.","- Before claiming a complete relationship set or an absence, inspect coverage and use `--full` only when complete coverage can change the decision. A bounded or unsupported result cannot establish that no caller, route, branch, poller, or consumer exists.","- Before claiming what every callsite passes, read the `trace` or `evidence` claim-support section. Only an eligible callsite-argument claim is backed by complete syntactic invocations; bounded context is not proof.","- Prefer human output for agent reading. Use `--json --result-only` only for a programmatic consumer.","- Never rerun a successful human command as JSON. Before each drilldown, name the still-unanswered fact and check whether an earlier packet already establishes it; if so, update the ledger or draft without another query. Stop when no unanswered fact remains because every additional reasoning step pays again for the accumulated context.","- Before answering, compare the draft to selected statement-complete behavior. Preserve every material behavior-changing predicate, returned default, separately merged field, cache invalidation, and cleanup effect. Do not collapse fields with different operations into a generic summary, and do not re-query evidence already in context.","- With an explicit CODEBASEIQ_SESSION, a complete source unit, a byte-identical exact subset of a prior exact source read, or a graph unit/edge may be replaced by a visible receipt from the same index generation. Preview coverage never suppresses an exact unit; changed bytes, changed graph content, a new generation, or --reemit force full evidence.","- If output emits `Continue exactly:`, run that command unchanged until transport is complete.","- When architecture rules are configured and clean, setup installs one checkout-local Stop hook. It checks architecture only after indexed source changes.","- Commit relevant `.codebaseiq/suppressions/*.json` records with the change. Do not commit local agent-tool settings.",S].join(`
3
+ `);Ge(e,"AGENTS.md",n,t);let r=[m,"@AGENTS.md",S].join(`
4
+ `);Ge(e,"CLAUDE.md",r,t,o=>o.includes("@AGENTS.md")&&!o.includes(m))}function Ge(e,t,n,r,o){let i=l(e,t),s=!1,c=se(i,t,r,a=>{if(o?.(a.text))return s=!0,{kind:"unchanged"};let d=Dt(a.text,n);return d===a.text?{kind:"unchanged"}:{kind:"write",text:d,...a.revision.exists?{}:{mode:420}}});c&&(!c.changed||s?r.unchanged.push(t):r.written.push(t))}function Ue(e,t,n,r){let o=l(e,t);if(n.dryRun){if(!h(o)){r.unchanged.push(t);return}try{let s=f(o,"agent instruction file");s.includes(m)?(Be(s),r.removed.push(t)):r.unchanged.push(t)}catch(s){r.skipped.push({target:t,reason:s instanceof Error?s.message:String(s)})}return}let i=se(o,t,r,s=>{if(!s.revision.exists||!s.text.includes(m))return{kind:"unchanged"};let c=Be(s.text);return c.length===0?{kind:"delete"}:{kind:"write",text:c}});i&&(i.changed?r.removed.push(t):r.unchanged.push(t))}function Dt(e,t){if(Qe(e)==="present"){let r=new RegExp(`${m}[\\s\\S]*?${S}`);return e.replace(r,t)}return e.length>0?`${e.replace(/\n*$/,`
5
+
6
+ `)}${t}
7
+ `:`${t}
8
+ `}function Be(e){Qe(e);let t=new RegExp(`${m}[\\s\\S]*?${S}`),n=e.replace(t,"").replace(/\n{3,}/g,`
9
+
10
+ `).trim();return n.length===0?"":`${n}
11
+ `}function Qe(e){let t=e.split(m).length-1,n=e.split(S).length-1;if(t===0&&n===0)return"absent";if(t===1&&n===1&&e.indexOf(m)<e.indexOf(S))return"present";throw new Error("managed codebaseiq markers are incomplete, duplicated, or out of order")}function se(e,t,n,r){try{return A(e,r,{maxRetries:0})}catch(o){n.skipped.push({target:t,reason:o instanceof Error?o.message:String(o)});return}}function Mt(e,t,n){let r=".git/hooks/pre-commit",o=l(e,r);if(!h(o)){n.unchanged.push(r);return}if(!f(o,"pre-commit hook").includes(Tt)){n.skipped.push({target:r,reason:"pre-commit hook is not managed by codebaseiq"});return}if(t.dryRun){n.removed.push(r);return}se(o,r,n,()=>({kind:"delete"}))?.changed&&n.removed.push(r)}function Nt(e,t,n={}){let r=(n.inspectReadiness??Lt)(e);if(r.state==="not-configured")return;if(r.state==="blocked"){t.skipped.push({target:"architecture Stop hook",reason:r.reason});return}let o=n.commandPrefix??"codebaseiq";for(let i of M){if(O(e,i)){t.skipped.push({target:i,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}ce(l(e,i),i,t,s=>$t(s,o))}nt(e,t)}function Xe(e,t,n,r){for(let o of M){let i=l(e,o);if(h(i)){if(O(e,o)){n.skipped.push({target:o,reason:"tracked repository config; the checkout-local hook remover will not modify it"});continue}if(t.dryRun){try{let s=et(i);JSON.stringify(r(s))!==JSON.stringify(s)&&n.removed.push(o)}catch(s){n.skipped.push({target:o,reason:y(s)})}continue}ce(i,o,n,r,!0)}}}function Lt(e){let t=_e(e);if(!t.architecture||t.architecture.boundaries.length===0)return{state:"not-configured"};let n=Ee(e,t),r=De(e,t,n);if(r.state!=="fresh")return{state:"blocked",reason:`the index is ${r.state}; refresh it before installing a persistent architecture grader`};let o;try{o=Me(e);let i=Le(Ne(o));return i.length>0?{state:"blocked",reason:`the current architecture baseline has ${i.length} enforced violation(s); make the declared policy clean before installing the Stop hook`}:{state:"ready"}}catch(i){return{state:"blocked",reason:y(i)}}finally{o?.close()}}function $t(e,t="codebaseiq"){let n=C(e.hooks),r=Array.isArray(n.Stop)?n.Stop:[],o={type:"command",command:`${t} ${ie}`,timeout:120,statusMessage:"Checking architecture boundaries"};return{...e,hooks:{...n,Stop:Ye(r,{hook:o},Ze)}}}function or(e,t){return e===ie&&t.sentinel?.enabled===!0}function jt(e){let t=C(e.hooks),n=Array.isArray(t.Stop)?t.Stop:[],r=Ft(n),o={...t};r.length>0?o.Stop=r:delete o.Stop;let i={...e};return Object.keys(o).length>0?i.hooks=o:delete i.hooks,i}function C(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Ft(e){return e.map(t=>({...t,hooks:Array.isArray(t.hooks)?t.hooks.filter(n=>!Ze(n)):[]})).filter(t=>t.hooks.length>0)}function ae(e){return typeof e=="object"&&e!==null&&Array.isArray(e.hooks)}function Ye(e,t,n){let r=!1,o=[];for(let i of e){if(!ae(i)||!i.hooks.some(n)){o.push(i);continue}let s=i.hooks.every(n),c=[],a=!1;for(let d of i.hooks)n(d)?r||(c.push(t.hook),r=!0,a=!0):c.push(d);c.length!==0&&o.push(a&&s?Gt({...i,hooks:c},t.matcher):{...i,hooks:c})}return r||o.push({...t.matcher!==void 0?{matcher:t.matcher}:{},hooks:[t.hook]}),o}function Gt(e,t){let{matcher:n,...r}=e;return t===void 0?r:{matcher:t,...r}}function Ze(e){if(!e||typeof e!="object")return!1;let t=e.command;return typeof t=="string"&&new RegExp(`(?:^|\\s)${ie}$`,"u").test(t)}function ce(e,t,n,r,o=!1){try{A(e,s=>{let c=s.revision.exists?tt(s.text,e):{},a=r(c);return JSON.stringify(a)===JSON.stringify(c)?{kind:"unchanged"}:o&&Object.keys(a).length===0?{kind:"delete"}:{kind:"write",text:`${JSON.stringify(a,null,2)}
12
+ `,mode:384}}).changed?"written"in n?n.written.push(t):n.removed.push(t):o||n.unchanged.push(t)}catch(i){n.skipped.push({target:t,reason:y(i)})}}function et(e){return tt(f(e,"agent hook settings"),e)}function tt(e,t){let n=JSON.parse(e);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`Cannot update ${t}: the hook config is not a JSON object.`);return n}function nt(e,t){let n=B(e,["rev-parse","--git-path","info/exclude"]),r=n?Se(e,n):void 0;if(!r||!h(D(r))){t.skipped.push({target:".git/info/exclude",reason:"Git metadata was not found; local hook files may appear as untracked"});return}let o=Ut(B(e,["rev-parse","--show-prefix"])??"");try{A(r,i=>{let s=new RegExp(`${je}([\\s\\S]*?)${Fe}\\n?`,"gu"),c=[...i.text.matchAll(s)].flatMap(b=>b[1].split(`
13
+ `).filter(wt=>wt!=="")),a=i.text.replace(s,"").replace(/\n*$/u,""),d=[...M,He].map(b=>`/${o}${b}`),p=[je,...new Set([...c,...d]),Fe].join(`
14
+ `),u=`${a}${a?`
15
+
16
+ `:""}${p}
17
+ `;return u===i.text?{kind:"unchanged"}:{kind:"write",text:u,mode:420}})}catch(i){t.skipped.push({target:".git/info/exclude",reason:y(i)})}}function Ut(e){return e.replace(/[\\*?[]/gu,"\\$&")}function y(e){return e instanceof Error?e.message:String(e)}var rt={claude:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",timeout:15,async:!0},{event:"Stop",timeout:30},{event:"SessionEnd",timeout:2}],codex:[{event:"SessionStart",timeout:5},{event:"UserPromptSubmit",timeout:5},{event:"PostToolUse",matcher:"apply_patch|Edit|Write",timeout:15},{event:"Stop",timeout:30}]};function N(e){let t=l(e,"bin");return{directory:t,script:l(t,ze),version:l(t,"sentinel-hook.version"),manifest:l(t,"package.json"),cliPath:l(t,Pt)}}function ot(e={}){let t=Bt(e.packageRoot??D(Wt(import.meta.url)));if(!t)return{state:"skipped",reason:"the codebaseiq package root was not found"};let n=l(t.root,qt);if(!h(n))return{state:"skipped",reason:"build the package first (dist/sentinel-hook.js was not found)"};let r=N(e.cacheRoot??g());try{let o=`${JSON.stringify({name:"codebaseiq",version:t.version,private:!0},null,2)}
18
+ `,i=[P(r.script,K(n,it("sentinel hook bundle"))),P(r.version,Buffer.from(`${t.version}
19
+ `)),P(r.manifest,Buffer.from(o)),P(r.cliPath,Buffer.from(`${oe(t.root,Ot)}
20
+ `))];return{state:"installed",script:r.script,version:t.version,changed:i.some(Boolean)}}catch(o){return{state:"skipped",reason:`the hook binary could not be installed: ${y(o)}`}}}function ir(e,t={}){let n=N(t.cacheRoot??g());if(!(re(n.version,"sentinel hook version")===e&&h(n.cliPath)))return ot(t)}function Bt(e){let t=e;for(;;){try{let r=JSON.parse(f(l(t,"package.json"),"package manifest"));if(r.name==="codebaseiq"&&typeof r.version=="string")return{root:t,version:r.version}}catch{}let n=D(t);if(n===t)return;t=n}}function it(e){return{maxBytes:be,inputKind:e}}function P(e,t){try{if(K(e,it("sentinel hook file")).equals(t))return!1}catch{}return We(e,t),!0}function sr(e,t={}){let n=t.hosts??Je,r=t.cacheRoot??g(),o=ot({packageRoot:t.packageRoot,cacheRoot:r}),i={written:[],unchanged:[],skipped:[],binary:o,notices:[]};if(o.state==="skipped")return i.skipped.push({target:"sentinel hook binary",reason:o.reason}),i;for(let c of n){let a=E[c];if(O(e,a)){i.skipped.push({target:a,reason:"tracked repository config; the checkout-local hook installer will not modify it"});continue}let d=[];ce(l(e,a),a,i,p=>{let u=Jt(p,zt(c,o.script,t.nodeExecutable));return d=Vt(p,u),u}),c==="codex"&&d.length>0&&i.written.includes(a)&&i.notices.push(`Codex must re-approve the changed hooks (${d.join(", ")}): open Codex once in this project and approve them. The approval it recorded for the old command no longer applies, and codebaseiq can only see that an approval exists, not that it still matches.`)}if(nt(e,i),n.map(c=>E[c]).some(c=>i.written.includes(c)||i.unchanged.includes(c)))try{on(r,e)}catch(c){i.skipped.push({target:"sentinel project registry",reason:y(c)})}return i}function Vt(e,t){let n=o=>`${o.event}:${o.group}:${o.index}:${JSON.stringify(o.hook)}`,r=new Set(_(t).map(n));return[...new Set(_(e).filter(o=>!r.has(n(o))).map(o=>o.event))]}function Kt(e,t={}){let n={removed:[],unchanged:[],skipped:[]};return Xe(e,t,n,at),st(e,t,n),n}function ar(e={}){let t=e.cacheRoot??g(),n={removed:[],unchanged:[],skipped:[]};for(let o of rn(t)){if(!h(o)){e.dryRun||pt(t,o);continue}let i=Kt(o,{dryRun:e.dryRun,cacheRoot:t});n.removed.push(...i.removed.map(s=>l(o,s))),n.skipped.push(...i.skipped.map(s=>({...s,target:l(o,s.target)})))}let r=N(t);if(n.skipped.length>0)return h(r.script)&&n.skipped.push({target:r.script,reason:"kept: hooks that run it could not be removed from every project; run uninstall again once they can"}),n;for(let o of[r.script,r.version,r.manifest,r.cliPath])if(h(o)&&(n.removed.push(o),!e.dryRun))try{Et(o)}catch(i){n.skipped.push({target:o,reason:y(i)})}if(!e.dryRun)try{At(r.directory)}catch{}return n}function st(e,t,n){let r=M;if(!(t.dryRun||n.skipped.some(o=>r.includes(o.target))))try{pt(t.cacheRoot??g(),e)}catch(o){n.skipped.push({target:"sentinel project registry",reason:y(o)})}}function H(e){if(!e||typeof e!="object")return!1;let{command:t,args:n}=e;return Array.isArray(n)&&n.includes(R)?!0:typeof t=="string"&&t.split(/\s+/u).includes(R)}function Jt(e,t){let n={...C(e.hooks)};for(let{event:r,...o}of t){let i=n[r];n[r]=Ye(Array.isArray(i)?i:[],o,H)}return{...e,hooks:n}}function at(e){let t=C(e.hooks),n={},r=!1;for(let[i,s]of Object.entries(t)){if(!Array.isArray(s)){n[i]=s;continue}let c=[];for(let a of s){if(!ae(a)||!a.hooks.some(H)){c.push(a);continue}r=!0;let d=a.hooks.filter(p=>!H(p));d.length>0&&c.push({...a,hooks:d})}(c.length>0||s.length===0)&&(n[i]=c)}if(!r)return e;let o={...e};return Object.keys(n).length>0?o.hooks=n:delete o.hooks,o}function zt(e,t,n=process.execPath){return rt[e].map(r=>({event:r.event,...r.matcher!==void 0?{matcher:r.matcher}:{},hook:e==="claude"?Qt(t,r):Xt(t,r,n)}))}function Qt(e,t){return{type:"command",command:"node",args:[e,"--host","claude",...t.async?["--async"]:[],R],...t.async?{async:!0,asyncRewake:!0}:{},timeout:t.timeout}}function Xt(e,t,n){let r=It(n)&&/^node(?:\.exe)?$/iu.test(Ke(n))?n:"node";return{type:"command",command:`${process.platform==="win32"?"& ":""}${Ve(r)} ${Ve(e)} --host codex ${R}`,timeout:t.timeout}}function Ve(e){if((process.platform==="win32"?/["\r\n%$`]/u:/["\r\n$`]/u).test(e))throw new Error(`${JSON.stringify(e)} cannot be quoted in a Codex hook command`);return`"${e}"`}function _(e){let t=[];for(let[n,r]of Object.entries(C(e.hooks)))Array.isArray(r)&&r.forEach((o,i)=>{ae(o)&&o.hooks.forEach((s,c)=>{H(s)&&t.push({event:n,group:i,index:c,hook:s})})});return t}function ct(e){if(h(e))try{return et(e)}catch{return}}function cr(e,t={}){let n=N(t.cacheRoot??g()),r=re(n.version,"sentinel hook version"),o=re(n.cliPath,"sentinel hook CLI path");return{binary:{script:n.script,present:h(n.script),...r?{version:r}:{},...o?{cliTarget:o}:{}},hosts:Je.map(i=>{let s=E[i],c=ct(l(e,s)),a=c?_(c):[],d=rt[i].map(u=>u.event),p=new Set(a.map(u=>u.event));return{host:i,file:s,events:d.filter(u=>p.has(u)),missing:d.filter(u=>!p.has(u)),scripts:[...new Set(a.flatMap(u=>Yt(u.hook)))]}})}}function re(e,t){try{return f(e,t).trim()||void 0}catch{return}}function Yt(e){return(Array.isArray(e.args)?e.args.filter(n=>typeof n=="string"):[...e.command.matchAll(/"([^"]*)"|(\S+)/gu)].map(n=>n[1]??n[2]??"")).filter(n=>Ke(n)===ze)}function dr(e,t={}){let n=l(e,E.codex),r=ct(n),o=r?_(r):[];if(o.length===0)return;let i=l(t.codexHome??process.env.CODEX_HOME??l(Ct(),".codex"),"config.toml"),s=tn(i),c=[...new Set([n,l(k(e),E.codex)])];return{configPath:i,hooks:o.map(({event:a,group:d,index:p})=>{let u=`:${nn(a)}:${d}:${p}`;return{event:a,key:`${n}${u}`,trusted:c.some(b=>s.has(dt(`${b}${u}`)))}})}}var Zt=/^\s*\[hooks\.state\.(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\]\s*(?:#.*)?$/u,en=/^\s*trusted_hash\s*=\s*"sha256:[0-9a-f]+"/u;function tn(e){let t=new Set,n;try{n=f(e,"Codex config")}catch{return t}let r;for(let o of n.split(/\r?\n/u)){let i=Zt.exec(o);i?r=dt(i[1]??(i[2]??"").replace(/\\(["\\])/gu,"$1")):/^\s*\[/u.test(o)?r=void 0:r!==void 0&&en.test(o)&&t.add(r)}return t}function nn(e){return e.replace(/([a-z])([A-Z])/gu,"$1_$2").toLowerCase()}function dt(e){return process.platform==="win32"?e.replaceAll("/","\\").toLowerCase():e}function lr(e){let t={...Pe.delivery};try{let n=JSON.parse(f(l(e,ne,qe),"sentinel settings")).delivery;for(let r of Oe){let o=n?.[r];(o==="shadow"||o==="live")&&(t[r]=o)}}catch{}return t}function de(e){return l(e,ne,Ht)}function rn(e=g()){try{return lt(f(de(e),"sentinel project registry"))}catch{return[]}}function lt(e){try{let{projects:t}=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function ut(e,t){let n=de(e);Rt(D(n),{recursive:!0}),A(n,r=>{let o=t(r.revision.exists?lt(r.text):[]);return o===void 0?{kind:"unchanged"}:{kind:"write",text:`${JSON.stringify({projects:o},null,2)}
21
+ `,mode:384}})}function on(e,t){let n=k(oe(t));ut(e,r=>r.includes(n)?void 0:[...r,n].sort())}function pt(e,t){if(!h(de(e)))return;let n=k(oe(t));ut(e,r=>r.includes(n)?r.filter(o=>o!==n):void 0)}import{spawn as En}from"child_process";import{existsSync as Cn,rmSync as mt}from"fs";import{dirname as In,resolve as U}from"path";import{fileURLToPath as Wn}from"url";import{createHash as sn,randomUUID as ht}from"crypto";import{existsSync as an,linkSync as cn,readdirSync as dn,rmSync as ln}from"fs";import{basename as un,dirname as pn,join as v}from"path";var $=1,hn=10*6e4,kr=10080*6e4,le="requests",fn="claims",mn="completions",gn="staging";function ft(e,t,n={}){let r=n.now?.()??new Date,o=wn(n.ttlMs),i=Rn(n.idempotencyKey),s=i?`key-${sn("sha256").update(i).digest("hex")}`:`request-${(n.randomId??ht)()}`,c={version:$,requestId:s,...i?{idempotencyKey:i}:{},createdAt:r.toISOString(),deadlineAt:new Date(r.getTime()+o).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},a=xn(e,s),d=kn(e,a,c,n.onStage);if(d.published)return{disposition:"accepted",request:c,achievedDurability:d.achievedDurability,directorySync:d.directorySync};let p=ue(a);if(!p)throw new Error(`Watch refresh request identity ${s} exists but is malformed.`);return{disposition:"duplicate",request:p}}function Sr(e){let t=Sn(e),n=new Map,r=bn(v(e,le),ue);for(let a of L(v(e,mn))){let d=vn(a);if(!d){r++;continue}n.set(d.requestId,d)}let o=new Set;for(let a of L(v(e,fn))){let d=yn(a);if(!d){r++;continue}o.add(d.requestId)}let i=t.filter(a=>!n.has(a.requestId)&&!o.has(a.requestId)),s=[...n.values()].filter(a=>a.outcome==="completed").length,c=[...n.values()].filter(a=>a.outcome==="expired").length;return{pending:i.length,claimed:t.filter(a=>!n.has(a.requestId)&&o.has(a.requestId)).length,completed:s,expired:c,invalid:r,...i.length>0?{oldestPendingAt:i.map(a=>a.createdAt).reduce((a,d)=>An(a,d))}:{}}}function ue(e){return pe(e,t=>{let n=t;return n.version===$&&I(n.requestId)&&(n.idempotencyKey===void 0||typeof n.idempotencyKey=="string")&&x(n.createdAt)&&x(n.deadlineAt)&&Date.parse(n.deadlineAt)>=Date.parse(n.createdAt)&&typeof n.detail=="string"&&n.detail.length>0})}function yn(e){return pe(e,t=>{let n=t;return n.version===$&&I(n.requestId)&&I(n.claimId)&&x(n.claimedAt)})}function vn(e){return pe(e,t=>{let n=t;return n.version===$&&I(n.requestId)&&(n.claimId===void 0||I(n.claimId))&&(n.outcome==="completed"||n.outcome==="expired")&&x(n.completedAt)})}function kn(e,t,n,r){let o=v(e,gn),i=pn(t),s=Y(o),c=Y(i),a=v(o,`${un(t)}.${process.pid}.${ht()}.tmp`);try{let d=te(a,n,{spacing:2,trailingNewline:!0});r?.("after-staged");try{cn(a,t)}catch(u){if(u.code==="EEXIST")return{published:!1};throw u}let p=Ae(s,c,d.directorySync,Re(i));return r?.("after-published"),{published:!0,achievedDurability:p==="synced"?"directory-durable":"file-flushed",directorySync:p}}finally{ln(a,{force:!0})}}function Sn(e){let t=[];for(let n of L(v(e,le))){let r=ue(n);r&&t.push(r)}return t}function bn(e,t){return L(e).filter(n=>!t(n)).length}function L(e,t=".json"){return an(e)?dn(e,{withFileTypes:!0}).filter(n=>n.isFile()&&n.name.endsWith(t)).map(n=>v(e,n.name)).sort():[]}function pe(e,t){try{let n=JSON.parse(f(e,"watch refresh request record"));return t(n)?n:null}catch{return null}}function xn(e,t){return v(e,le,`${t}.json`)}function wn(e){if(e===void 0)return hn;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Rn(e){let t=e?.trim();return t?t.slice(0,512):void 0}function I(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function An(e,t){return Date.parse(t)<Date.parse(e)?t:e}var gt=5e3,Tn=6e3,qn=1e3,fe=10,On=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","watch"]);function Lr(e){let t=e.classification;if(t.kind!=="live")return;let{state:n}=t;return n.watcher.state==="idle"&&n.lastError===void 0?n.indexGeneration:void 0}function Pn(e,t=process.env){return t.CODEBASEIQ_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!On.has(e)}function $r(e){let t=e.env??process.env;if(t.CODEBASEIQ_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!Pn(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let n=Hn({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:n.disposition,state:n.state}}catch(n){return{kind:"failed",message:n instanceof Error?n.message:String(n)}}}function kt(e,t,n){let r=k(U(e));if(n&&k(n.projectRoot)===r)return{projectRoot:r,worktreeKind:"git",worktreeId:n.worktreeId,cliVersion:t};let o=ke(r);if(o.kind==="error")throw new Error(`Could not establish Git worktree identity for ${r}: ${o.message}`);return o.kind==="non-git"?{projectRoot:r,worktreeKind:"non-git",cliVersion:t}:{projectRoot:r,worktreeKind:"git",worktreeId:o.identity.worktreeId,cliVersion:t}}function jr(e){return F(e,kt(e.projectRoot,e.cliVersion,e.gitContext))}function F(e,t){let n=e.runtime??ve,r=w(e.cacheDir),o=T(r.statePath),i=ye(r.lockPath);return{identity:t,classification:_n(o,t,n.now(),n.isProcessAlive),lock:i,lockIsLive:i!==null&&n.isProcessAlive(i.pid),paths:r}}function Hn(e){let t=e.runtime??ve,n=kt(e.projectRoot,e.cliVersion,e.gitContext),r=F(e,n),o=me("ensure",r.classification);if(o.kind==="reuse")return j(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} is still alive but its heartbeat is old. Refusing automatic replacement because civil-clock age alone cannot authorize a process signal.`);if(o.kind==="replace")ge(o.state,e,t),W(r.paths,o.state.pid,t);else if(o.kind==="start"){if(r.lockIsLive){let c=yt(e,n,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(c)return j(r.paths.activityPath,t),{disposition:"reused",state:c};throw new Error(`codebaseiq watch is already running for ${U(e.projectRoot)} (pid ${r.lock?.pid}; lock: ${r.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}r.classification.kind==="stale"&&W(r.paths,r.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${o.kind}`);if(r=F(e,n),o=me("ensure",r.classification),o.kind==="reuse")return j(r.paths.activityPath,t),{disposition:"reused",state:o.state};if(o.kind==="refuse-replace")throw new Error(`codebaseiq watch service pid ${o.state.pid} remains alive with an old heartbeat; automatic replacement is not authorized.`);let i=e.serverPath??Wn(new URL("./watch-server.js",import.meta.url));t.spawnServer(i,n.projectRoot,e.cliVersion,e.watchOverrides??{},e.spawnEnv);let s=yt(e,n,t,e.startupTimeoutMs??gt);if(!s)throw new Error(`codebaseiq watch service did not become ready within ${e.startupTimeoutMs??gt}ms.`);return j(r.paths.activityPath,t),{disposition:"started",state:s}}function Fr(e){let t=e.runtime??ve,n=w(e.cacheDir),r=T(n.statePath),o=r?t.isProcessAlive(r.pid)?{kind:"live",state:r}:{kind:"stale",state:r,reason:"dead-process"}:{kind:"stopped"},i=me("stop",o);if(i.kind==="signal-stop")return ge(i.state,e,t),W(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};if(i.kind==="clean-stale")return W(n,i.state.pid,t),{disposition:"stopped",pid:i.state.pid};let s=ye(n.lockPath);return i.kind==="already-stopped"&&s&&t.isProcessAlive(s.pid)?(ge(s,e,t),W(n,s.pid,t),{disposition:"stopped",pid:s.pid}):{disposition:"already-stopped"}}function St(e,t=Date.now()){Te(e,{version:1,at:new Date(t).toISOString()})}function Gr(e,t,n=Date.now(),r={}){ft(w(In(e)).refreshRequestsPath,t,{...r,now:()=>new Date(n)}),St(e,n)}function Ur(e,t,n={}){let r=n.pid??process.pid,o=n.isProcessAlive??V,i=()=>{},s=n.readProcessIdentity??z,c=n.now??(()=>new Date),a={...Z,wallNow:()=>c().getTime(),isProcessAlive:o,readProcessIdentity:s},d=Ce(e,{kind:"watch",pid:r,processIdentity:s(r),detail:{projectRoot:U(t)},parseLegacy:G,runtime:a});if(d.kind==="contended"){let p=bt(d.observation);return{acquired:!1,lockPath:e,message:Dn(e,t,p),release:i}}return{acquired:!0,lockPath:e,message:"",release:()=>{d.lock.release()}}}function ye(e){return bt(ee(e,{parseLegacy:G}))}var G=e=>{let t=xt(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function bt(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return xt(e.parsed)}function xt(e){try{let t=e;if(t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!we(t.startedAt))return null;let n=t.processIdentity===void 0?null:xe(t.processIdentity);return t.processIdentity!==void 0&&(!n||n.pid!==t.pid)?null:{version:1,pid:t.pid,...n?{processIdentity:n}:{},projectRoot:t.projectRoot,startedAt:t.startedAt}}catch{return null}}function _n(e,t,n,r){if(!e)return{kind:"stopped"};if(e.protocolVersion!==Q)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let o=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==o)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!r(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let i=Date.parse(e.heartbeatAt);return n-i>X?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function me(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"refuse-replace",state:t.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return he(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return he(t)}default:return he(e)}}function yt(e,t,n,r){let o=n.monotonicNow??q,i=o()+r;for(;o()<=i;){let s=F(e,t).classification;if(s.kind==="live")return s.state;n.sleep(fe)}return null}function ge(e,t,n){let{pid:r}=e;if(!n.isProcessAlive(r))return;vt(e,n),n.signalProcess(r);let o=t.stopTimeoutMs??Tn,i=n.monotonicNow??q,s=i()+o;for(;i()<=s;){if(!n.isProcessAlive(r))return;n.sleep(fe)}if(!n.forceSignalProcess)throw new Error(`codebaseiq watch service pid ${r} did not stop within ${o}ms and forced termination is unavailable.`);vt(e,n),n.forceSignalProcess(r);let c=t.forceStopTimeoutMs??qn,a=i()+c;for(;i()<=a;){if(!n.isProcessAlive(r))return;let d=n.readProcessIdentity(r);if(e.processIdentity&&d&&!J(e.processIdentity,d))return;n.sleep(fe)}throw new Error(`codebaseiq watch service pid ${r} remained alive ${c}ms after forced termination.`)}function W(e,t,n){if(mt(e.statePath,{force:!0}),mt(e.activityPath,{force:!0}),ye(e.lockPath)?.pid===t&&!n.isProcessAlive(t)){let o={...Z,wallNow:n.now,isProcessAlive:n.isProcessAlive,readProcessIdentity:n.readProcessIdentity},i=ee(e.lockPath,{parseLegacy:G,runtime:o});Ie(e.lockPath,i,{parseLegacy:G,runtime:o})}}function Dn(e,t,n){return`error: codebaseiq watch is already running for ${U(t)}${n?` (pid ${n.pid}, started ${n.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function j(e,t){try{(t.recordActivity??St)(e,t.now())}catch(n){let r=Mn(n);if(r!=="EPERM"&&r!=="EACCES"&&r!=="EROFS")throw n}}function Mn(e){return e.code}var ve={now:Date.now,monotonicNow:q,isProcessAlive:V,readProcessIdentity:z,spawnServer(e,t,n,r,o){if(!Cn(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);En(process.execPath,[e,t,n,JSON.stringify(r)],{detached:!0,stdio:"ignore",windowsHide:!0,env:{...process.env,...o,CODEBASEIQ_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function vt(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its ownership record has no process identity.`);let n=t.readProcessIdentity(e.pid);if(!n)throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity is unavailable.`);if(!J(e.processIdentity,n))throw new Error(`Refusing to signal codebaseiq watch pid ${e.pid}: its process identity does not match the ownership record.`)}function he(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}export{Nn as a,tr as b,nr as c,rr as d,or as e,nt as f,ir as g,sr as h,Kt as i,ar as j,cr as k,dr as l,lr as m,Sr as n,Lr as o,Pn as p,$r as q,jr as r,Hn as s,Fr as t,Gr as u,Ur as v};
22
+ //# sourceMappingURL=chunk-5IC2WZAL.js.map
@@ -1,3 +1,3 @@
1
- import{b as pe,c as ne}from"./chunk-SMRBZ6EC.js";import{f as ee}from"./chunk-JEJLSICM.js";import{c as me}from"./chunk-7FND7D7N.js";import{d as ue,f as fe}from"./chunk-CVYSU6BX.js";import{t as U}from"./chunk-FETNQCFO.js";import{f as Z}from"./chunk-O6QTXQPJ.js";import{v as q}from"./chunk-BMYOV5GP.js";var Le=6;function ge(e,i,l){return`${e}\0${i}\0${l??i}`}function qe(e,i,l,a={}){let s=a.limit??Le;if(!Number.isSafeInteger(s)||s<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${s}`);let m=a.sourceAllowed??(()=>!0),u=new Map(i.nodes.map(t=>[t.id,t])),C=new Set(l.steps.map(t=>t.nodeId)),S=new Set(l.steps.flatMap(t=>{let g=le(u.get(t.nodeId));return g?[g]:[]})),A=new Set;for(let t of l.steps)for(let g of t.behavior?.supportingDeclarations??[])S.add(g.symbol),A.add(ge(g.file,g.line,g.endLine));let y=t=>t.symbol!==null&&S.has(t.symbol)||A.has(ge(t.file,t.line,t.endLine)),I=new Map(l.steps.flatMap(t=>{if(!t.location)return[];let g=le(u.get(t.nodeId));if(!g)return[];let x=U(e,t.location.file).find(_=>_.symbol===g);return x?[[t.id,x]]:[]})),M=new me(e).calleeMap([...I.values()],{additive:!1,semantic:!0}),o=[],f=new Set,V=new Set,T=0,D=0,j=0,$=0,G=0,B=0,r=0,N=0;for(let t of l.steps){if(!t.location||!t.behavior)continue;let g=i.edges.filter(n=>["call","runtime-boundary"].includes(n.kind)&&(n.fromNodeId===t.nodeId||n.toNodeId===t.nodeId)&&n.disposition!=="excluded"&&n.disposition!=="unsupported");for(let n of g){let d=n.toNodeId===t.nodeId,p=d?n.fromNodeId:n.toNodeId;if(C.has(p))continue;let b=u.get(p);if(!b?.location||!m(b.location.file))continue;let L=n.kind==="call"?oe(e,b):ae(b);if(!L||y(L))continue;let h=re(n,b.location.file)??b.location,w=q(e,h.file)[h.line]?.trim(),v=d?"upstream":"downstream",k=n.kind==="runtime-boundary"?d?"runtime-producer":"runtime-consumer":d?"caller":"callee",P=["call"],O=te(n.evidence),Ne=z(b);o.push({anchor:{id:R(t.id,h.line,b.id),status:O,source:"graph-relation",direction:v,causalRole:k,relationKind:n.kind,fromStepId:t.id,fromLabel:t.label,callsite:{file:h.file,line:h.line,endLine:h.endLine??h.line,text:w||`${b.label} \u2192 ${t.label}`,signals:P,calleeLeaf:Ne},alternatives:[L],alternativeCount:1,evidence:n.evidence}}),d&&(B+=1),n.kind==="runtime-boundary"&&(N+=1)}let x=i.edges.filter(n=>n.kind==="reference"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"&&!C.has(n.toNodeId));for(let n of x){let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=oe(e,d);if(!p||y(p))continue;let b=z(d),L=re(n,t.location.file)?.line,h=t.behavior.lines.find(P=>(L===void 0||L>=P.line&&L<=P.endLine)&&P.text.includes(b));if(!h)continue;let w=ye(h.signals),v=w==="result-callback",k=te(n.evidence);o.push({anchor:{id:R(t.id,h.line,d.id),status:k,source:"graph-relation",direction:"downstream",causalRole:w,relationKind:"reference",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:b},alternatives:[p],alternativeCount:1,evidence:n.evidence}}),v&&(r+=1)}let _=ne(e,t.location.file,t.location.line,t.location.endLine??t.location.line),F=q(e,t.location.file),W=ee(e,t.location.file,t.location.line,t.location.endLine??t.location.line);for(let n of _.targets){if(!m(n.definition.relativePath))continue;let d=K(t.location.file,n.sourceLine,n.calleeLeaf);if(f.has(d))continue;f.add(d);let p=ie(W.get(n.sourceLine)),b={symbol:n.definition.symbol,label:n.definition.leaf,file:n.definition.relativePath,line:n.definition.startLine,endLine:n.definition.endLine};y(b)||o.push({anchor:{id:R(t.id,n.sourceLine,n.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:n.sourceLine,endLine:n.sourceLine,text:F[n.sourceLine]?.trim()||`${n.calleeLeaf}()`,signals:p,calleeLeaf:n.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:n.definition.symbol,location:{file:t.location.file,line:n.sourceLine}}]}})}let c=t.behavior.lines.filter(n=>n.signals.includes("call"));if(c.length===0)continue;T+=1;let E=(Z(e,t.location.file)?.callSites??[]).filter(n=>c.some(d=>n.line>=d.line&&n.line<=d.endLine));D+=E.length;let se=i.edges.filter(n=>n.kind==="call"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"),Y=new Map;for(let n of se){let d=u.get(n.toNodeId);if(!d)continue;let p=z(d);Y.set(p,(Y.get(p)??0)+1)}let ce=I.get(t.id),de=Ie(e,ce?M.get(ce.symbolId)??[]:[]),Ae=Ee(de);for(let n of de){if(!m(n.alternative.file)||y(n.alternative))continue;let d=X(n.alternative.label),p=be(E,c,d,n.row.callsiteLine,Ae.get(d)===1);if(!p)continue;let b=H(c,p.line,d);if(!b)continue;let L=K(t.location.file,p.line,d);if(f.has(L))continue;f.add(L);let h=Se(n.row.source);o.push({anchor:{id:R(t.id,p.line,n.alternative.symbol??n.alternative.file),status:h,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:b.line,endLine:b.endLine,text:b.text,signals:b.signals,calleeLeaf:d},alternatives:[n.alternative],alternativeCount:1,evidence:[{method:n.row.source,strength:h,identity:n.row.symbol,location:{file:t.location.file,line:p.line}}]}})}for(let n of se){if(C.has(n.toNodeId))continue;let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=z(d),b=n.evidence.find(P=>{let O=P.location;return O!==null&&O.file===t.location?.file&&O.line>=0})?.location?.line,L=be(E,c,p,b,Y.get(p)===1);if(!L)continue;let h=H(c,L.line,p);if(!h)continue;let w=K(t.location.file,L.line,p);if(f.has(w))continue;f.add(w);let v=ae(d);if(!v||y(v))continue;let k=te(n.evidence);o.push({anchor:{id:R(t.id,L.line,d.id),status:k,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:p},alternatives:[v],alternativeCount:1,evidence:n.evidence}})}for(let n of E){let d=K(t.location.file,n.line,n.calleeLeaf);if(f.has(d))continue;let p=H(c,n.line,n.calleeLeaf);if(!p)continue;let b=ue(t.location.file,fe(e).get(n.calleeLeaf)??[]).flatMap(v=>U(e,v.file).filter(k=>k.symbol===v.symbol&&k.isFunctionLike)).filter(v=>m(v.relativePath)&&!y({symbol:v.symbol,label:v.leaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})),L=Q(b.map(v=>({symbol:v.symbol,label:v.leaf??n.calleeLeaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})));if(L.length===0){G+=1;continue}let h=`${t.id}\0${n.line}\0${n.calleeLeaf}`;if(V.has(h))continue;V.add(h);let w=L.length>1;w?$+=1:j+=1,o.push({anchor:{id:R(t.id,n.line,n.calleeLeaf),status:w?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:p.line,endLine:p.endLine,text:p.text,signals:p.signals,calleeLeaf:n.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}}return Ce(e,o,l.steps,s,{scannedBehaviorSteps:T,visibleCallsites:D,graphEvidencedCallsites:f.size,identityCandidateCallsites:j,ambiguousCallsites:$,unresolvedCallsites:G,upstreamCandidates:B,resultCandidates:r,runtimeCandidates:N},a.selectionTerms)}function Ue(e,i,l){let a=new Map(i.nodes.map(s=>[s.id,s]));for(let s of l.steps)if(!(!s.behavior||!s.location))for(let m of i.edges){if(m.kind!=="reference"||m.fromNodeId!==s.nodeId||m.disposition==="excluded"||m.disposition==="unsupported")continue;let u=a.get(m.toNodeId);if(!u?.location||!oe(e,u))continue;let C=z(u),S=re(m,s.location.file)?.line,A=s.behavior.lines.find(y=>(S===void 0||S>=y.line&&S<=y.endLine)&&y.text.includes(C));!A||ye(A.signals)!=="result-callback"||m.semantics?.some(({family:y,subtype:I})=>y==="control"&&I==="result-callback")||(m.semantics=[...m.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function ye(e){return e.includes("call")&&e.some(i=>["return","mutation","shape","spread","binding"].includes(i))?"result-callback":"callable-reference"}function ze(e,i,l={}){let a=l.limit??Le;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let s=l.sourceAllowed??(()=>!0),m=[],u=i.map((o,f)=>({id:o.id,nodeId:o.id,order:f,role:"anchor",kind:"source-construct",label:o.label,location:{file:o.file,line:o.startLine,endLine:o.endLine},behavior:null})),C=i.map(o=>({file:o.file,startLine:o.startLine,endLine:o.endLine})),S=0,A=0,y=0,I=0,M=0;for(let o of i){let f=q(e,o.file),T=(Z(e,o.file)?.callSites??[]).filter(r=>r.line>=o.startLine&&r.line<=o.endLine);S+=T.length;let D=ee(e,o.file,o.startLine,o.endLine),j=ne(e,o.file,o.startLine,o.endLine),$=new Set;for(let r of j.targets){if(!s(r.definition.relativePath)||C.some(x=>x.file===r.definition.relativePath&&x.startLine<=r.definition.startLine&&x.endLine>=r.definition.endLine))continue;let N=K(o.file,r.sourceLine,r.calleeLeaf);$.add(N);let t=ie(D.get(r.sourceLine)),g={symbol:r.definition.symbol,label:r.definition.leaf,file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine};m.push({anchor:{id:R(o.id,r.sourceLine,r.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:r.sourceLine,endLine:r.sourceLine,text:f[r.sourceLine]?.trim()||`${r.calleeLeaf}()`,signals:t,calleeLeaf:r.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:r.definition.symbol,location:{file:o.file,line:r.sourceLine}}]}})}A+=j.resolvedCallsites;let G=pe(e,o.file,{ranges:[{startLine:o.startLine,endLine:o.endLine}]}),B=new Map;for(let r of G.targets){let N=T.find(x=>x.line===r.line)?.calleeLeaf??r.calleeLeaf,t=K(o.file,r.line,N),g=B.get(t)??[];g.push(r),B.set(t,g)}for(let[r,N]of B){if($.has(r))continue;$.add(r);let t=N.filter(c=>s(c.targetFile)&&!C.some(E=>E.file===c.targetFile&&E.startLine<=c.targetStartLine&&E.endLine>=c.targetEndLine));if(t.length===0)continue;let g=t[0],x=T.find(c=>c.line===g.line)?.calleeLeaf??g.calleeLeaf,_=ie(D.get(g.line)),F=Q(t.map(c=>({symbol:c.targetSymbol??null,label:c.calleeLeaf,file:c.targetFile,line:c.targetStartLine,endLine:c.targetEndLine}))),W=t.some(c=>(c.resolutionAlternativeCount??0)>1)?"candidate":t.every(c=>c.strength==="exact")?"exact":"derived";m.push({anchor:{id:R(o.id,g.line,F.map(c=>`${c.file}:${c.line}`).join("|")),status:F.length>1?"ambiguous":W,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:g.line,endLine:g.line,text:f[g.line]?.trim()||`${g.calleeLeaf}()`,signals:_,calleeLeaf:x},alternatives:F.slice(0,3),alternativeCount:F.length,evidence:t.map(c=>({method:c.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":c.resolution==="factory-callback-member"?"ast-factory-callback-callsite":c.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:W,identity:c.targetSymbol??`${c.targetFile}:${c.targetStartLine}-${c.targetEndLine}`,location:{file:o.file,line:g.line}}))}})}A+=B.size;for(let r of T){let N=K(o.file,r.line,r.calleeLeaf);$.has(N)||(M+=1)}}return Ce(e,m,u,a,{scannedBehaviorSteps:i.length,visibleCallsites:S,graphEvidencedCallsites:A,identityCandidateCallsites:y,ambiguousCallsites:I,unresolvedCallsites:M,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function Ce(e,i,l,a,s,m=[]){let u=ke(i).sort(xe),C=u.filter(f=>we(e,f)).slice(0,a),S=new Set(C.map(f=>f.anchor.id)),A=u.filter(f=>!S.has(f.anchor.id)),y=C.map(f=>f.anchor),I=A.map(f=>f.anchor),M=Q(y.flatMap(f=>f.alternativeCount===1?f.alternatives:[])),o=Q(I.flatMap(f=>f.alternativeCount===1?f.alternatives:[]));return{anchors:y,withheldAnchors:I,candidateAnchors:u.length,omittedAnchors:Math.max(0,u.length-y.length),...s,inspectCommand:M.length===0?null:`codebaseiq inspect ${M.map(ve).join(" ")} --view behavior`,remainingInspectCommands:Me(o,8).map(f=>`codebaseiq inspect ${f.map(ve).join(" ")} --view behavior`)}}function xe(e,i){let l=e.anchor.alternatives[0],a=i.anchor.alternatives[0];return J(e.anchor.status)-J(i.anchor.status)||(e.anchor.direction??"").localeCompare(i.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(i.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(i.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(i.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(i.anchor.callsite.file)||e.anchor.callsite.line-i.anchor.callsite.line||(l?.file??"").localeCompare(a?.file??"")||(l?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(i.anchor.id)}function we(e,i){if(i.anchor.alternativeCount!==1)return!0;let l=i.anchor.alternatives[0],a=l.endLine??l.line;return q(e,l.file).slice(l.line,a+1).join(`
1
+ import{b as pe,c as ne}from"./chunk-FWQGH2N2.js";import{f as ee}from"./chunk-BGGB5N53.js";import{c as me}from"./chunk-HENP2O4A.js";import{d as ue,f as fe}from"./chunk-J7AMBVWF.js";import{t as U}from"./chunk-GVAF222T.js";import{f as Z}from"./chunk-F74LZWCE.js";import{x as q}from"./chunk-7GAK2F3H.js";var Le=6;function ge(e,i,l){return`${e}\0${i}\0${l??i}`}function qe(e,i,l,a={}){let s=a.limit??Le;if(!Number.isSafeInteger(s)||s<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${s}`);let m=a.sourceAllowed??(()=>!0),u=new Map(i.nodes.map(t=>[t.id,t])),C=new Set(l.steps.map(t=>t.nodeId)),S=new Set(l.steps.flatMap(t=>{let g=le(u.get(t.nodeId));return g?[g]:[]})),A=new Set;for(let t of l.steps)for(let g of t.behavior?.supportingDeclarations??[])S.add(g.symbol),A.add(ge(g.file,g.line,g.endLine));let y=t=>t.symbol!==null&&S.has(t.symbol)||A.has(ge(t.file,t.line,t.endLine)),I=new Map(l.steps.flatMap(t=>{if(!t.location)return[];let g=le(u.get(t.nodeId));if(!g)return[];let x=U(e,t.location.file).find(_=>_.symbol===g);return x?[[t.id,x]]:[]})),M=new me(e).calleeMap([...I.values()],{additive:!1,semantic:!0}),o=[],f=new Set,V=new Set,T=0,D=0,j=0,$=0,G=0,B=0,r=0,N=0;for(let t of l.steps){if(!t.location||!t.behavior)continue;let g=i.edges.filter(n=>["call","runtime-boundary"].includes(n.kind)&&(n.fromNodeId===t.nodeId||n.toNodeId===t.nodeId)&&n.disposition!=="excluded"&&n.disposition!=="unsupported");for(let n of g){let d=n.toNodeId===t.nodeId,p=d?n.fromNodeId:n.toNodeId;if(C.has(p))continue;let b=u.get(p);if(!b?.location||!m(b.location.file))continue;let L=n.kind==="call"?oe(e,b):ae(b);if(!L||y(L))continue;let h=re(n,b.location.file)??b.location,w=q(e,h.file)[h.line]?.trim(),v=d?"upstream":"downstream",k=n.kind==="runtime-boundary"?d?"runtime-producer":"runtime-consumer":d?"caller":"callee",P=["call"],O=te(n.evidence),Ne=z(b);o.push({anchor:{id:R(t.id,h.line,b.id),status:O,source:"graph-relation",direction:v,causalRole:k,relationKind:n.kind,fromStepId:t.id,fromLabel:t.label,callsite:{file:h.file,line:h.line,endLine:h.endLine??h.line,text:w||`${b.label} \u2192 ${t.label}`,signals:P,calleeLeaf:Ne},alternatives:[L],alternativeCount:1,evidence:n.evidence}}),d&&(B+=1),n.kind==="runtime-boundary"&&(N+=1)}let x=i.edges.filter(n=>n.kind==="reference"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"&&!C.has(n.toNodeId));for(let n of x){let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=oe(e,d);if(!p||y(p))continue;let b=z(d),L=re(n,t.location.file)?.line,h=t.behavior.lines.find(P=>(L===void 0||L>=P.line&&L<=P.endLine)&&P.text.includes(b));if(!h)continue;let w=ye(h.signals),v=w==="result-callback",k=te(n.evidence);o.push({anchor:{id:R(t.id,h.line,d.id),status:k,source:"graph-relation",direction:"downstream",causalRole:w,relationKind:"reference",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:b},alternatives:[p],alternativeCount:1,evidence:n.evidence}}),v&&(r+=1)}let _=ne(e,t.location.file,t.location.line,t.location.endLine??t.location.line),F=q(e,t.location.file),W=ee(e,t.location.file,t.location.line,t.location.endLine??t.location.line);for(let n of _.targets){if(!m(n.definition.relativePath))continue;let d=K(t.location.file,n.sourceLine,n.calleeLeaf);if(f.has(d))continue;f.add(d);let p=ie(W.get(n.sourceLine)),b={symbol:n.definition.symbol,label:n.definition.leaf,file:n.definition.relativePath,line:n.definition.startLine,endLine:n.definition.endLine};y(b)||o.push({anchor:{id:R(t.id,n.sourceLine,n.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:n.sourceLine,endLine:n.sourceLine,text:F[n.sourceLine]?.trim()||`${n.calleeLeaf}()`,signals:p,calleeLeaf:n.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:n.definition.symbol,location:{file:t.location.file,line:n.sourceLine}}]}})}let c=t.behavior.lines.filter(n=>n.signals.includes("call"));if(c.length===0)continue;T+=1;let E=(Z(e,t.location.file)?.callSites??[]).filter(n=>c.some(d=>n.line>=d.line&&n.line<=d.endLine));D+=E.length;let se=i.edges.filter(n=>n.kind==="call"&&n.fromNodeId===t.nodeId&&n.disposition!=="excluded"&&n.disposition!=="unsupported"),Y=new Map;for(let n of se){let d=u.get(n.toNodeId);if(!d)continue;let p=z(d);Y.set(p,(Y.get(p)??0)+1)}let ce=I.get(t.id),de=Ie(e,ce?M.get(ce.symbolId)??[]:[]),Ae=Ee(de);for(let n of de){if(!m(n.alternative.file)||y(n.alternative))continue;let d=X(n.alternative.label),p=be(E,c,d,n.row.callsiteLine,Ae.get(d)===1);if(!p)continue;let b=H(c,p.line,d);if(!b)continue;let L=K(t.location.file,p.line,d);if(f.has(L))continue;f.add(L);let h=Se(n.row.source);o.push({anchor:{id:R(t.id,p.line,n.alternative.symbol??n.alternative.file),status:h,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:b.line,endLine:b.endLine,text:b.text,signals:b.signals,calleeLeaf:d},alternatives:[n.alternative],alternativeCount:1,evidence:[{method:n.row.source,strength:h,identity:n.row.symbol,location:{file:t.location.file,line:p.line}}]}})}for(let n of se){if(C.has(n.toNodeId))continue;let d=u.get(n.toNodeId);if(!d?.location||!m(d.location.file))continue;let p=z(d),b=n.evidence.find(P=>{let O=P.location;return O!==null&&O.file===t.location?.file&&O.line>=0})?.location?.line,L=be(E,c,p,b,Y.get(p)===1);if(!L)continue;let h=H(c,L.line,p);if(!h)continue;let w=K(t.location.file,L.line,p);if(f.has(w))continue;f.add(w);let v=ae(d);if(!v||y(v))continue;let k=te(n.evidence);o.push({anchor:{id:R(t.id,L.line,d.id),status:k,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:h.line,endLine:h.endLine,text:h.text,signals:h.signals,calleeLeaf:p},alternatives:[v],alternativeCount:1,evidence:n.evidence}})}for(let n of E){let d=K(t.location.file,n.line,n.calleeLeaf);if(f.has(d))continue;let p=H(c,n.line,n.calleeLeaf);if(!p)continue;let b=ue(t.location.file,fe(e).get(n.calleeLeaf)??[]).flatMap(v=>U(e,v.file).filter(k=>k.symbol===v.symbol&&k.isFunctionLike)).filter(v=>m(v.relativePath)&&!y({symbol:v.symbol,label:v.leaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})),L=Q(b.map(v=>({symbol:v.symbol,label:v.leaf??n.calleeLeaf,file:v.relativePath,line:v.startLine,endLine:v.endLine})));if(L.length===0){G+=1;continue}let h=`${t.id}\0${n.line}\0${n.calleeLeaf}`;if(V.has(h))continue;V.add(h);let w=L.length>1;w?$+=1:j+=1,o.push({anchor:{id:R(t.id,n.line,n.calleeLeaf),status:w?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:t.id,fromLabel:t.label,callsite:{file:t.location.file,line:p.line,endLine:p.endLine,text:p.text,signals:p.signals,calleeLeaf:n.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}}return Ce(e,o,l.steps,s,{scannedBehaviorSteps:T,visibleCallsites:D,graphEvidencedCallsites:f.size,identityCandidateCallsites:j,ambiguousCallsites:$,unresolvedCallsites:G,upstreamCandidates:B,resultCandidates:r,runtimeCandidates:N},a.selectionTerms)}function Ue(e,i,l){let a=new Map(i.nodes.map(s=>[s.id,s]));for(let s of l.steps)if(!(!s.behavior||!s.location))for(let m of i.edges){if(m.kind!=="reference"||m.fromNodeId!==s.nodeId||m.disposition==="excluded"||m.disposition==="unsupported")continue;let u=a.get(m.toNodeId);if(!u?.location||!oe(e,u))continue;let C=z(u),S=re(m,s.location.file)?.line,A=s.behavior.lines.find(y=>(S===void 0||S>=y.line&&S<=y.endLine)&&y.text.includes(C));!A||ye(A.signals)!=="result-callback"||m.semantics?.some(({family:y,subtype:I})=>y==="control"&&I==="result-callback")||(m.semantics=[...m.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function ye(e){return e.includes("call")&&e.some(i=>["return","mutation","shape","spread","binding"].includes(i))?"result-callback":"callable-reference"}function ze(e,i,l={}){let a=l.limit??Le;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let s=l.sourceAllowed??(()=>!0),m=[],u=i.map((o,f)=>({id:o.id,nodeId:o.id,order:f,role:"anchor",kind:"source-construct",label:o.label,location:{file:o.file,line:o.startLine,endLine:o.endLine},behavior:null})),C=i.map(o=>({file:o.file,startLine:o.startLine,endLine:o.endLine})),S=0,A=0,y=0,I=0,M=0;for(let o of i){let f=q(e,o.file),T=(Z(e,o.file)?.callSites??[]).filter(r=>r.line>=o.startLine&&r.line<=o.endLine);S+=T.length;let D=ee(e,o.file,o.startLine,o.endLine),j=ne(e,o.file,o.startLine,o.endLine),$=new Set;for(let r of j.targets){if(!s(r.definition.relativePath)||C.some(x=>x.file===r.definition.relativePath&&x.startLine<=r.definition.startLine&&x.endLine>=r.definition.endLine))continue;let N=K(o.file,r.sourceLine,r.calleeLeaf);$.add(N);let t=ie(D.get(r.sourceLine)),g={symbol:r.definition.symbol,label:r.definition.leaf,file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine};m.push({anchor:{id:R(o.id,r.sourceLine,r.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:r.sourceLine,endLine:r.sourceLine,text:f[r.sourceLine]?.trim()||`${r.calleeLeaf}()`,signals:t,calleeLeaf:r.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:r.definition.symbol,location:{file:o.file,line:r.sourceLine}}]}})}A+=j.resolvedCallsites;let G=pe(e,o.file,{ranges:[{startLine:o.startLine,endLine:o.endLine}]}),B=new Map;for(let r of G.targets){let N=T.find(x=>x.line===r.line)?.calleeLeaf??r.calleeLeaf,t=K(o.file,r.line,N),g=B.get(t)??[];g.push(r),B.set(t,g)}for(let[r,N]of B){if($.has(r))continue;$.add(r);let t=N.filter(c=>s(c.targetFile)&&!C.some(E=>E.file===c.targetFile&&E.startLine<=c.targetStartLine&&E.endLine>=c.targetEndLine));if(t.length===0)continue;let g=t[0],x=T.find(c=>c.line===g.line)?.calleeLeaf??g.calleeLeaf,_=ie(D.get(g.line)),F=Q(t.map(c=>({symbol:c.targetSymbol??null,label:c.calleeLeaf,file:c.targetFile,line:c.targetStartLine,endLine:c.targetEndLine}))),W=t.some(c=>(c.resolutionAlternativeCount??0)>1)?"candidate":t.every(c=>c.strength==="exact")?"exact":"derived";m.push({anchor:{id:R(o.id,g.line,F.map(c=>`${c.file}:${c.line}`).join("|")),status:F.length>1?"ambiguous":W,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:o.id,fromLabel:o.label,callsite:{file:o.file,line:g.line,endLine:g.line,text:f[g.line]?.trim()||`${g.calleeLeaf}()`,signals:_,calleeLeaf:x},alternatives:F.slice(0,3),alternativeCount:F.length,evidence:t.map(c=>({method:c.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":c.resolution==="factory-callback-member"?"ast-factory-callback-callsite":c.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:W,identity:c.targetSymbol??`${c.targetFile}:${c.targetStartLine}-${c.targetEndLine}`,location:{file:o.file,line:g.line}}))}})}A+=B.size;for(let r of T){let N=K(o.file,r.line,r.calleeLeaf);$.has(N)||(M+=1)}}return Ce(e,m,u,a,{scannedBehaviorSteps:i.length,visibleCallsites:S,graphEvidencedCallsites:A,identityCandidateCallsites:y,ambiguousCallsites:I,unresolvedCallsites:M,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function Ce(e,i,l,a,s,m=[]){let u=ke(i).sort(xe),C=u.filter(f=>we(e,f)).slice(0,a),S=new Set(C.map(f=>f.anchor.id)),A=u.filter(f=>!S.has(f.anchor.id)),y=C.map(f=>f.anchor),I=A.map(f=>f.anchor),M=Q(y.flatMap(f=>f.alternativeCount===1?f.alternatives:[])),o=Q(I.flatMap(f=>f.alternativeCount===1?f.alternatives:[]));return{anchors:y,withheldAnchors:I,candidateAnchors:u.length,omittedAnchors:Math.max(0,u.length-y.length),...s,inspectCommand:M.length===0?null:`codebaseiq inspect ${M.map(ve).join(" ")} --view behavior`,remainingInspectCommands:Me(o,8).map(f=>`codebaseiq inspect ${f.map(ve).join(" ")} --view behavior`)}}function xe(e,i){let l=e.anchor.alternatives[0],a=i.anchor.alternatives[0];return J(e.anchor.status)-J(i.anchor.status)||(e.anchor.direction??"").localeCompare(i.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(i.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(i.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(i.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(i.anchor.callsite.file)||e.anchor.callsite.line-i.anchor.callsite.line||(l?.file??"").localeCompare(a?.file??"")||(l?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(i.anchor.id)}function we(e,i){if(i.anchor.alternativeCount!==1)return!0;let l=i.anchor.alternatives[0],a=l.endLine??l.line;return q(e,l.file).slice(l.line,a+1).join(`
2
2
  `).length<=2e4}function ie(e){return e?.includes("call")?[...e]:["call",...e??[]]}function Ie(e,i){let l=new Map;for(let a of i){let s=U(e,a.file).find(C=>C.symbol===a.symbol&&C.isFunctionLike);if(!s)continue;let m={symbol:s.symbol,label:s.leaf,file:s.relativePath,line:s.startLine,endLine:s.endLine},u=l.get(s.symbol);!u||he(a.source)>he(u.row.source)?l.set(s.symbol,{row:{...a,...a.callsiteLine===void 0&&u?.row.callsiteLine!==void 0?{callsiteLine:u.row.callsiteLine}:{}},alternative:m}):u.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&l.set(s.symbol,{...u,row:{...u.row,callsiteLine:a.callsiteLine}})}return[...l.values()]}function Ee(e){let i=new Map;for(let l of e){let a=X(l.alternative.label);i.set(a,(i.get(a)??0)+1)}return i}function Se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function he(e){return Se(e)==="exact"?2:1}function H(e,i,l){return e.find(a=>i>=a.line&&i<=a.endLine&&a.text.includes(l))??e.find(a=>i>=a.line&&i<=a.endLine)??null}function be(e,i,l,a,s){if(a!==void 0)return e.find(u=>u.line===a&&u.calleeLeaf===l&&H(i,u.line,l)!==null)??null;let m=e.filter(u=>u.calleeLeaf===l&&H(i,u.line,u.calleeLeaf)!==null);return s&&m.length===1?m[0]:null}function z(e){let i=e.attributes.leaf;if(typeof i=="string"&&i.length>0)return X(i);let l=e.label.slice(e.label.lastIndexOf(":")+1);return X(l)}function X(e){return e.replace(/\(\)$/u,"").replace(/^#/u,"")}function le(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function ae(e){return e.location?{symbol:le(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function oe(e,i){let l=ae(i);return l?.symbol&&U(e,l.file).some(s=>s.symbol===l.symbol&&s.isFunctionLike)?l:null}function re(e,i){return e.evidence.find(l=>l.location?.file===i)?.location??e.evidence.find(l=>l.location!==null)?.location??null}function te(e){let i={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((l,a)=>i[a.strength]>i[l]?a.strength:l,"unknown")}function ke(e){let i=new Map;for(let l of e){let s=l.anchor.alternatives[0]?.symbol??`${l.anchor.callsite.file}:${l.anchor.callsite.line}:${l.anchor.callsite.calleeLeaf}`,m=i.get(s);(!m||Re(l,m)<0)&&i.set(s,l)}return[...i.values()]}function Re(e,i){return J(e.anchor.status)-J(i.anchor.status)||e.anchor.alternativeCount-i.anchor.alternativeCount||xe(e,i)}function J(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function Q(e){let i=new Map;for(let l of e)i.set(l.symbol??`${l.file}:${l.line}`,l);return[...i.values()].sort((l,a)=>l.file.localeCompare(a.file)||l.line-a.line||l.label.localeCompare(a.label))}function ve(e){return`--at ${Te(`${e.file}:${e.line+1}`)}`}function Me(e,i){let l=[];for(let a=0;a<e.length;a+=i)l.push(e.slice(a,a+i));return l}function Te(e){return`'${e.replaceAll("'","'\\''")}'`}function K(e,i,l){return`${e}\0${i}\0${l}`}function R(e,i,l){return["next-anchor",e,String(i),l].map(encodeURIComponent).join(":")}export{qe as a,Ue as b,ze as c};
3
- //# sourceMappingURL=chunk-MVB3DAEY.js.map
3
+ //# sourceMappingURL=chunk-5IZRKWTZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as d,b as m}from"./chunk-IRQOAM5G.js";import{c as u}from"./chunk-NMTSZXCL.js";import{a as c}from"./chunk-NNOKTMZT.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
2
- //# sourceMappingURL=chunk-Q65CQ4XL.js.map
1
+ import{a as d,b as m}from"./chunk-IRQOAM5G.js";import{c as u}from"./chunk-NMTSZXCL.js";import{a as c}from"./chunk-GV2CEZCW.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
2
+ //# sourceMappingURL=chunk-5LL4KEHO.js.map