@testmuai/kane-cli 0.10.3 → 0.10.5

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 (425) hide show
  1. package/dist/ChatSurface-WKYH5MYP.js +2 -0
  2. package/dist/ChromeProfilePicker-ROQIRMWR.js +2 -0
  3. package/dist/{CliFeedbackPrompt-JWCTMIGI.js → CliFeedbackPrompt-55OKAT4W.js} +1 -1
  4. package/dist/{CliUploadProgress-XFRRFRL4.js → CliUploadProgress-NK2U3CKQ.js} +1 -1
  5. package/dist/{ConfigView-6JF4DOJN.js → ConfigView-7A5JTKLF.js} +1 -1
  6. package/dist/EvidenceViewOffer-U7J5ZRVK.js +2 -0
  7. package/dist/FolderPicker-R4QDIFTW.js +2 -0
  8. package/dist/InfoBox-SRQ4TSUT.js +2 -0
  9. package/dist/LinksBox-7BWLLQVR.js +2 -0
  10. package/dist/ProfilesView-TQTJR4WQ.js +2 -0
  11. package/dist/ProjectPicker-A5SXNDUL.js +2 -0
  12. package/dist/SaveSessionPrompt-IECYZMXW.js +2 -0
  13. package/dist/SingleShotApp-MN5IE6EU.js +2 -0
  14. package/dist/SummaryBox-WFOS6GON.js +2 -0
  15. package/dist/TestMdRunView-URNSXIVC.js +2 -0
  16. package/dist/TestrunEvidenceTable-SZPZMW3J.js +2 -0
  17. package/dist/{WhoamiView-H7JNLLCY.js → WhoamiView-G6QP4SID.js} +1 -1
  18. package/dist/{app-client-U2YYF65L.js → app-client-2RR5ATI6.js} +1 -1
  19. package/dist/app-download-UGLDWWTX.js +2 -0
  20. package/dist/{assurance-job-F4L3T4VJ.js → assurance-job-V5QB36WJ.js} +1 -1
  21. package/dist/{binary-K3XMILST.js → binary-32FXH6PQ.js} +1 -1
  22. package/dist/bind-3PB77PWJ.js +2 -0
  23. package/dist/bootstrap-A2O4UZUJ.js +2 -0
  24. package/dist/{bridge-2UHJOVLX.js → bridge-SPGIYAAG.js} +1 -1
  25. package/dist/{catalog-YCU6OHNV.js → catalog-P5IOIVYP.js} +1 -1
  26. package/dist/{catalog-client-MVEEHTG2.js → catalog-client-LR2KPSU7.js} +1 -1
  27. package/dist/{changelog-5UB3AQT6.js → changelog-GKIKDJ32.js} +1 -1
  28. package/dist/chat-committer-7E3TRZ6P.js +2 -0
  29. package/dist/chat-controller-5ZBG23L6.js +2 -0
  30. package/dist/child-MNLSG77W.js +2 -0
  31. package/dist/{chunk-5YYCCM6K.js → chunk-2AHQ3D3D.js} +1 -1
  32. package/dist/{chunk-UWPG5MWM.js → chunk-2EKLTUY2.js} +1 -1
  33. package/dist/{chunk-KL7XFNSD.js → chunk-2G7UYQOW.js} +1 -1
  34. package/dist/{chunk-GXQYFOBD.js → chunk-2MBNAW2G.js} +1 -1
  35. package/dist/{chunk-Y2HQMJGS.js → chunk-2NP3THOE.js} +1 -1
  36. package/dist/chunk-37KFCYHG.js +18 -0
  37. package/dist/{chunk-ZHAMVLQZ.js → chunk-3A4KK22B.js} +1 -1
  38. package/dist/{chunk-L3BUPFAQ.js → chunk-3CFAE36M.js} +1 -1
  39. package/dist/{chunk-TU2KPOW2.js → chunk-3DFBFYTD.js} +2 -2
  40. package/dist/{chunk-QE4AWNOV.js → chunk-3RJRCAUX.js} +6 -6
  41. package/dist/chunk-3UY4WPMQ.js +8 -0
  42. package/dist/{chunk-3NWUXRSI.js → chunk-4DM5EWEV.js} +1 -1
  43. package/dist/{chunk-ZMWTRXFH.js → chunk-4DRFMDAW.js} +1 -1
  44. package/dist/{chunk-PI7OXS62.js → chunk-5EAJO372.js} +1 -1
  45. package/dist/{chunk-4KL3TSTT.js → chunk-5K7PCSTP.js} +4 -4
  46. package/dist/{chunk-HV2CDY4K.js → chunk-5LKDOE3P.js} +1 -1
  47. package/dist/{chunk-AT7AT3AR.js → chunk-5OFHMBZC.js} +5 -5
  48. package/dist/{chunk-CQDCNP7V.js → chunk-5ORBAYTU.js} +1 -1
  49. package/dist/{chunk-2TK4MDF2.js → chunk-63BFLTJI.js} +1 -1
  50. package/dist/{chunk-BBJAKSA7.js → chunk-642GD7E6.js} +2 -2
  51. package/dist/{chunk-KKLCXRW6.js → chunk-642LB5R2.js} +1 -1
  52. package/dist/{chunk-Q4SMITTV.js → chunk-66C5A2F5.js} +1 -1
  53. package/dist/{chunk-X6FCXBXU.js → chunk-6FVGPKVX.js} +1 -1
  54. package/dist/{chunk-32HED7X2.js → chunk-6KUUSONE.js} +1 -1
  55. package/dist/{chunk-6FFX4S7N.js → chunk-6OL5EVRC.js} +1 -1
  56. package/dist/{chunk-SXBPUUQ5.js → chunk-6PZ3SVWE.js} +1 -1
  57. package/dist/{chunk-SJQTTEXQ.js → chunk-6VG2FG67.js} +1 -1
  58. package/dist/chunk-6WN4WSXR.js +2 -0
  59. package/dist/{chunk-CB2BWDHG.js → chunk-76MKY7FG.js} +4 -4
  60. package/dist/{chunk-LRNUGKYH.js → chunk-77BZTEHJ.js} +1 -1
  61. package/dist/chunk-7TSM2FCL.js +5 -0
  62. package/dist/{chunk-KQ4XKTIZ.js → chunk-A5C7HIAH.js} +1 -1
  63. package/dist/{chunk-ENRFXGID.js → chunk-ABAUIIPD.js} +1 -1
  64. package/dist/{chunk-JTNEF5ZP.js → chunk-AL6IAMYV.js} +1 -1
  65. package/dist/{chunk-4CJQ7XZP.js → chunk-AXOSLGQ4.js} +1 -1
  66. package/dist/{chunk-CNHKZE4F.js → chunk-BDZWRJAL.js} +1 -1
  67. package/dist/{chunk-VCVEZEVS.js → chunk-BFRWZPIK.js} +1 -1
  68. package/dist/{chunk-IZ66FKPC.js → chunk-BIGOLVK6.js} +1 -1
  69. package/dist/{chunk-Q4ALB7SH.js → chunk-BLHFNL5K.js} +1 -1
  70. package/dist/chunk-BRWCWZE3.js +2 -0
  71. package/dist/{chunk-X7S7IGCV.js → chunk-BXJNL22L.js} +1 -1
  72. package/dist/chunk-BZEW7CSM.js +3 -0
  73. package/dist/{chunk-Z24SD2EJ.js → chunk-C3DMMAFP.js} +1 -1
  74. package/dist/{chunk-DQXQJJOP.js → chunk-C466XER3.js} +2 -2
  75. package/dist/{chunk-BLVDV3QQ.js → chunk-C4UME2PA.js} +1 -1
  76. package/dist/chunk-CBEMXSWF.js +2 -0
  77. package/dist/{chunk-6QCCTZO3.js → chunk-CBPACEYQ.js} +1 -1
  78. package/dist/{chunk-MD3RABID.js → chunk-CJGQFKLJ.js} +1 -1
  79. package/dist/{chunk-YVVFXBT5.js → chunk-CQBLJTDU.js} +1 -1
  80. package/dist/{chunk-X2MDL6S4.js → chunk-CVVUBCB7.js} +1 -1
  81. package/dist/{chunk-35BG2EMW.js → chunk-E3C4OWSD.js} +1 -1
  82. package/dist/{chunk-ERRIDBE7.js → chunk-EIQSXD7B.js} +1 -1
  83. package/dist/{chunk-YPGZ5E4I.js → chunk-EP4WGGMY.js} +1 -1
  84. package/dist/{chunk-GAKBHNC4.js → chunk-EUGFABAS.js} +1 -1
  85. package/dist/{chunk-HBLHKQR7.js → chunk-F4GWIX66.js} +1 -1
  86. package/dist/{chunk-SALZ6WSF.js → chunk-F4XCCOWC.js} +1 -1
  87. package/dist/{chunk-NHGPMYM3.js → chunk-FHULYIG3.js} +1 -1
  88. package/dist/{chunk-7RELCXRW.js → chunk-FKA5SWWF.js} +1 -1
  89. package/dist/{chunk-OCVDMZWB.js → chunk-FLGOQ6Q6.js} +1 -1
  90. package/dist/{chunk-YILRYMMG.js → chunk-FNBHP75S.js} +1 -1
  91. package/dist/{chunk-JBKHX5ES.js → chunk-FOURJ24E.js} +1 -1
  92. package/dist/{chunk-DC5F2ADJ.js → chunk-FOUUD3LI.js} +1 -1
  93. package/dist/{chunk-IEHJG6J4.js → chunk-FP6JCXOS.js} +1 -1
  94. package/dist/{chunk-ZDCXWEQG.js → chunk-GRQKMOKE.js} +1 -1
  95. package/dist/{chunk-XKOVEMVZ.js → chunk-H23ZMHHC.js} +1 -1
  96. package/dist/{chunk-E4GIGM5V.js → chunk-H6IPGZTP.js} +1 -1
  97. package/dist/{chunk-MINDIQET.js → chunk-HBGYEA3O.js} +1 -1
  98. package/dist/{chunk-KBGMQYMD.js → chunk-HHF7AM3D.js} +1 -1
  99. package/dist/{chunk-PCQK62MP.js → chunk-HTJDMLZS.js} +1 -1
  100. package/dist/{chunk-ZPU3WAC4.js → chunk-HY5BBSYX.js} +1 -1
  101. package/dist/{chunk-TM6VLC6V.js → chunk-IPIARGHE.js} +1 -1
  102. package/dist/{chunk-M2E5CPPV.js → chunk-IPXITNFD.js} +1 -1
  103. package/dist/{chunk-NI3TIAD7.js → chunk-IT6M7OMG.js} +1 -1
  104. package/dist/{chunk-Y3RJHWNK.js → chunk-ITG5WMQG.js} +1 -1
  105. package/dist/{chunk-WEJR2V7R.js → chunk-J3XOEMKO.js} +1 -1
  106. package/dist/{chunk-OHGL4GEJ.js → chunk-J3YID4A5.js} +1 -1
  107. package/dist/{chunk-OCMPWCKQ.js → chunk-J44FV6CH.js} +1 -1
  108. package/dist/{chunk-3MD2XLE7.js → chunk-J5D4IGAM.js} +9 -8
  109. package/dist/{chunk-6QH75BPJ.js → chunk-J5QFO7LW.js} +1 -1
  110. package/dist/{chunk-GJXO6FF7.js → chunk-JBUKEIYL.js} +1 -1
  111. package/dist/{chunk-EJGCIGQY.js → chunk-JGQ3VB44.js} +1 -1
  112. package/dist/{chunk-GEZVC4S3.js → chunk-JM6AKCN4.js} +1 -1
  113. package/dist/{chunk-3KY7HHQU.js → chunk-JSSM2TWY.js} +1 -1
  114. package/dist/{chunk-3ZC7GSMM.js → chunk-JVXEAO62.js} +1 -1
  115. package/dist/{chunk-TM45NPWL.js → chunk-JYH7CTF7.js} +1 -1
  116. package/dist/{chunk-YNDELIXL.js → chunk-JZ7GFPKZ.js} +1 -1
  117. package/dist/{chunk-CTHUX7O4.js → chunk-KUSHV5SR.js} +1 -1
  118. package/dist/{chunk-LTPOMMAB.js → chunk-LB5NIDW6.js} +1 -1
  119. package/dist/{chunk-SIHX5FW5.js → chunk-LJKTIKZY.js} +1 -1
  120. package/dist/{chunk-LPJKNX6D.js → chunk-LMOW4NM5.js} +1 -1
  121. package/dist/{chunk-WIVKLNIO.js → chunk-LPJX5L3F.js} +1 -1
  122. package/dist/{chunk-HRIDAK6Y.js → chunk-LWP7E5FU.js} +1 -1
  123. package/dist/{chunk-YWWVF5OU.js → chunk-LXYXCANZ.js} +1 -1
  124. package/dist/{chunk-35WUYKGO.js → chunk-MAQVRBUQ.js} +1 -1
  125. package/dist/{chunk-NPAUSUNM.js → chunk-MBNSCXVK.js} +1 -1
  126. package/dist/{chunk-ZMIKNNO6.js → chunk-MIQ6J5YG.js} +1 -1
  127. package/dist/chunk-MTMHB5LF.js +2 -0
  128. package/dist/{chunk-RNHSULQM.js → chunk-MUL2QFG2.js} +1 -1
  129. package/dist/{chunk-MEBEVHGP.js → chunk-N4XUGIAK.js} +1 -1
  130. package/dist/{chunk-GQAWZEA4.js → chunk-NAUIJF72.js} +1 -1
  131. package/dist/{chunk-PB6RXDWQ.js → chunk-NFDVDEOH.js} +2 -2
  132. package/dist/{chunk-LHJSIHLC.js → chunk-NGBXXBHP.js} +1 -1
  133. package/dist/{chunk-YCVEI7BT.js → chunk-NIBNVPAE.js} +1 -1
  134. package/dist/chunk-NKJRAQ6L.js +6 -0
  135. package/dist/{chunk-OZNYQONA.js → chunk-NNVHWFLI.js} +3 -3
  136. package/dist/{chunk-7SU53QGU.js → chunk-NZ7UCAN6.js} +1 -1
  137. package/dist/{chunk-7V34ZMMS.js → chunk-OKCVG7AG.js} +1 -1
  138. package/dist/{chunk-LZGAFKYH.js → chunk-OMCJD4LH.js} +1 -1
  139. package/dist/{chunk-VO2NNXKR.js → chunk-OPR5XIPT.js} +1 -1
  140. package/dist/{chunk-EZMRWXRT.js → chunk-OVB5GVRB.js} +1 -1
  141. package/dist/{chunk-LV7224DG.js → chunk-PCL2FYPE.js} +1 -1
  142. package/dist/{chunk-AVLYSNEG.js → chunk-PE3CEG6E.js} +1 -1
  143. package/dist/{chunk-MEMXFTLD.js → chunk-PEHVBCXM.js} +1 -1
  144. package/dist/{chunk-6HRNG4CK.js → chunk-PKXWYYVK.js} +1 -1
  145. package/dist/{chunk-YQZ736IQ.js → chunk-PSBR2LVL.js} +1 -1
  146. package/dist/{chunk-R6TFRAMZ.js → chunk-PUNFWBRW.js} +1 -1
  147. package/dist/{chunk-7Y55CO42.js → chunk-PZOQ2IQK.js} +1 -1
  148. package/dist/{chunk-SMGRXKXX.js → chunk-Q4QCSO6Y.js} +1 -1
  149. package/dist/{chunk-TUSG7DIL.js → chunk-QJ5XHVS5.js} +1 -1
  150. package/dist/{chunk-TAY7J5VS.js → chunk-QLGQDNA3.js} +1 -1
  151. package/dist/{chunk-QEM5ZRDN.js → chunk-QRUAI2ST.js} +1 -1
  152. package/dist/{chunk-C4KAPGBS.js → chunk-QWEQ742S.js} +3 -3
  153. package/dist/{chunk-Z47ZEFH7.js → chunk-R6S4EJ5R.js} +1 -1
  154. package/dist/{chunk-WE7HRAGO.js → chunk-RHQLDNZL.js} +1 -1
  155. package/dist/{chunk-3RO2YGKH.js → chunk-RM5ZVDVR.js} +1 -1
  156. package/dist/{chunk-N7IWR45S.js → chunk-RU3SWHRE.js} +1 -1
  157. package/dist/{chunk-OBNVGD5H.js → chunk-S5UITUBB.js} +1 -1
  158. package/dist/chunk-SACFQNUH.js +47 -0
  159. package/dist/{chunk-X45RZIAJ.js → chunk-SDIHDYWT.js} +1 -1
  160. package/dist/{chunk-AHT2ORJT.js → chunk-SFHDRKUX.js} +1 -1
  161. package/dist/{chunk-OTMHCHH6.js → chunk-SLISNOG6.js} +1 -1
  162. package/dist/{chunk-T77LTLAD.js → chunk-SULRMI2J.js} +1 -1
  163. package/dist/{chunk-OOGKX4Y6.js → chunk-TC2PHBPH.js} +1 -1
  164. package/dist/{chunk-HVOXMCKE.js → chunk-TCK7WR3M.js} +1 -1
  165. package/dist/{chunk-FOLUB336.js → chunk-TFSWG7AS.js} +1 -1
  166. package/dist/{chunk-PRBWZXFA.js → chunk-TOOJTCON.js} +6 -6
  167. package/dist/chunk-TPCW5OU5.js +3 -0
  168. package/dist/chunk-U5V3L5QH.js +2 -0
  169. package/dist/{chunk-LXK4B2FE.js → chunk-UJYC2XDD.js} +1 -1
  170. package/dist/chunk-UV7FPIBL.js +2 -0
  171. package/dist/{chunk-23DKB2MT.js → chunk-UVL6XQHU.js} +1 -1
  172. package/dist/{chunk-M7A66MSK.js → chunk-UWEBI76C.js} +1 -1
  173. package/dist/{chunk-PTLOOVV4.js → chunk-UWQ4KXLB.js} +1 -1
  174. package/dist/{chunk-ZCBOHWN3.js → chunk-V24LUINK.js} +1 -1
  175. package/dist/{chunk-ND6OP3O2.js → chunk-V3IWCGZT.js} +1 -1
  176. package/dist/{chunk-YDB72F4K.js → chunk-V4SL74TK.js} +1 -1
  177. package/dist/chunk-VEE2O524.js +34 -0
  178. package/dist/{chunk-VKVYT6KZ.js → chunk-VJRXJJML.js} +2 -2
  179. package/dist/{chunk-NRAPCFI2.js → chunk-VKIUHHNT.js} +2 -2
  180. package/dist/{chunk-QHH42RH5.js → chunk-W3PQMIXE.js} +1 -1
  181. package/dist/{chunk-LLQWEGXD.js → chunk-W5EDS4DF.js} +1 -1
  182. package/dist/{chunk-LUA25RYS.js → chunk-WAC5WISH.js} +1 -1
  183. package/dist/{chunk-W54BX6HC.js → chunk-WCIRLITM.js} +1 -1
  184. package/dist/chunk-WMXBRC4B.js +21 -0
  185. package/dist/{chunk-RQKMSNEU.js → chunk-WTMCDYR3.js} +1 -1
  186. package/dist/{chunk-DXIQVBMI.js → chunk-WZ3FE5MT.js} +1 -1
  187. package/dist/{chunk-GLM5UGTF.js → chunk-X66NIHT4.js} +1 -1
  188. package/dist/{chunk-B7ZX5HEN.js → chunk-XDAFRUAJ.js} +1 -1
  189. package/dist/{chunk-JNPFEBUR.js → chunk-XDAHKZ4J.js} +1 -1
  190. package/dist/chunk-XJV5SF3X.js +26 -0
  191. package/dist/{chunk-ZCL7XIVS.js → chunk-XKJZG4GR.js} +1 -1
  192. package/dist/{chunk-EBJW6POT.js → chunk-XRJH4UF3.js} +1 -1
  193. package/dist/chunk-XTQUCCJH.js +2 -0
  194. package/dist/chunk-Y3RDLUH5.js +7 -0
  195. package/dist/{chunk-SVIIUKJ2.js → chunk-Y7GSOKXS.js} +1 -1
  196. package/dist/{chunk-UJ37XGSP.js → chunk-YF22VTR5.js} +3 -3
  197. package/dist/chunk-YIBLZIXF.js +13 -0
  198. package/dist/{chunk-2JFRN62I.js → chunk-YLI7DQMJ.js} +2 -2
  199. package/dist/chunk-YQXOD7SV.js +102 -0
  200. package/dist/{chunk-4UX5N7YI.js → chunk-YTWBNACA.js} +1 -1
  201. package/dist/{chunk-KCXLRR3Q.js → chunk-YUFXE6WU.js} +1 -1
  202. package/dist/{chunk-SSOUYKVG.js → chunk-ZIRSTOEV.js} +1 -1
  203. package/dist/command-span-HZSKIZH7.js +2 -0
  204. package/dist/commands-TRAUFCRZ.js +2 -0
  205. package/dist/{committer-UO3B3S5Y.js → committer-L2HXEODA.js} +1 -1
  206. package/dist/{config-7WTZPMAH.js → config-O3BWQUP4.js} +1 -1
  207. package/dist/cover-cmd-SAWVP7TL.js +2 -0
  208. package/dist/{credentials-5WIFF5DG.js → credentials-NNNODDXF.js} +1 -1
  209. package/dist/{deps-bundle-BLLJ2BQ4.js → deps-bundle-CXKBCA7W.js} +1 -1
  210. package/dist/{deps-resolve-WQ6J6RLI.js → deps-resolve-K7XNTRZX.js} +1 -1
  211. package/dist/design-chat-S4KYE6PP.js +2 -0
  212. package/dist/{design-committer-7YIPFKMO.js → design-committer-ZKNW5LUS.js} +1 -1
  213. package/dist/design-headless-DDAFAJNR.js +2 -0
  214. package/dist/design-remote-UITWJ72Q.js +3 -0
  215. package/dist/device-env-SBTHFSVK.js +2 -0
  216. package/dist/dispatch-BGH5PVZ4.js +2 -0
  217. package/dist/doctor-SRMLENYN.js +2 -0
  218. package/dist/{docx-convert-DO5AQYD3.js → docx-convert-PA5S2S7P.js} +1 -1
  219. package/dist/{dossier-5XKNAK6Q.js → dossier-B6KBSRJY.js} +1 -1
  220. package/dist/evidence-FOWW3MOS.js +2 -0
  221. package/dist/evolve-cmd-MDK2H4JY.js +2 -0
  222. package/dist/evolve-remote-4G7YFC5H.js +2 -0
  223. package/dist/exit-manager-UZ7DGXS4.js +2 -0
  224. package/dist/{explain-cmd-KNDORU2D.js → explain-cmd-A5YMPXAJ.js} +1 -1
  225. package/dist/explain-cmd-Q4NLNJFB.js +12 -0
  226. package/dist/explore-MWUMVGRM.js +2 -0
  227. package/dist/explore-context-tty-QLMZGYBX.js +2 -0
  228. package/dist/explore-entry-QMCVGRP4.js +6 -0
  229. package/dist/{explore-live-XIWWUV52.js → explore-live-QIET6WO4.js} +1 -1
  230. package/dist/{explore-run-tty-M56I23IF.js → explore-run-tty-6UTBRCEF.js} +2 -2
  231. package/dist/{extract-bind-LZ22VFKB.js → extract-bind-UTERWZMW.js} +3 -3
  232. package/dist/extract-chat-4WBNRVPG.js +2 -0
  233. package/dist/{extract-cmd-46E2XDWZ.js → extract-cmd-SYZX6CML.js} +2 -2
  234. package/dist/extract-headless-QBF77JWP.js +2 -0
  235. package/dist/{feeder-NGWIPZ26.js → feeder-VAY4NYBX.js} +1 -1
  236. package/dist/folder-flags-IJ556UET.js +2 -0
  237. package/dist/gaps-cmd-E55OGZ7P.js +3 -0
  238. package/dist/gate-5UIJVMHL.js +2 -0
  239. package/dist/gate-VJ7W5QIH.js +2 -0
  240. package/dist/{generate-headless-HXAVEAEZ.js → generate-headless-VYD2QIUO.js} +3 -3
  241. package/dist/hold-passthrough-ZHOC2Q26.js +2 -0
  242. package/dist/identity-66TGWITQ.js +2 -0
  243. package/dist/{impact-cmd-TJTUFAFO.js → impact-cmd-3P6SKFJC.js} +2 -2
  244. package/dist/index.js +185 -184
  245. package/dist/ingest-6UQGSQYU.js +2 -0
  246. package/dist/ingest-cmd-HMTLO5MB.js +8 -0
  247. package/dist/ingest-remote-NIW5VAGW.js +2 -0
  248. package/dist/install-KJDAGU2R.js +2 -0
  249. package/dist/{interactive-bind-SOD7VTAY.js → interactive-bind-K3ZQFHLH.js} +4 -4
  250. package/dist/{interactive-remote-7ZSTI66T.js → interactive-remote-SGM76D6M.js} +2 -2
  251. package/dist/lane-EHU4JRRU.js +2 -0
  252. package/dist/lattice-auth-DCAVEQKY.js +2 -0
  253. package/dist/lifecycle-cmd-Y5DH2PL5.js +2 -0
  254. package/dist/list-cmd-RYHICCUV.js +3 -0
  255. package/dist/list-commands-QFTIQE6Q.js +2 -0
  256. package/dist/{list-remote-EFCET42K.js → list-remote-PWAQBF57.js} +1 -1
  257. package/dist/{locks-cmd-AZKCSGHI.js → locks-cmd-76IU4JB7.js} +1 -1
  258. package/dist/{logical-ids-74PLU3VR.js → logical-ids-YMNV2MDB.js} +1 -1
  259. package/dist/login-flow-W7RAVXSD.js +2 -0
  260. package/dist/maintenance-cmd-JNP2KCSI.js +2 -0
  261. package/dist/mobile-prompts-SP2RULD7.js +2 -0
  262. package/dist/onboarding-YPIKXNYA.js +5 -0
  263. package/dist/open-provider-LXCPVNUU.js +2 -0
  264. package/dist/{pdf-convert-YB6PJFMI.js → pdf-convert-N2C3KB4Q.js} +1 -1
  265. package/dist/persist-recorded-session-BWGA7WXR.js +3 -0
  266. package/dist/phase-seed-G5JSYKSL.js +2 -0
  267. package/dist/pipeline-YE4IRKQX.js +2 -0
  268. package/dist/{policy-commands-4PUGESCW.js → policy-commands-MSJIPHDB.js} +1 -1
  269. package/dist/prepare-target-G7LU4LYX.js +2 -0
  270. package/dist/pull-cmd-G3PVSSFP.js +2 -0
  271. package/dist/pull-route-5JQUUSU7.js +2 -0
  272. package/dist/readmodel-FARAAPUU.js +2 -0
  273. package/dist/real-device-run-425XK527.js +2 -0
  274. package/dist/reconcile-cmd-QJBYZVUB.js +5 -0
  275. package/dist/reconcile-deps-TILDRCHG.js +2 -0
  276. package/dist/{reconcile-remote-3W6ZTO3G.js → reconcile-remote-JMV26DLX.js} +2 -2
  277. package/dist/recording-banner-VZ67EWWQ.js +2 -0
  278. package/dist/registry-3YMKU5GC.js +2 -0
  279. package/dist/remote-entry-6LQRYR5F.js +2 -0
  280. package/dist/remote-mode-35BQUMEL.js +4 -0
  281. package/dist/remote-words-QXVFVHOB.js +2 -0
  282. package/dist/{require-project-folder-3DTI2CVB.js → require-project-folder-O2XCXDRE.js} +1 -1
  283. package/dist/resolve-run-intent-QCRZPYXM.js +2 -0
  284. package/dist/{resolver-CDF7QKVD.js → resolver-LWXOB7PH.js} +1 -1
  285. package/dist/revert-F6MKJ73M.js +2 -0
  286. package/dist/review-cmd-PYU7YCAC.js +5 -0
  287. package/dist/run-EABFRFOF.js +2 -0
  288. package/dist/run-LX3ARF53.js +2 -0
  289. package/dist/run-remote-PS45MTHW.js +2 -0
  290. package/dist/run-startup-gate-YBQB2JLF.js +2 -0
  291. package/dist/run-test-md-XYOCVA6F.js +20 -0
  292. package/dist/session-worker.js +2 -2
  293. package/dist/{sessions-cmd-TLUITRG5.js → sessions-cmd-WUWZYZJW.js} +2 -2
  294. package/dist/{sessions-remote-INO7AWKB.js → sessions-remote-4J7ITZB4.js} +1 -1
  295. package/dist/{skill-installer-7JH5QCJF.js → skill-installer-54ZAFNOB.js} +1 -1
  296. package/dist/store-2F26FIUS.js +2 -0
  297. package/dist/store-choice-ZE7AZMRC.js +2 -0
  298. package/dist/store-guard-X5FIEZWZ.js +2 -0
  299. package/dist/{store-site-K5NHLI7D.js → store-site-AFXB6SBW.js} +1 -1
  300. package/dist/{stream-warnings-GM7YEOVG.js → stream-warnings-I5LUWVFU.js} +1 -1
  301. package/dist/support-id-RISKXA53.js +2 -0
  302. package/dist/sync-cmd-TAVE44DU.js +2 -0
  303. package/dist/sync-setup-M65RX34Y.js +2 -0
  304. package/dist/tcg-generate-OXZF7TNQ.js +2 -0
  305. package/dist/{test-definition-53XNBEDE.js → test-definition-GXEKFRRB.js} +1 -1
  306. package/dist/testmd-actions-4OHRME2Z.js +2 -0
  307. package/dist/{testmd-sync-LYHEXWCT.js → testmd-sync-HM24JCS7.js} +1 -1
  308. package/dist/token-refresh-3SEDPIXO.js +2 -0
  309. package/dist/{use-case-ref-44BPIP4N.js → use-case-ref-E3PJDHQB.js} +1 -1
  310. package/dist/{validate-basic-66XDPA3S.js → validate-basic-HWDR665U.js} +1 -1
  311. package/dist/verdicts-KB6YTIY6.js +2 -0
  312. package/dist/{version-check-SHNVYTMU.js → version-check-DRE5KT7F.js} +1 -1
  313. package/dist/{view-cmd-QOB3O6YW.js → view-cmd-3UKV3YEX.js} +1 -1
  314. package/dist/walk-session-W6OLG5NT.js +2 -0
  315. package/dist/with-telemetry-BF4BGK5S.js +2 -0
  316. package/package.json +11 -11
  317. package/dist/ChatSurface-Z26BOE5U.js +0 -2
  318. package/dist/ChromeProfilePicker-ODRIAXL3.js +0 -2
  319. package/dist/EvidenceViewOffer-6344EX74.js +0 -2
  320. package/dist/FolderPicker-4PCYHE75.js +0 -2
  321. package/dist/InfoBox-NJ2DL7YC.js +0 -2
  322. package/dist/LinksBox-HNDNFVUT.js +0 -2
  323. package/dist/ProfilesView-DEJKJOHY.js +0 -2
  324. package/dist/ProjectPicker-DTWMWOH7.js +0 -2
  325. package/dist/SaveSessionPrompt-3GCLB3ZT.js +0 -2
  326. package/dist/SingleShotApp-HMOXO5DW.js +0 -2
  327. package/dist/SummaryBox-7PPDMSSM.js +0 -2
  328. package/dist/TestMdRunView-QLKRUU4V.js +0 -2
  329. package/dist/TestrunEvidenceTable-T2JUB4TE.js +0 -2
  330. package/dist/app-download-GKRF2EIM.js +0 -2
  331. package/dist/bind-SSHAZAB3.js +0 -2
  332. package/dist/bootstrap-XGKU4WXB.js +0 -2
  333. package/dist/chat-committer-ZKEKJA2R.js +0 -2
  334. package/dist/chat-controller-FXRJXUG3.js +0 -2
  335. package/dist/child-JHYENXE7.js +0 -2
  336. package/dist/chunk-2RBMQTYS.js +0 -26
  337. package/dist/chunk-5F5IVART.js +0 -8
  338. package/dist/chunk-6SD4XTYC.js +0 -6
  339. package/dist/chunk-7YV2FCN4.js +0 -3
  340. package/dist/chunk-A2DODRHG.js +0 -2
  341. package/dist/chunk-BJO6J5X2.js +0 -3
  342. package/dist/chunk-DIOK3SER.js +0 -34
  343. package/dist/chunk-DREQ3RAA.js +0 -2
  344. package/dist/chunk-HC6VLPUB.js +0 -5
  345. package/dist/chunk-J4FIESTB.js +0 -2
  346. package/dist/chunk-NZJSGINB.js +0 -47
  347. package/dist/chunk-SXRHKXSE.js +0 -2
  348. package/dist/chunk-UJLULWSR.js +0 -21
  349. package/dist/chunk-ULIIYKZB.js +0 -7
  350. package/dist/chunk-UXGMKRS4.js +0 -102
  351. package/dist/chunk-VO66KP2W.js +0 -2
  352. package/dist/chunk-X52YIWGG.js +0 -13
  353. package/dist/chunk-ZIHQ5JGB.js +0 -18
  354. package/dist/commands-JBFLLT7A.js +0 -2
  355. package/dist/cover-cmd-DU6ZYJFL.js +0 -2
  356. package/dist/design-chat-ZICGVYIH.js +0 -2
  357. package/dist/design-headless-HYWZIIDS.js +0 -2
  358. package/dist/design-remote-HPX4VZ63.js +0 -3
  359. package/dist/device-env-4P4GUVBW.js +0 -2
  360. package/dist/dispatch-BV6XMCN3.js +0 -2
  361. package/dist/doctor-Z2YQ2DBX.js +0 -2
  362. package/dist/evidence-BJIID6VT.js +0 -2
  363. package/dist/evolve-cmd-GZCUSCEK.js +0 -2
  364. package/dist/evolve-remote-LILOAHYH.js +0 -2
  365. package/dist/exit-manager-EGWAZHCR.js +0 -2
  366. package/dist/explain-cmd-LXIVHGN7.js +0 -12
  367. package/dist/explore-SA2P3SGX.js +0 -2
  368. package/dist/explore-context-tty-PERKIWXD.js +0 -2
  369. package/dist/explore-entry-E6EY3VV3.js +0 -6
  370. package/dist/extract-chat-Z64LEAJ5.js +0 -2
  371. package/dist/extract-headless-XLS56LMN.js +0 -2
  372. package/dist/folder-flags-ZIDJVDKX.js +0 -2
  373. package/dist/gaps-cmd-XYOBJVTO.js +0 -3
  374. package/dist/gate-AK44VDHC.js +0 -2
  375. package/dist/gate-NB5CJMTN.js +0 -2
  376. package/dist/hold-passthrough-JGHWMYDM.js +0 -2
  377. package/dist/identity-HL5CJJXR.js +0 -2
  378. package/dist/ingest-ZHHHBUXR.js +0 -2
  379. package/dist/ingest-cmd-OJSKTSQK.js +0 -8
  380. package/dist/ingest-remote-2WM6PYUW.js +0 -2
  381. package/dist/install-JBWBF3WX.js +0 -2
  382. package/dist/lane-CNGO7LH5.js +0 -2
  383. package/dist/lattice-auth-UQPFQSG7.js +0 -2
  384. package/dist/lifecycle-cmd-DGIO3VAO.js +0 -2
  385. package/dist/list-cmd-HQIN3HX4.js +0 -3
  386. package/dist/list-commands-OFRRBU3D.js +0 -2
  387. package/dist/login-flow-SYKXXDLH.js +0 -2
  388. package/dist/maintenance-cmd-X5247RSJ.js +0 -2
  389. package/dist/mobile-prompts-I66ENBDW.js +0 -2
  390. package/dist/onboarding-6HIP3KW6.js +0 -5
  391. package/dist/open-provider-XDJKT3W3.js +0 -2
  392. package/dist/persist-recorded-session-RSSMTVF3.js +0 -3
  393. package/dist/phase-seed-ZZSJME7M.js +0 -2
  394. package/dist/pipeline-NTJDH5TC.js +0 -2
  395. package/dist/prepare-target-AI3GGZF6.js +0 -2
  396. package/dist/pull-cmd-NRVB5ZN7.js +0 -2
  397. package/dist/pull-route-FWCZW76M.js +0 -2
  398. package/dist/readmodel-TRV4E3MW.js +0 -2
  399. package/dist/real-device-run-NQ7RNH7C.js +0 -2
  400. package/dist/reconcile-cmd-7B7THAFJ.js +0 -5
  401. package/dist/reconcile-deps-UDQBWSLE.js +0 -2
  402. package/dist/recording-banner-WVDTWTSE.js +0 -2
  403. package/dist/registry-PFOSXOIH.js +0 -2
  404. package/dist/remote-entry-BZU4NFNS.js +0 -2
  405. package/dist/remote-mode-NXUKDUXG.js +0 -4
  406. package/dist/remote-words-JRDDNOZ6.js +0 -2
  407. package/dist/resolve-run-intent-QCL7QXIB.js +0 -2
  408. package/dist/revert-QKHPCRT6.js +0 -2
  409. package/dist/review-cmd-XBK3TGRE.js +0 -5
  410. package/dist/run-CSYGVV3D.js +0 -2
  411. package/dist/run-YUHHD54J.js +0 -2
  412. package/dist/run-remote-SFR3F2T5.js +0 -2
  413. package/dist/run-startup-gate-QSFJRYUY.js +0 -2
  414. package/dist/run-test-md-ZSREINDQ.js +0 -20
  415. package/dist/store-X4UK4AP7.js +0 -2
  416. package/dist/store-choice-27HDIFTU.js +0 -2
  417. package/dist/store-guard-ZXKB5DQH.js +0 -2
  418. package/dist/sync-cmd-2PCO7LZA.js +0 -2
  419. package/dist/sync-setup-5WQO73Y5.js +0 -2
  420. package/dist/tcg-generate-DGJD5KSM.js +0 -2
  421. package/dist/testmd-actions-XE2JPQHB.js +0 -2
  422. package/dist/token-refresh-E4FTJVHY.js +0 -2
  423. package/dist/verdicts-PVB7TV5S.js +0 -2
  424. package/dist/walk-session-WIEROYOT.js +0 -2
  425. package/dist/with-telemetry-T2PWI5CY.js +0 -2
@@ -0,0 +1,3 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{N as j,O as we,Q as Re}from"./chunk-NNVHWFLI.js";import"./chunk-PZOQ2IQK.js";import"./chunk-FNBHP75S.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as W,h as D,i as H,k as z,l as ge,m as fe,n as F,o as J,p as q,q as me,r as he}from"./chunk-PEHVBCXM.js";import"./chunk-2EKLTUY2.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import{f as se}from"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import{b as xe,c as _e}from"./chunk-UVL6XQHU.js";import{c as be}from"./chunk-VRIZDOO5.js";import{a as ye}from"./chunk-ZHWU6L2G.js";import{a as U,b as de,c as N,d as pe}from"./chunk-TFSWG7AS.js";import{d as ve}from"./chunk-5ORBAYTU.js";import{T as ae,U as le,vb as ue}from"./chunk-5EAJO372.js";import{c as re,e as oe,g as ie,n as ce}from"./chunk-DBMW3VUN.js";import{f as $,g as G}from"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-BRWCWZE3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";function ke(e){let t=e.byLabel($.USECASE).filter(({cid:u})=>U(e,u)),n=new Map(t.map(({cid:u})=>[u,[]]));for(let{cid:u}of e.byLabel($.AC)){if(!U(e,u))continue;let d=N(e,u),c=d?n.get(d):void 0;c&&c.push({designed:de(e,u),stale:e.stale(u)!=="fresh"})}let s={},i=0,m=0,a=0,f=0,x=new Set;for(let{cid:u}of e.byLabel($.SCENARIO))if(U(e,u))for(let d of e.edgesFrom(u))d.type===G.BELONGS_TO&&x.add(e.tipOf(d.dst));for(let{cid:u}of t){let d=n.get(u);m+=d.length;let c=d.filter(p=>p.designed).length;i+=c;let v=d.filter(p=>p.stale).length,o=x.has(u);o||f++;let l=d.length===0||c===0?"undesigned":c===d.length&&v===0&&o?"complete":"partial";l==="complete"&&a++,s[e.displayNameOf(u)??u]={status:l,staleAcs:v}}return{acs_designed:`${i}/${m}`,usecases_complete:`${a}/${t.length}`,ucs_needing_scenarios:f,perUc:s,config:{criterion:"live_verifies_edge",freshness:"not_discounted"}}}var De={[$.USECASE]:"use case",[$.AC]:"criterion",[$.SCENARIO]:"scenario",[$.TEST]:"test"},X=e=>{let t=ye(e);return t===null?null:t.replace(/\|/g,"/")};function Ne(e,t){let n=e.tipOf(t);return U(e,n)?n:null}function $e(e,t,n){let s=[],i=[...e.heads.entries()].filter(u=>typeof u[1]=="string").sort(([u],[d])=>u<d?-1:u>d?1:0),m=null,a=u=>{if(m===null){m=new Map;for(let{cid:d}of e.byLabel($.AC)){if(!U(e,d))continue;let c=N(e,d);c!==null&&m.set(c,[...m.get(c)??[],d])}}return m.get(u)??[]},f=(u,d)=>{if(d===$.USECASE)return a(u);if(d===$.AC)return[u];let c=d===$.SCENARIO?G.EXERCISES:d===$.TEST?G.VERIFIES:null;return c===null?[]:e.edgesFrom(u).filter(o=>o.type===c).map(o=>Ne(e,o.dst)).filter(o=>o!==null&&e.nodeLabel.get(o)===$.AC)},x=[];for(let u of[$.USECASE,$.AC,$.SCENARIO,$.TEST])for(let{cid:d}of e.byLabel(u)){if(!U(e,d))continue;let c=new Map;for(let v of e.derivesInto(d)){let o=v.props.source_id;typeof o=="string"&&c.set(o,[...c.get(o)??[],v])}c.size>0&&x.push({cid:d,label:u,name:e.displayNameOf(d)??d,bySource:c})}x.sort((u,d)=>u.name<d.name?-1:u.name>d.name?1:0);for(let[u,d]of i){let c=e.mediaOf(d)?.plugin;if(c===void 0||typeof c.index!="string")continue;let v=ce(t(c.index));if(v===null)continue;let o=v.units.filter(_=>_.id!==re),l=o.map(_=>_.id),p=be(t,c,l),g=p===null?l:p.expected,b=new Map((p?.groups??[]).flatMap(_=>_.units.map(S=>[S,_.name]))),h=oe(d,_=>e.mediaOf(_)?.plugin),y=new Map;for(let _ of x){let S=_.bySource.get(u);if(S===void 0)continue;let M=new Set(S.flatMap(T=>Array.isArray(T.props.units)?T.props.units:[]));if(M.size===0)continue;let I=new Set(h===null?M:ie(S,h).failing);for(let T of M)y.set(T,[...y.get(T)??[],{item:_,fresh:!I.has(T)}])}let w=e.extractionCompleteness.get(u),E=w?.source_cid===d&&(w.completeness==="complete"||w.completeness==="partial")?w.completeness:"none",C=new Map(o.map(_=>[_.id,_.label])),r=g.map(_=>{let S=y.get(_)??[],M=[...new Set(S.flatMap(({item:k})=>f(k.cid,k.label)))],I=M.filter(k=>J(e,k).length>0),T=k=>n?.perAc[e.nameOf.get(k)??k]?.state??"not_run",O=I.filter(k=>T(k)==="proven"||T(k)==="failing").length,B=I.filter(k=>T(k)==="proven").length;return{unit:_,cited:S.map(({item:k,fresh:Y})=>({item:k.name,kind:De[k.label],fresh:Y})),criteria:M.length,designed:I.length,run:O,passed:B,gap:S.length===0?"uncited":I.length===0?"untested":null,forPeople:{label:X(C.get(_)),group:X(b.get(_))}}}),R=(p?.groups??[]).map(_=>X(_.name)).filter(_=>_!==null);s.push({sourceId:u,plugin:c.id,units:l.length,plan:p===null?"every":"plugin",expected:g.length,extraction:E,rows:r,forPeople:{groups:R}})}return s}function Q(e){let t=e.flatMap(n=>n.rows);return{expected:t.length,tested:t.filter(n=>n.designed>0).length,proven:t.filter(n=>n.designed>0&&n.passed===n.designed).length}}var We=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate","not-yet-run"],je={failing:"failing",blocked:"blocked","needs-refresh":"needs refresh","needs-tests":"needs tests","needs-scenarios":"needs scenarios","happy-only":"happy path only","possible-duplicate":"possible duplicate","not-yet-run":"not yet run"},P={high:0,med:1,low:2};function A(e){if(!e||/^sha256:/.test(e))return"(unnamed)";let t=/^(uc|ac|sc|t)-(\d+)$/.exec(e);return t?`${t[1].toUpperCase()}-${t[2]}`:e}function Le(e,t=5){let n=e.trim().split(/\s+/);return n.slice(0,t).join(" ")+(n.length>t?"\u2026":"")}function Pe(e,t){let n=e.resolve(t),s=n?e.getNode(e.tipOf(n.cid))?.content:null;return String(s?.title??s?.text??"")}function Ce(e,t){let n=e.resolve(t);return{id:n?e.displayNameOf(e.tipOf(n.cid))??e.displayNameOf(n.cid):null,title:Le(Pe(e,t),8)}}function Fe(e,t){let n=e.resolve(t);if(!n)return null;let s=e.tipOf(n.cid);if(!U(e,s))return null;let i=e.nodeLabel.get(s);if(i===$.USECASE)return s;if(i===$.AC)return N(e,s);if(i===$.TEST){let m=e.edgesFrom(s).find(f=>f.type===G.VERIFIES&&U(e,f.dst));if(m)return N(e,m.dst);let a=e.edgesFrom(s).find(f=>f.type===G.AUTOMATES&&U(e,f.dst));if(a){let f=e.edgesFrom(a.dst).find(x=>x.type===G.BELONGS_TO&&U(e,x.dst));return f?f.dst:null}}return null}function Z(e){if(e.tag==="reuse-candidate"&&e.stage==="design")return"possible-duplicate";switch(e.kind){case"no-verifies":return"needs-tests";case"zero-scenario":return"needs-scenarios";case"happy-only":return"happy-only";case"stale-ac":case"stale-test":return"needs-refresh";case"execution-failed":return"failing";case"execution-blocked":return"blocked";case"covered-not-run":return"not-yet-run";default:return"other"}}function Be(e,t){let n=e.resolve(t),s=n?e.getNode(e.tipOf(n.cid))?.content.risk:null;return s==="high"||s==="med"||s==="low"?s:"med"}function te(e,t,n){let s=new Map;for(let[i,m]of Object.entries(t.perAc)){if(m.state!=="failing"&&m.state!=="not_run")continue;let a=e.resolve(i);if(!a)continue;let f=e.tipOf(a.cid),x=J(e,f);if(m.state==="failing"){let d=c=>q(e,n,f,[c]).some(v=>v.executionId===m.deciding_run&&v.verdict==="failed");s.set(i,{state:"failing",...m.deciding_run?{executionId:m.deciding_run}:{},viaTests:x.filter(d).map(c=>F(e,c))});continue}let u=me(q(e,n,f,x));s.set(i,u?{state:"blocked",executionId:u.executionId,viaTests:[]}:{state:"not_run",viaTests:[]})}return s}function Oe(e,t,n,s,i){let m=i.servePaths??new Map,a=i.work??te(e,s,z(e)),f=s.note!=="nothing_run_yet"||[...a.values()].some(o=>o.state==="blocked"),x=new Map(ge(e).inScope.map(o=>[F(e,o),o])),u=new Map([...x.values()].map(o=>[o,[]])),d=[];for(let o of t){if(o.stage!=="design")continue;let l={...o,...Ce(e,o.ref)},p=Fe(e,o.ref),g=p?u.get(p):void 0;g&&Z(o)!=="other"?g.push(l):d.push(l)}let c=new Map;for(let o of Object.values(s.perAc))o.state!=="not_designed"&&c.set(o.uc,(c.get(o.uc)??0)+1);for(let[o,l]of a){let p=u.get(x.get(s.perAc[o].uc)??"");if(!p)continue;let{id:g,title:b}=Ce(e,o),h={ref:o,id:g,title:b,risk:Be(e,o),stage:"cover"},y=l.executionId!==void 0?m.get(l.executionId):void 0,w={ready_command:y!==void 0?`kane-cli evidence serve ${y}`:"kane-cli testrun run",...l.executionId!==void 0?{execution_id:l.executionId}:{},...y!==void 0?{servePath:y}:{}};l.state==="failing"?p.push({...h,kind:"execution-failed",tag:"evolve",why:"covering test failed against this AC",...w,via_tests:l.viaTests,...i.testFiles?{viaFiles:l.viaTests.map(E=>i.testFiles.get(E)??null)}:{}}):l.state==="blocked"?p.push({...h,kind:"execution-blocked",tag:"reuse-candidate",why:"its test ran, but every run broke or was skipped, so none counts",...w}):f&&p.push({...h,kind:"covered-not-run",tag:"reuse-candidate",why:"a covering test exists but has not run yet",ready_command:"kane-cli testrun run"})}let v=[];for(let o of s.perUc){let l=x.get(o.id);if(l===void 0)continue;let p=n.perUc[o.id]??{status:"undesigned",staleAcs:0},g=u.get(l)??[],b=new Set(g.filter(y=>Z(y)==="needs-refresh").map(y=>y.ref)),h=[];for(let y of We){let w=g.filter(C=>Z(C)===y);if(y==="needs-tests"&&(w=w.filter(C=>!b.has(C.ref))),w.length===0)continue;w.sort((C,r)=>(P[C.risk]??3)-(P[r.risk]??3)||W(C.ref,r.ref));let E=y==="failing"||y==="blocked"||w.length<=2||new Set(w.map(C=>C.ready_command)).size>1;h.push({key:y,label:je[y],...y==="needs-refresh"?{suffix:"source moved since these were designed"}:{},rows:w,...E?{}:{rosterCommand:w[0].ready_command}})}v.push({slug:o.id,title:o.title,risk:o.risk,cov:o,designed:c.get(o.id)??0,des:p,groups:h})}return v.sort((o,l)=>(P[o.risk]??3)-(P[l.risk]??3)||W(o.slug,l.slug)),d.sort((o,l)=>(P[o.risk]??3)-(P[l.risk]??3)||W(o.ref,l.ref)),{stage:i.stage,top:i.top,dc:n,coverage:s,ran:f,ucs:v,other:d,...i.units&&i.units.length>0?{units:i.units}:{}}}function ee(e,t){return e==="all"||t.stage===e}function L(e,t){return e.length<=t?e:t<=1?e.slice(0,t):e.slice(0,t-1)+"\u2026"}var Ye={failing:"failing",blocked:"blocked","needs-refresh":"stale","needs-tests":"needs test","needs-scenarios":"no scenario","happy-only":"happy only","possible-duplicate":"duplicate?","not-yet-run":"to run"},ze=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate"];function Je(e,t,n){return(t.get("failing")??[]).length?0:(t.get("blocked")??[]).length?1:(t.get("needs-tests")??[]).length||(t.get("needs-scenarios")??[]).length?2:(t.get("needs-refresh")??[]).length?3:(t.get("not-yet-run")??[]).length>0||n&&e.cov.state==="not_run"?4:5}function Ue(e,t){let n=new Map;for(let c of t.groups)c.rows.length&&n.set(c.key,c.rows);let s=new Map;for(let c of t.groups){let v=c.rows.filter(o=>ee(e.stage,o));v.length&&s.set(c.key,v)}let i=[],m=[],a=[],f=new Set;for(let c of ze){let v=s.get(c);if(v){for(let o of v){let l=c==="failing"&&o.via_tests?.length?` \xB7 via ${o.via_tests.map(p=>A(p)).join(", ")}`:"";i.push({id:o.ref===t.slug?"\u2014":A(o.id??o.ref),cls:Ye[c],risk:o.ref===t.slug?"\u2014":o.risk,title:(o.ref===t.slug?o.why:o.title)+l})}if(c==="failing"||c==="blocked")for(let o of v)o.servePath&&f.add(`kane-cli evidence serve ${o.servePath}`);for(let o of v)o.ready_command&&!o.ready_command.startsWith("kane-cli evidence serve")&&o.ready_command!=="kane-cli testrun run"&&f.add(o.ready_command)}}let x=[...f].sort((c,v)=>Number(v.startsWith("kane-cli evidence serve"))-Number(c.startsWith("kane-cli evidence serve")));m.push(...x.map(c=>`\u21B3 ${c}`));let u=n.get("not-yet-run")??[],d=e.ran?u.length:t.designed;return e.ran&&d>0&&a.push(`${d} to run`),{uc:t,rows:i,spans:m,tails:a,toRun:d,severity:Je(t,n,e.ran)}}var Ke=e=>`${e} use-case${e===1?"":"s"}`,Ee=e=>`${e} ${e===1?"criterion":"criteria"}`;function Ve(e,t){let n=t!==void 0?`"${t}"'s`:"this folder's",s=e.note==="nothing_run_yet"?" \xB7 nothing run yet":"";return`coverage: ${Math.round(e.pct)}% across ${n} ${Ke(e.usecases.total)}${s} \xB7 ${H(e)} of ${e.usecases.total} designed`}var He={proven:"\x1B[32m",partial:"\x1B[33m",not_run:"\x1B[33m",failing:"\x1B[31m",not_designed:"\x1B[31m",no_criteria:"\x1B[2m"};function Se(e){return`${Math.round(e.pct)}% ${D[e.state]}`}function Ae(e,t){let{dc:n,coverage:s}=e,i=Math.max(80,Math.min(t.width,100)),m=r=>t.color?`\x1B[2m${r}\x1B[22m`:r,a=[Ve(s,t.project)],f=e.units??[];if(f.length>0){let r=Q(f);a.push(`units ${r.tested}/${r.expected} expected units have a test \xB7 ${r.proven} proven`)}a.push("");let x=e.ucs.map(r=>Ue(e,r));x.sort((r,R)=>r.severity-R.severity||W(r.uc.slug,R.uc.slug));let u=x.some(r=>r.rows.length||r.spans.length||r.tails.length||e.ran&&r.toRun>0),d=r=>{let[R,_]=r.split("/").map(Number);return _>0&&R===_},c=s.criteria.total>0&&s.criteria.proven===s.criteria.total,v=f.some(r=>r.rows.some(R=>R.gap!==null));if(!u&&!v&&d(n.acs_designed)&&(!e.ran||c)){let r=e.ucs.length,R=`use-case${r===1?"":"s"}`;return a.push(e.ran?`no gaps \u2014 all ${r} ${R} designed and proven`:`no gaps \u2014 all ${r} ${R} designed \xB7 nothing run yet`),f.length>0&&a.push("",...K(f,i)),a.push(m("inspect a use-case: kane-cli cover gaps <uc-id>")),a}let o=(r,R)=>r.groups.filter(_=>R.includes(_.key)).reduce((_,S)=>_+S.rows.length,0),l=x.map(r=>({band:r,failing:o(r.uc,["failing"]),blocked:o(r.uc,["blocked"]),stale:o(r.uc,["needs-refresh"]),design:o(r.uc,["needs-tests","needs-scenarios"]),run:r.toRun})),p=[];l.some(r=>r.failing)&&p.push({hdr:"FAILING",get:r=>r.failing}),l.some(r=>r.blocked)&&p.push({hdr:"BLOCKED",get:r=>r.blocked}),l.some(r=>r.stale)&&p.push({hdr:"STALE",get:r=>r.stale}),l.some(r=>r.design)&&p.push({hdr:"TO DESIGN",get:r=>r.design}),l.some(r=>r.run)&&p.push({hdr:"TO RUN",get:r=>r.run}),i<100&&(p.length=0);let g=r=>r.cov.criteria===0?"\u2014":`${r.designed} of ${r.cov.criteria}`,b=Math.min(16,Math.max(4,...x.map(r=>A(r.uc.slug).length))),h=Math.max(8,...x.map(r=>g(r.uc).length)),y=Math.max(8,...x.map(r=>Se(r.uc.cov).length)),w=p.map(r=>r.hdr.length+2),E=i-b-2-3-h-3-y-w.reduce((r,R)=>r+R,0)-2,C=`${" ".repeat(b+2)}${"USE CASE".padEnd(E+3)}${"DESIGNED".padEnd(h)} ${"COVERAGE".padEnd(y)}`+p.map((r,R)=>r.hdr.padStart(w[R])).join("");a.push(m(C.trimEnd().slice(0,i)));for(let r of l){let R=r.band.uc,_=Se(R.cov).padEnd(y),S=t.color?`${He[R.cov.state]}${_}${R.cov.state==="no_criteria"?"\x1B[22m":"\x1B[39m"}`:_,M=p.map((I,T)=>String(I.get(r)||"\u2014").padStart(w[T])).join("");a.push(`${L(A(R.slug),b).padEnd(b)} ${L(R.title,E).padEnd(E)} ${g(R).padEnd(h)} ${S}${M}`)}return a.push(""),f.length>0&&a.push(...K(f,i)),a.push(m("inspect a use-case: kane-cli cover gaps <uc-id>")),a}var Me=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function qe(e){let t=e.cited.map(n=>`${A(n.item)} (${n.fresh?"fresh":"stale"})`).join(", ");return e.gap==="uncited"?"no test \xB7 no use case cites this unit":e.gap==="untested"?`no test \xB7 cited by ${t}; no test verifies it`:`${Me(e.criteria,"criterion","criteria")} \xB7 ${e.designed} designed \xB7 ${e.run} run \xB7 ${e.passed} passed \xB7 cited by ${t}`}function K(e,t){let n=[];for(let s of e){let i=s.rows.filter(c=>c.designed>0).length,m=s.extraction==="none"?"no extraction recorded for this version":`this version's extraction is recorded ${s.extraction}`;n.push(L(`units of ${s.sourceId} (plugin ${s.plugin}) \xB7 ${i}/${s.expected} expected units have a test`,t)),n.push(` ${m}`),s.plan==="every"?n.push(" every unit is expected: the plugin gives no coverage plan"):s.expected<s.units&&n.push(` the plugin ${s.plugin} expects tests for ${s.expected} of ${Me(s.units,"unit")}`);let a=Math.min(24,Math.max(4,...s.rows.map(c=>c.unit.length))),f=Math.min(40,Math.max(0,...s.rows.map(c=>(c.forPeople.label??"").length))),x=(c,v)=>`${v}${L(c.unit,a).padEnd(a)} ${f>0?`${L(c.forPeople.label??"",f).padEnd(f)} `:""}${qe(c)}`,u=new Map(s.forPeople.groups.map(c=>[c,[]])),d=[];for(let c of s.rows)c.forPeople.group===null?d.push(c):u.set(c.forPeople.group,[...u.get(c.forPeople.group)??[],c]);for(let[c,v]of u)if(v.length!==0){n.push(L(` ${c}`,t));for(let o of v)n.push(x(o," "))}for(let c of d)n.push(x(c,u.size>0?" ":" "));n.push("")}return n}function Ie(e,t,n,s){let i=Math.max(80,Math.min(s.width,100)),m=l=>s.color?`\x1B[2m${l}\x1B[22m`:l,a=[],f=e.ucs.find(l=>l.slug===t);a.push(f?`${A(t)} "${f.title}": ${Math.round(f.cov.pct)}%, ${D[f.cov.state]}`:A(t));let x=Math.min(16,Math.max(4,...n.map(l=>A(l.id).length))),u=Math.max(0,...n.map(l=>l.state.length)),d=Math.min(Math.max(20,i-2-x-2-2-u),Math.max(0,...n.map(l=>l.text.length))),c=l=>{if(!s.color)return l;let p=l==="proven"?"\x1B[32m":l==="failing"||l==="not designed"?"\x1B[31m":"\x1B[2m";return`${p}${l}${p==="\x1B[2m"?"\x1B[22m":"\x1B[39m"}`};for(let l of n){let p=[],g="";for(let b of l.text.split(/\s+/))g&&g.length+1+b.length>d?(p.push(g),g=b):g=g?`${g} ${b}`:b;p.push(g),p.forEach((b,h)=>{h===0?a.push(` ${L(A(l.id),x).padEnd(x)} ${b.padEnd(d)} ${c(l.state)}`):a.push(` ${" ".repeat(x+2)}${b}`)})}let v=[],o=f?Ue(e,f):null;if(o){for(let p of o.spans){let g=p.replace(/^↳ /,"");if(g.startsWith("kane-cli evidence serve")){let b=n.filter(h=>h.blocked||h.state===D.failing).map(h=>A(h.id)).join(" \xB7 ");v.push({label:"see why",cmd:g,...b?{note:`(explains ${b})`}:{}})}else v.push({label:"design",cmd:g})}let l=n.filter(p=>p.state===D.not_run&&!p.blocked).length;if(l>0){let g=n.some(b=>b.state===D.failing)?"(review evidence first \u2014 a re-run may heal over failures)":v.some(b=>b.label==="see why")?`(${Ee(l)} not run \u2014 see why first)`:`(${Ee(l)} not run)`;v.push({label:"first run",cmd:"kane-cli testrun run",note:g})}}if(v.length){a.push(""),a.push("next");let l=Math.max(...v.map(g=>g.label.length))+2,p=g=>s.color?`\x1B[36m${g}\x1B[39m`:g;for(let g of v){let b=` ${g.label.padEnd(l)}`;if(b.length+g.cmd.length>i){let h=g.cmd.lastIndexOf(" ",i-b.length),y=h>0?g.cmd.slice(0,h):g.cmd.slice(0,i-b.length),w=h>0?g.cmd.slice(h+1):g.cmd.slice(i-b.length);a.push(`${b}${p(y)}`),a.push(`${" ".repeat(b.length)}${p(w)}`),g.note&&a.push(m(`${" ".repeat(b.length)}${g.note}`))}else g.note&&b.length+g.cmd.length+3+g.note.length<=i?a.push(`${b}${p(g.cmd)} ${m(g.note)}`):(a.push(`${b}${p(g.cmd)}`),g.note&&a.push(m(`${" ".repeat(b.length)}${g.note}`)))}}return a.push(""),a.push(m("all use-cases: kane-cli cover gaps")),a}function ne(e){let{dc:t,coverage:n}=e,s=i=>e.top!==void 0?i.slice(0,e.top):i;return{stage:e.stage,rollup_version:2,coverage:{pct:n.pct,usecases:n.usecases,criteria:n.criteria,...n.note?{note:n.note}:{}},designed:{usecases:H(n),of:n.usecases.total},design_completeness:{acs_designed:t.acs_designed,usecases_complete:t.usecases_complete,ucs_needing_scenarios:t.ucs_needing_scenarios,config:t.config},usecases:e.ucs.map(i=>({id:/^sha256:/.test(i.slug)?null:i.slug,title:i.title,risk:i.risk,coverage:{pct:i.cov.pct,state:i.cov.state,criteria:i.cov.criteria,proven:i.cov.proven},designed:{criteria:i.designed,of:i.cov.criteria},design_completeness:{status:i.des.status},stale_acs:i.des.staleAcs,pending:s(i.groups.flatMap(m=>m.rows).filter(m=>ee(e.stage,m))).map(Te)})),other:e.other.filter(i=>ee(e.stage,i)).map(Te),...e.units&&e.units.length>0?{units:Xe(e.units)}:{}}}function Xe(e){return{rollup:Q(e),sources:e.map(t=>{let n=new Map(t.forPeople.groups.map((s,i)=>[s,i+1]));return{source_id:t.sourceId,plugin:t.plugin,units:t.units,plan:t.plan,expected:t.expected,extraction:t.extraction,rows:t.rows.map(s=>({unit:s.unit,group:s.forPeople.group===null?null:n.get(s.forPeople.group),criteria:s.criteria,designed:s.designed,run:s.run,passed:s.passed,gap:s.gap,cited:s.cited.map(i=>({item:i.item,kind:i.kind,fresh:i.fresh}))}))}})}}function Te(e){let{servePath:t,viaFiles:n,meta:s,...i}=e;return{...i}}var V="--rollup no longer changes the figure, and goes in a later release";async function Qe(e,t,n=Re(),s=process.cwd()){if(t.mode!==void 0&&t.mode!=="agent"&&t.mode!=="ci"&&t.mode!=="interactive")return j(n,`--mode must be interactive | agent | ci, got '${t.mode}'`),2;if(t.mode==="agent"||t.mode==="ci"){let{makeHeadlessIO:h,agentRefusal:y}=await import("./headless-io-FFM5T6KL.js"),{parsesAgainstGrammar:w}=await import("./next-O6SUSX3R.js"),E=h("ndjson","gaps",{stdout:O=>n.out(O.replace(/\n$/,"")),stderr:O=>(n.err??n.out)(O.replace(/\n$/,""))}),C=[],r=[],R={out:O=>C.push(O),err:O=>r.push(O),confirm:async()=>!1,isTTY:!1};if(await Qe(e,{...t,json:!0,mode:void 0},R,s)!==0)return y(E,r.join("; ")||"cover gaps refused");let S=JSON.parse(C.join(`
3
+ `));t.rollup!==void 0&&E.event({type:"warning",code:"ROLLUP_IGNORED",message:V}),E.event({type:"gaps",...S});let M=[],I=new Set,T=(O,B)=>{if(Array.isArray(O)){for(let k of O)T(k,B);return}if(O&&typeof O=="object"){let k=O,Y=typeof k.why=="string"?k.why:B;typeof k.ready_command=="string"&&k.ready_command.startsWith("kane-cli ")&&w(k.ready_command)&&!I.has(k.ready_command)&&(I.add(k.ready_command),M.push({cmd:k.ready_command,why:Y||"close the gap"}));for(let Ge of Object.values(k))T(Ge,Y)}};return T(S,"close the gap"),E.done(0,void 0,M.slice(0,4))}let i=t.stage??"all";if(i!=="design"&&i!=="cover"&&i!=="all")return j(n,`--stage must be design | cover | all, got '${i}'`),2;if(t.top!==void 0&&(!Number.isInteger(t.top)||t.top<1))return j(n,"--top must be a positive integer"),2;if(t.rollup!==void 0&&t.rollup!=="lenient"&&t.rollup!=="strict")return j(n,`--rollup must be lenient | strict, got '${t.rollup}'`),2;let m=we(s,n);if(!m)return 2;let a=ue(m);if(e!==void 0){let h=le(a,e);if(h!==null)return j(n,h),2;e=ae(a,e)}let f=ke(a),x=z(a),u=he({graph:a,runs:x}),d=te(a,u,x),c=await pe(a,"design"),v=new Map;for(let h of d.values()){if(!h.executionId||v.has(h.executionId))continue;let y=await se(h.executionId,s);y&&v.set(h.executionId,Ze(y,s))}let o=new Map;for(let[h,y]of _e(xe(s)))y.length===1&&o.set(h,y[0].split("/").pop());let l=$e(a,h=>ve(m,h),u),p=Oe(a,c,f,u,{stage:i,top:t.top,servePaths:v,testFiles:o,work:d,units:l}),g=()=>{t.rollup!==void 0&&(t.json?n.err?.(`note: ${V}`):n.out(n.isTTY?`\x1B[2mnote: ${V}\x1B[22m`:`note: ${V}`))};if(e!==void 0){let h=a.resolve(e),y=h?a.tipOf(h.cid):null;if(!y||a.nodeLabel.get(y)!==$.USECASE||!U(a,y))return j(n,`no use-case '${e}' in the graph`),2;let w=a.displayNameOf(y)??y;if(g(),t.json){let r=ne(p);return n.out(JSON.stringify({...r,usecases:r.usecases.filter(R=>R.id===w),other:[]},null,2)),0}if(!p.ucs.some(r=>r.slug===w)){let r=String(a.getNode(y)?.content.title??"");return n.out(`${A(w)} "${r}" isn't counted: every source it came from was removed`),n.out(""),n.out(n.isTTY?"\x1B[2mall use-cases: kane-cli cover gaps\x1B[22m":"all use-cases: kane-cli cover gaps"),0}let E=et(a,y,u,d),C=n.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let r of Ie(p,w,E,{width:C,color:n.isTTY}))n.out(r);return 0}if(g(),t.json)return n.out(JSON.stringify(ne(p),null,2)),0;if(u.usecases.total===0){if(n.out("nothing to measure yet \u2014 no live use-cases in the graph"),l.length>0)for(let h of["",...K(l,100)].slice(0,-1))n.out(h);return 0}let b=n.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let h of Ae(p,{width:b,color:n.isTTY}))n.out(h);return 0}function Ze(e,t){let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)?e.slice(n.length):e}function et(e,t,n,s){let i=[];for(let m of fe(e,new Set([t])).get(t)??[]){let a=F(e,m),f=e.getNode(m)?.content??{};i.push({id:a,state:D[n.perAc[a]?.state??"not_designed"],text:String(f.text??f.title??""),...s.get(a)?.state==="blocked"?{blocked:!0}:{}})}return i.sort((m,a)=>W(m.id,a.id)),i}export{Qe as gapsCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-AXOSLGQ4.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-REKHAN53.js";import"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-FOJHSG5M.js";import"./chunk-UR6MHSHU.js";export{d as ASSURANCE_GROUPS,b as ONBOARDING_VERBS,a as REMOTE_VERBS,c as TEST_RUN_VERBS,m as agentAsked,h as answerGate,n as installRemoteGate,i as linkedAnswerRefused,j as linkedLines,k as printPair,g as printReadFailure,f as printRefusal,e as remoteGate,l as wrap};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{h as a,i as b,j as c}from"./chunk-LB5NIDW6.js";import"./chunk-H6IPGZTP.js";import"./chunk-LD5B3QFW.js";import"./chunk-3A4KK22B.js";import"./chunk-ZCIWQHCO.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-YJAQZMJT.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{a as designFactFor,c as designGate,b as designedState};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p as z,r as O,s as C,t as _,u as K,v as J}from"./chunk-OBNVGD5H.js";import{a as k}from"./chunk-Q4SMITTV.js";import{d as x}from"./chunk-ZIHQ5JGB.js";import"./chunk-72KYMWQ5.js";import"./chunk-CCOD4GQJ.js";import"./chunk-JQ64X2TO.js";import"./chunk-ULIIYKZB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-X45RZIAJ.js";import{b as A}from"./chunk-LV7224DG.js";import{h as H}from"./chunk-BBJAKSA7.js";import"./chunk-VE3SUJMA.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SB26HQO7.js";import"./chunk-C4KAPGBS.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-NRAPCFI2.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-KCXLRR3Q.js";import"./chunk-PCQK62MP.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-TD6GCEIK.js";import"./chunk-PVN64537.js";import{d as T}from"./chunk-Z47ZEFH7.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-GMTHZUZ3.js";import{n as E,o as q}from"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import{a as R}from"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import{a as j}from"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{join as se}from"path";async function V(t){let e=t.projectId,n=t.folderId,r=null;if(!e&&t.autoResolve){let l=await t.resolver.resolve();if(!l)throw new G("unauthorized; run `kane-cli login`");let u=await H({creds:t.autoResolve.creds,config:t.autoResolve.config,profile:t.autoResolve.profile,env:t.autoResolve.envName,tmsCreds:{username:l.username,access_key:l.access_key},isLocal:!1,log:t.log});u.status==="ok"&&(e=u.projectId,n=n??u.folderId,u.autoDefaulted&&(r={projectId:u.autoDefaulted.projectId,projectName:u.autoDefaulted.projectName,folderId:u.autoDefaulted.folderId,folderName:u.autoDefaulted.folderName}))}return{baseUrl:`${t.env.testGeneratorBaseUrl}/test-generator/api/v2`,tmsBaseUrl:t.env.tmsBaseUrl,authResolver:t.resolver,projectId:e,folderId:n,suiteName:t.suiteName,autoDefaulted:r,log:t.log}}function Z(t){return t.reduce((e,n)=>e+(n.test_cases?.length??0),0)}var y=class{constructor(e=n=>process.stdout.write(n)){this.write=e}emit(e){this.write(JSON.stringify(e)+`
2
+ import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p as z,r as O,s as C,t as _,u as K,v as J}from"./chunk-S5UITUBB.js";import{a as k}from"./chunk-66C5A2F5.js";import"./chunk-Y3RDLUH5.js";import{d as x}from"./chunk-37KFCYHG.js";import"./chunk-72KYMWQ5.js";import"./chunk-CCOD4GQJ.js";import"./chunk-JQ64X2TO.js";import"./chunk-TDPWFYTJ.js";import"./chunk-SDIHDYWT.js";import{b as A}from"./chunk-PCL2FYPE.js";import{h as H}from"./chunk-642GD7E6.js";import"./chunk-VE3SUJMA.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SB26HQO7.js";import"./chunk-YUFXE6WU.js";import"./chunk-HTJDMLZS.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-QWEQ742S.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-VKIUHHNT.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-TD6GCEIK.js";import"./chunk-PVN64537.js";import{d as T}from"./chunk-R6S4EJ5R.js";import"./chunk-UV7FPIBL.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-4QTH7VYE.js";import"./chunk-GMTHZUZ3.js";import{a as q}from"./chunk-V24LUINK.js";import{a as E}from"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import{m as j,n as R}from"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{join as se}from"path";async function V(t){let e=t.projectId,n=t.folderId,r=null;if(!e&&t.autoResolve){let l=await t.resolver.resolve();if(!l)throw new G("unauthorized; run `kane-cli login`");let u=await H({creds:t.autoResolve.creds,config:t.autoResolve.config,profile:t.autoResolve.profile,env:t.autoResolve.envName,tmsCreds:{username:l.username,access_key:l.access_key},isLocal:!1,log:t.log});u.status==="ok"&&(e=u.projectId,n=n??u.folderId,u.autoDefaulted&&(r={projectId:u.autoDefaulted.projectId,projectName:u.autoDefaulted.projectName,folderId:u.autoDefaulted.folderId,folderName:u.autoDefaulted.folderName}))}return{baseUrl:`${t.env.testGeneratorBaseUrl}/test-generator/api/v2`,tmsBaseUrl:t.env.tmsBaseUrl,authResolver:t.resolver,projectId:e,folderId:n,suiteName:t.suiteName,autoDefaulted:r,log:t.log}}function Z(t){return t.reduce((e,n)=>e+(n.test_cases?.length??0),0)}var y=class{constructor(e=n=>process.stdout.write(n)){this.write=e}emit(e){this.write(JSON.stringify(e)+`
3
3
  `)}onStart(e){this.emit({type:"generate_start",request_id:e.requestId,objective_chars:e.objectiveChars,scenario_limit:e.scenarioLimit,per_scenario_limit:e.perScenarioLimit,is_refine:e.isRefine})}onUpload(e){this.emit({type:"generate_upload",file:e.file,index:e.index,total:e.total,status:e.status})}onThinking(e){this.emit({type:"generate_thinking",took_ms:e.tookMs})}onProgress(e){this.emit({type:"generate_progress",pct:e})}onSnapshot(e){this.emit({type:"generate_snapshot",scenario_count:e.scenarios.length,case_count:Z(e.scenarios),scenarios:e.scenarios})}onClarification(e){this.emit({type:"generate_clarification",text:e})}onChat(e){this.emit({type:"generate_chat",text:e})}onError(e){this.emit({type:"error",message:e})}onSaveResult(e){this.emit({type:"generate_save_result",suite_dir:e.suiteDir,saved:e.saved,fell_back:e.fellBack,...e.warning?{warning:e.warning}:{}})}onDone(e){this.emit({type:"generate_done",request_id:e.requestId,status:e.status,scenario_count:e.scenarioCount,case_count:e.caseCount,refine_hint:e.refineHint,save_hint:e.saveHint,...e.suiteDir?{suite_dir:e.suiteDir}:{}})}onUpdateAvailable(e){this.emit({type:"update_available",current:e.current,latest:e.latest,severity:e.severity})}},S=class{constructor(e=n=>process.stdout.write(n)){this.write=e}onStart(e){let n=e.isRefine?"Refining":"Generating";this.write(`${n} (request ${e.requestId})\u2026
4
4
  `)}onUpload(e){e.status==="uploading"&&this.write(` uploading ${e.file} (${e.index}/${e.total})
5
5
  `)}onThinking(e){let n=e.tookMs?` (${Math.round(e.tookMs/1e3)}s)`:"";this.write(` thinking${n}
@@ -16,6 +16,6 @@ import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p a
16
16
  `),this.write(` Save: ${e.saveHint}
17
17
  `),e.suiteDir&&this.write(` Saved: ${e.suiteDir}
18
18
  `)}onUpdateAvailable(e){this.write(`(update available: ${e.current} \u2192 ${e.latest})
19
- `)}};import{createHash as ee}from"crypto";function te(t){return ee("sha1").update(JSON.stringify({t:t.title,p:t.preconditions,m:t.manual_steps})).digest("hex")}function re(t){let e=[];for(let n of t.scenarios)for(let r of n.test_cases??[])I(r)&&r.manual_steps!=null&&e.push(r);return e}async function ne(t,e,n){let r=new Array(t.length),l=0,u=Array.from({length:Math.min(e,t.length)},async()=>{for(;;){let d=l++;if(d>=t.length)return;try{r[d]={ok:!0,value:await n(t[d])}}catch{r[d]={ok:!1}}}});return await Promise.all(u),r}async function Y(t,e,n){let r=re(t),l=n.run??(async(c,s)=>{let m=await n.resolveAuth(),o=F({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return z(o,n.spawnOpts,s)}),u=r.map(te),d=[...new Set(u)],g=new Map;d.forEach(c=>{g.set(c,r[u.indexOf(c)])});let p=d.map(c=>g.get(c)),v=await ne(p,n.concurrency??3,c=>l(U(c))),i=new Map;d.forEach((c,s)=>{let m=v[s];m.ok&&i.set(c,m.value)});let f=new Map;r.forEach((c,s)=>{f.set(c.id,i.get(u[s]))});let a=0;for(let c of t.scenarios)for(let s of c.test_cases??[])I(s)&&!f.get(s.id)&&a++;let w=c=>{let s=f.get(c.id);return s?M(s,c):B(c)};return{...await L(t,e,{suiteName:n.suiteName,redirectBareCwd:!1},w),fellBack:a}}function Pe(t,e){let n=!!t.agent||!!t.refine||!!t.save||!e,r=t.agent?"agent":"plain";return{headless:n,mode:r}}function $e(t){return t.refine&&t.save?{error:"use --refine or --save, not both"}:t.save?t.objective?{error:"--save takes no objective; use --refine to add to a request"}:t.req?{op:"save"}:{error:"--save requires --req <id>"}:t.refine?t.req?t.objective?t.out?{error:"--out is only valid with --save"}:{op:"refine"}:{error:"--refine needs a refinement objective"}:{error:"--refine requires --req <id>"}:t.req?{error:"--req requires --refine or --save"}:t.out?{error:"--out is only valid with --save"}:t.objective?{op:"new"}:{error:"provide an objective, or use --refine/--save with --req"}}function ie(){return se(process.cwd(),".testmuai","tests")}function Ge(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(Boolean);return e.length?e:void 0}var X="tcg-generate-headless";function Q(t){return{refineHint:`kane-cli generate "<refinement>" --refine --req ${t}`,saveHint:`kane-cli generate --save --req ${t}`}}function W(t){return t.scenarios.reduce((e,n)=>e+(n.test_cases?.length??0),0)}function oe(t){return t==="completed"?0:t==="stopped"?3:1}async function Ne(t,e){let n=e.write??(i=>process.stdout.write(i)),r=e.sink??(e.mode==="agent"?new y(n):new S(n)),l,u,d=null;try{let i=await e.makeClient();l=i.client,u=i.conn,d=i.autoDefaulted}catch(i){return r.onError(i.message),2}if(e.mode==="agent"&&d){let{buildAutoDefaultedNdjson:i}=await import("./require-project-folder-3DTI2CVB.js");n(i(d))}try{let i=await(e.checkUpdate??T)();i&&r.onUpdateAvailable(i)}catch{}let g=t.reqId??null;E(X,()=>{g&&l.cancel(g).catch(()=>{})});let p=process.cwd(),v={validate:e.validate??O,upload:e.upload??K,buildMappings:J,onUpload:i=>r.onUpload(i)};try{if(t.op==="save"){let s;try{s=(await l.attach(t.reqId)).state}catch(D){return r.onError(D.message),2}g=s.requestId,r.onSnapshot(s);let m=t.outDir??ie(),o=await e.materialize(s,m,t.suiteName);r.onSaveResult({suiteDir:o.suiteDir,saved:o.paths.length,fellBack:o.fellBack,warning:o.warning});let h=Q(s.requestId);return r.onDone({requestId:s.requestId,status:"completed",scenarioCount:s.scenarios.length,caseCount:W(s),refineHint:h.refineHint,saveHint:h.saveHint,suiteDir:o.suiteDir}),0}let i=t.op==="refine",f,a;if(i){let s;try{s=await l.attach(t.reqId)}catch(o){return r.onError(o.message),2}if(a=s.state,g=a.requestId,a.error)return r.onError(a.error),2;let m;try{m=await _({promptText:t.objective,filePaths:t.files??[],cwd:p,scenarios:a.scenarios,isRefine:!0,conn:u,deps:v})}catch(o){if(o instanceof C){for(let h of o.errors)r.onError(h);return 2}return r.onError(o.message),2}for(let o of m.warnings)process.stderr.write(`warning: ${o}
19
+ `)}};import{createHash as ee}from"crypto";function te(t){return ee("sha1").update(JSON.stringify({t:t.title,p:t.preconditions,m:t.manual_steps})).digest("hex")}function re(t){let e=[];for(let n of t.scenarios)for(let r of n.test_cases??[])I(r)&&r.manual_steps!=null&&e.push(r);return e}async function ne(t,e,n){let r=new Array(t.length),l=0,u=Array.from({length:Math.min(e,t.length)},async()=>{for(;;){let d=l++;if(d>=t.length)return;try{r[d]={ok:!0,value:await n(t[d])}}catch{r[d]={ok:!1}}}});return await Promise.all(u),r}async function Y(t,e,n){let r=re(t),l=n.run??(async(c,s)=>{let m=await n.resolveAuth(),o=F({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return z(o,n.spawnOpts,s)}),u=r.map(te),d=[...new Set(u)],g=new Map;d.forEach(c=>{g.set(c,r[u.indexOf(c)])});let p=d.map(c=>g.get(c)),v=await ne(p,n.concurrency??3,c=>l(U(c))),i=new Map;d.forEach((c,s)=>{let m=v[s];m.ok&&i.set(c,m.value)});let f=new Map;r.forEach((c,s)=>{f.set(c.id,i.get(u[s]))});let a=0;for(let c of t.scenarios)for(let s of c.test_cases??[])I(s)&&!f.get(s.id)&&a++;let w=c=>{let s=f.get(c.id);return s?M(s,c):B(c)};return{...await L(t,e,{suiteName:n.suiteName,redirectBareCwd:!1},w),fellBack:a}}function Pe(t,e){let n=!!t.agent||!!t.refine||!!t.save||!e,r=t.agent?"agent":"plain";return{headless:n,mode:r}}function $e(t){return t.refine&&t.save?{error:"use --refine or --save, not both"}:t.save?t.objective?{error:"--save takes no objective; use --refine to add to a request"}:t.req?{op:"save"}:{error:"--save requires --req <id>"}:t.refine?t.req?t.objective?t.out?{error:"--out is only valid with --save"}:{op:"refine"}:{error:"--refine needs a refinement objective"}:{error:"--refine requires --req <id>"}:t.req?{error:"--req requires --refine or --save"}:t.out?{error:"--out is only valid with --save"}:t.objective?{op:"new"}:{error:"provide an objective, or use --refine/--save with --req"}}function ie(){return se(process.cwd(),".testmuai","tests")}function Ge(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(Boolean);return e.length?e:void 0}var X="tcg-generate-headless";function Q(t){return{refineHint:`kane-cli generate "<refinement>" --refine --req ${t}`,saveHint:`kane-cli generate --save --req ${t}`}}function W(t){return t.scenarios.reduce((e,n)=>e+(n.test_cases?.length??0),0)}function oe(t){return t==="completed"?0:t==="stopped"?3:1}async function Ne(t,e){let n=e.write??(i=>process.stdout.write(i)),r=e.sink??(e.mode==="agent"?new y(n):new S(n)),l,u,d=null;try{let i=await e.makeClient();l=i.client,u=i.conn,d=i.autoDefaulted}catch(i){return r.onError(i.message),2}if(e.mode==="agent"&&d){let{buildAutoDefaultedNdjson:i}=await import("./require-project-folder-O2XCXDRE.js");n(i(d))}try{let i=await(e.checkUpdate??T)();i&&r.onUpdateAvailable(i)}catch{}let g=t.reqId??null;j(X,()=>{g&&l.cancel(g).catch(()=>{})});let p=process.cwd(),v={validate:e.validate??O,upload:e.upload??K,buildMappings:J,onUpload:i=>r.onUpload(i)};try{if(t.op==="save"){let s;try{s=(await l.attach(t.reqId)).state}catch(D){return r.onError(D.message),2}g=s.requestId,r.onSnapshot(s);let m=t.outDir??ie(),o=await e.materialize(s,m,t.suiteName);r.onSaveResult({suiteDir:o.suiteDir,saved:o.paths.length,fellBack:o.fellBack,warning:o.warning});let h=Q(s.requestId);return r.onDone({requestId:s.requestId,status:"completed",scenarioCount:s.scenarios.length,caseCount:W(s),refineHint:h.refineHint,saveHint:h.saveHint,suiteDir:o.suiteDir}),0}let i=t.op==="refine",f,a;if(i){let s;try{s=await l.attach(t.reqId)}catch(o){return r.onError(o.message),2}if(a=s.state,g=a.requestId,a.error)return r.onError(a.error),2;let m;try{m=await _({promptText:t.objective,filePaths:t.files??[],cwd:p,scenarios:a.scenarios,isRefine:!0,conn:u,deps:v})}catch(o){if(o instanceof C){for(let h of o.errors)r.onError(h);return 2}return r.onError(o.message),2}for(let o of m.warnings)process.stderr.write(`warning: ${o}
20
20
  `);r.onStart({requestId:a.requestId,objectiveChars:m.promptText.length,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,isRefine:!0});try{await l.chat(t.reqId,m.promptText,{mappings:m.mappings,attachments:m.attachments})}catch(o){return r.onError(o.message),2}f=s.events}else{let s;try{s=await _({promptText:t.objective,filePaths:t.files??[],cwd:p,scenarios:[],isRefine:!1,conn:u,deps:v})}catch(o){if(o instanceof C){for(let h of o.errors)r.onError(h);return 2}return r.onError(o.message),2}for(let o of s.warnings)process.stderr.write(`warning: ${o}
21
- `);let m;try{m=await l.start({prompt:s.promptText,attachments:s.attachments,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,memoryEnhancement:t.memory})}catch(o){return r.onError(o.message),2}a=m.state,g=a.requestId,r.onStart({requestId:a.requestId,objectiveChars:s.promptText.length,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,isRefine:!1}),f=m.events}let w="";for await(let s of f){switch(a=$(a,s),s.type){case"thinking_done":r.onThinking({tookMs:s.tookMs});break;case"progress":r.onProgress(s.pct);break;case"clarification":r.onClarification(s.text);break;case"chat":r.onChat(s.text);break;case"error":r.onError(s.message);break;case"done":w=s.status;break;default:break}if(s.type==="done"||s.type!=="thinking"&&a.status&&P(a.status))break}r.onSnapshot(a);let b=w||a.status||"completed",c=Q(a.requestId);return r.onDone({requestId:a.requestId,status:b,scenarioCount:a.scenarios.length,caseCount:W(a),refineHint:c.refineHint,saveHint:c.saveHint,suiteDir:void 0}),oe(b)}finally{q(X)}}var ae=()=>{};async function Me(t){let e=new j,n=new A,r=e.getActiveProfile()??"default",l=t.env??e.getDefaultEnv()??"prod",u=R(l),d=new x;t.name&&d.setSessionName(t.name);let g=n.load().model,p=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}}),f=await V({resolver:i.resolver,env:u,log:ae,projectId:t.projectId,folderId:t.folderId,autoResolve:t.projectId?void 0:{creds:e,config:n,profile:r,envName:l}});return{client:N(f),conn:f,autoDefaulted:f.autoDefaulted??null}},v=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}});return i.basicAuth?{username:i.basicAuth.username,access_key:i.basicAuth.access_key}:i.token?{auth:{type:"bearer",token:i.token}}:{}};return{mode:t.mode,makeClient:p,materialize:(i,f,a)=>Y(i,f,{model:g,sessionId:d.sessionId,resolveAuth:v,spawnOpts:{environment:l},suiteName:a})}}export{Me as buildHeadlessDeps,Pe as decideGenerateMode,ie as defaultOutDir,Ge as parseFilesFlag,$e as resolveGenerateOp,Ne as runGenerateHeadless};
21
+ `);let m;try{m=await l.start({prompt:s.promptText,attachments:s.attachments,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,memoryEnhancement:t.memory})}catch(o){return r.onError(o.message),2}a=m.state,g=a.requestId,r.onStart({requestId:a.requestId,objectiveChars:s.promptText.length,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,isRefine:!1}),f=m.events}let w="";for await(let s of f){switch(a=$(a,s),s.type){case"thinking_done":r.onThinking({tookMs:s.tookMs});break;case"progress":r.onProgress(s.pct);break;case"clarification":r.onClarification(s.text);break;case"chat":r.onChat(s.text);break;case"error":r.onError(s.message);break;case"done":w=s.status;break;default:break}if(s.type==="done"||s.type!=="thinking"&&a.status&&P(a.status))break}r.onSnapshot(a);let b=w||a.status||"completed",c=Q(a.requestId);return r.onDone({requestId:a.requestId,status:b,scenarioCount:a.scenarios.length,caseCount:W(a),refineHint:c.refineHint,saveHint:c.saveHint,suiteDir:void 0}),oe(b)}finally{R(X)}}var ae=()=>{};async function Me(t){let e=new E,n=new A,r=e.getActiveProfile()??"default",l=t.env??e.getDefaultEnv()??"prod",u=q(l),d=new x;t.name&&d.setSessionName(t.name);let g=n.load().model,p=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}}),f=await V({resolver:i.resolver,env:u,log:ae,projectId:t.projectId,folderId:t.folderId,autoResolve:t.projectId?void 0:{creds:e,config:n,profile:r,envName:l}});return{client:N(f),conn:f,autoDefaulted:f.autoDefaulted??null}},v=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}});return i.basicAuth?{username:i.basicAuth.username,access_key:i.basicAuth.access_key}:i.token?{auth:{type:"bearer",token:i.token}}:{}};return{mode:t.mode,makeClient:p,materialize:(i,f,a)=>Y(i,f,{model:g,sessionId:d.sessionId,resolveAuth:v,spawnOpts:{environment:l},suiteName:a})}}export{Me as buildHeadlessDeps,Pe as decideGenerateMode,ie as defaultOutDir,Ge as parseFilesFlag,$e as resolveGenerateOp,Ne as runGenerateHeadless};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b,c}from"./chunk-SULRMI2J.js";import"./chunk-73ZFOJOK.js";import"./chunk-OVB5GVRB.js";import"./chunk-JSSM2TWY.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-YJAQZMJT.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{b as extractIntentOf,a as holdEventId,c as landHoldPassthrough};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as a,c as b,d as c}from"./chunk-XTQUCCJH.js";import"./chunk-ZCRZFAOT.js";import"./chunk-UR6MHSHU.js";export{c as clearIdentitySnapshot,a as readIdentitySnapshot,b as refreshIdentitySnapshot};
@@ -1,11 +1,11 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as ke}from"./chunk-6SD4XTYC.js";import{d as be}from"./chunk-6HRNG4CK.js";import"./chunk-JBKHX5ES.js";import{Q as ye}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{k as ee,l as he}from"./chunk-4CJQ7XZP.js";import{a as fe,i as ge}from"./chunk-IEHJG6J4.js";import{a as K}from"./chunk-TAY7J5VS.js";import"./chunk-UWPG5MWM.js";import"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import{e as pe}from"./chunk-NI3TIAD7.js";import{e as le,i as ue}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import{b as we,c as _e}from"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import{B as me,Ha as V,f as ce,t as de,x as Z}from"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as ae}from"./chunk-RQKMSNEU.js";import{a as S}from"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{readFileSync as Ge}from"fs";import{relative as Tt,resolve as Nt}from"path";var Je=/^diff --git a\/(.*) b\/(.*)$/,Ve=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@ ?(.*)$/,Ke=/^Binary files (.+) and (.+) differ$/,qe=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,ze=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/,Qe=/^\s{0,3}(`{3,}|~{3,})/,Ze=/^(index |--- |\+\+\+ |new file mode|deleted file mode|old mode|new mode|similarity index|dissimilarity index|rename from|rename to|copy from|copy to)/;function j(e){let t=e.trim().replace(/^"|"$/g,"");return t==="/dev/null"?null:t.replace(/^[ab]\//,"")}function Y(e,t=79){let n=e.split(`
2
+ import{b as ke}from"./chunk-NKJRAQ6L.js";import{d as be}from"./chunk-PKXWYYVK.js";import"./chunk-FOURJ24E.js";import{k as ee,l as he}from"./chunk-AXOSLGQ4.js";import{Q as ye}from"./chunk-NNVHWFLI.js";import"./chunk-PZOQ2IQK.js";import"./chunk-FNBHP75S.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as fe,i as ge}from"./chunk-FP6JCXOS.js";import{a as K}from"./chunk-QLGQDNA3.js";import"./chunk-2EKLTUY2.js";import{e as pe}from"./chunk-IT6M7OMG.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import{e as le,i as ue}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-REKHAN53.js";import{b as we,c as _e}from"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-TD6GCEIK.js";import"./chunk-5ORBAYTU.js";import"./chunk-XRJH4UF3.js";import"./chunk-PVN64537.js";import{B as me,Ha as V,f as ce,t as de,x as Z}from"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as S}from"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-VZ7KXRXB.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import{a as ae}from"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{readFileSync as Ge}from"fs";import{relative as Tt,resolve as Nt}from"path";var Je=/^diff --git a\/(.*) b\/(.*)$/,Ve=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@ ?(.*)$/,Ke=/^Binary files (.+) and (.+) differ$/,qe=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,ze=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/,Qe=/^\s{0,3}(`{3,}|~{3,})/,Ze=/^(index |--- |\+\+\+ |new file mode|deleted file mode|old mode|new mode|similarity index|dissimilarity index|rename from|rename to|copy from|copy to)/;function j(e){let t=e.trim().replace(/^"|"$/g,"");return t==="/dev/null"?null:t.replace(/^[ab]\//,"")}function Y(e,t=79){let n=e.split(`
3
3
  `)[0].trim();if(n.length<=t)return n;let s=n.slice(0,t-1),r=s.lastIndexOf(" ");return`${(r>=s.length/2?s.slice(0,r):s).trimEnd()}\u2026`}function et(e,t){return e.length+t.length<=79?`${e}${t}`:`${Y(e.replace(/…$/,""),79-t.length)}${t}`}function tt(e,t){let n=new Map;for(let r of e)n.set(r.label,(n.get(r.label)??0)+1);let s=new Map;e.forEach((r,o)=>{if(n.get(r.label)<2)return;let f=`${r.label}
4
4
  ${t[o]}`,d=(s.get(f)??0)+1;s.set(f,d),r.label=et(r.label,d===1?` (line ${t[o]})`:` (line ${t[o]}, ${d})`)})}function nt(e){let t=s=>e.find(r=>r.startsWith(s))?.slice(s.length).trim(),n=[];return t("rename from ")!==void 0&&n.push(`renamed from ${t("rename from ")}`),t("copy from ")!==void 0&&n.push(`copied from ${t("copy from ")}`),t("new file mode")!==void 0&&n.push("new empty file"),t("deleted file mode")!==void 0&&n.push("deleted"),t("old mode ")!==void 0&&t("new mode ")!==void 0&&n.push(`mode ${t("old mode ")} to ${t("new mode ")}`),n.length>0?n.join(", "):"changed"}function Ie(e){let t=[],n=[],s=!1,r=(o,f,d,u,m)=>{if(t.length>=2e3){s=!0;return}t.push({id:`c${t.length+1}`,kind:o,file:f,label:d,text:u}),n.push(m)};for(let o of e)st(o.text,r);return tt(t,n),{parts:t,truncated:s}}function st(e,t){let n=e.split(/\r?\n/),s=!1,r=null,o=null,f=0,d=!1,u=null,m="",g=0,w=0,a=0,l=[],i=0,h=[],c=null,I=!0,y=null,_=v=>{let k=[...c!==null?[c]:[],...h.map(L=>L.text)];return c=null,k.length>0?`${k.join(" / ")}: ${v}`:v},A=(v,k,L)=>{let P=_(k);t(v,null,Y(P),P,L)},b=(v,k)=>{l.length===0&&(i=k),l.push(v)},x=()=>{u!==null&&(t("diff_hunk",r,m,u.join(`
5
5
  `),g),d=!0),u=null},C=()=>{x(),o!==null&&!d&&t("diff_hunk",r,Y(`${r??"diff"}: ${nt(o)}`),o.join(`
6
6
  `),f),o=null},M=()=>{let v=l.join(`
7
7
  `).trim();v!==""&&A("text",v,i),l=[]},W=()=>{M(),h=[],c=null,s=!0};for(let v=0;v<n.length;v++){let k=n[v],L=I;if(k.trim()!==""&&(I=!1),y===null){let $=Je.exec(k);if($){W(),C(),r=j(`b/${$[2]}`)??j(`a/${$[1]}`),o=[],f=v+1,d=!1;continue}if(!s&&k.startsWith("--- ")&&n[v+1]?.startsWith("+++ ")){W(),r=j(n[v+1].slice(4))??j(k.slice(4)),v++;continue}}if(s){let $=Ve.exec(k);if($){x(),u=[k];let T=$[5].trim();g=Number($[3])>0?Number($[3]):Number($[1]),m=Y(`${r??"diff"}: ${T!==""?T:`line ${g}`}`),w=$[2]===void 0?1:Number($[2]),a=$[4]===void 0?1:Number($[4]);continue}if(k.startsWith("--- ")&&n[v+1]?.startsWith("+++ ")){x(),r=j(n[v+1].slice(4))??j(k.slice(4))??r,v++;continue}if(u!==null&&(w>0||a>0)&&/^[ +\-\\]/.test(k)){let T=k[0];T!=="\\"&&u.push(k),(T===" "||T==="-")&&w--,(T===" "||T==="+")&&a--;continue}let O=Ke.exec(k);if(O){x();let T=j(O[2])??j(O[1]);t("diff_hunk",T,Y(`${T??"diff"}: binary file`),k,v+1),d=!0;continue}if(u===null&&Ze.test(k)){o!==null&&!/^(index |--- |\+\+\+ )/.test(k)&&o.push(k);continue}if(u!==null&&k===""&&(w>0||a>0)){u.push(""),w--,a--;continue}C(),s=!1}let P=Qe.exec(k);if(P&&(y===null||P[1][0]===y[0])){y=y===null?P[1]:null;continue}if(y!==null){b(k,v+1);continue}if(k.trim()===""){M();continue}let X=qe.exec(k);if(X){M();let $=X[1].length,O=X[2].trim();if(L&&$===1){c=O===""?null:O;continue}h=h.filter(T=>T.level<$),O!==""&&h.push({level:$,text:O});continue}let U=ze.exec(k);if(U){M(),U[1].trim()!==""&&A("changelog",U[1].trim(),v+1);continue}b(k,v+1)}C(),M()}var rt=["usecase","ac","scenario"],ot=["verifies","scoped_to","belongs_to","exercises","automates"],it=4,at=1e3;async function xe(e,t){let n;try{n=await Promise.all([Promise.all(rt.map(c=>e.nodes(t,c))),ct(e,t),Promise.all(ot.map(c=>e.edges(t,c)))])}catch(c){if(c instanceof S&&(c.code==="NO_CONTEXT"||c.code==="NOT_FOUND"))return null;throw c}let[s,r,o]=n,f=[...s.flat().map(c=>te(c,c.title??"")),...r],d=new Map(f.map(c=>[c.cid,c])),u=new Map,m=c=>{let I=u.get(c);if(I)return I;let y=e.mainNode(t,c).catch(_=>{if(_ instanceof S&&_.code==="NOT_FOUND")return null;throw u.delete(c),_});return u.set(c,y),y},g=new Map,w=async c=>{let I=c;for(let y=0;y<at&&!d.has(I);y++){let _=await m(I);if(_===null||_.supersededBy===null||_.supersededBy===""){g.set(c,null);return}I=_.supersededBy}g.set(c,d.has(I)?I:null)},a=o.flat();await q([...new Set(a.flatMap(c=>[c.src,c.dst]).filter(c=>!d.has(c)))],w);let l=c=>d.has(c)?c:g.get(c)??null,i=[],h=new Set;for(let c of a){let I=l(c.src),y=l(c.dst);if(I===null||y===null||d.get(I).trust==="archived"||d.get(y).trust==="archived")continue;let _=`${c.type} ${I} ${y}`;h.has(_)||(h.add(_),i.push({type:c.type,src:I,dst:y}))}return{nodes:f,edges:i}}async function ct(e,t){let n=await e.testsWithContent(t);return n===null?(await e.nodes(t,"test")).map(s=>te(s,"")):n.map(s=>te(s,ne(s.content)))}function ve(e){let t=new Map(e.nodes.map(s=>[s.cid,s])),n=new Map;for(let s of e.edges){let r=s.type==="automates"?t.get(s.dst):void 0;r?.label==="scenario"&&n.set(s.src,[...n.get(s.src)??[],r.name??r.cid])}return n}var ne=e=>B(e.test_md_blob)??B(e.objectives_blob)??"",B=e=>typeof e=="string"&&e.trim()!==""?e:null;function Ce(e,t){let n=new Map,s=r=>e.mainNode(t,r).then(o=>o.content,o=>{if(o instanceof S&&o.code==="NOT_FOUND")return{};throw o});return r=>{let o=n.get(r);if(o)return o;let f=s(r).catch(d=>{if(d instanceof S&&d.retryable)return s(r);throw d});return f.catch(()=>n.delete(r)),n.set(r,f),f}}function Ae(e){let t=0,n=s=>(...r)=>(t++,s(...r));return{client:{nodes:n(e.nodes.bind(e)),testsWithContent:n(e.testsWithContent.bind(e)),edges:n(e.edges.bind(e)),mainNode:n(e.mainNode.bind(e)),testCases:n(e.testCases.bind(e))},reads:()=>t}}function te(e,t){return{cid:e.cid,name:e.name,label:e.label,title:e.title,text:t,trust:e.trust,freshness:e.freshness}}async function q(e,t){let n=0,s=async r=>{try{await t(r)}catch(o){if(o instanceof S&&o.retryable)return t(r);throw o}};await Promise.all(Array.from({length:Math.min(it,e.length)},async()=>{for(let r=n++;r<e.length;r=n++)await s(e[r])}))}var lt=e=>e.trust!=="archived"&&e.freshness!=="superseded"&&e.freshness!=="orphaned",$e=new WeakMap;function z(e){let t=$e.get(e);if(t)return t;let n=e.nodes.filter(lt),s=new Map(n.map(u=>[u.cid,u])),r=new Map(n.map((u,m)=>[u.cid,m])),o=new Map,f=(u,m)=>{o.set(u,[...o.get(u)??[],m])};for(let u of e.edges)!s.has(u.src)||!s.has(u.dst)||(f(`${u.type}<${u.dst}`,u.src),f(`${u.type}>${u.src}`,u.dst));let d={byCid:s,from:(u,m)=>o.get(`${u}<${m}`)??[],to:(u,m)=>o.get(`${u}>${m}`)??[],labelled:(u,m)=>u.filter(g=>s.get(g).label===m),inOrder:u=>[...new Set(u)].sort((m,g)=>r.get(m)-r.get(g))};return $e.set(e,d),d}function ut(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e),d=n.get(t);if(!d)return[];let u=new Map,m=(a,l)=>{u.set(a,[...u.get(a)??[],...l])},g=(a,l)=>{for(let i of o(s("verifies",a),"test"))m(i,[...l,a])},w=(a,l)=>{for(let i of o(s("automates",a),"test"))m(i,[...l,a]);for(let i of o([...r("exercises",a),...s("scoped_to",a)],"ac"))g(i,[...l,a])};if(d.label==="test"&&m(d.cid,[]),d.label==="ac"&&g(d.cid,[]),d.label==="scenario"&&w(d.cid,[]),d.label==="usecase"){for(let a of o(s("belongs_to",d.cid),"scenario"))w(a,[d.cid]);for(let a of o(s("scoped_to",d.cid),"ac"))g(a,[d.cid])}return f(u.keys()).map(a=>({test:a,through:f(u.get(a))}))}function se(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e);if(n.get(t)?.label!=="test")return{useCases:[],scenarios:[],criteria:[]};let d=o(r("verifies",t),"ac"),u=[...o(r("automates",t),"scenario")];for(let g of d)u.push(...o([...s("exercises",g),...r("scoped_to",g)],"scenario"));let m=[];for(let g of d)m.push(...o(r("scoped_to",g),"usecase"));for(let g of u)m.push(...o(r("belongs_to",g),"usecase"));return{useCases:f(m),scenarios:f(u),criteria:f(d)}}function Re(e){let{byCid:t}=z(e);return[...t.values()].filter(n=>n.label==="test"&&se(e,n.cid).useCases.length===0).map(n=>n.cid)}function Te(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e);if(n.get(t)?.label!=="usecase")return{criteria:[],scenarios:[],tests:[]};let d=o(s("belongs_to",t),"scenario"),u=[...o(s("scoped_to",t),"ac")];for(let m of d)u.push(...o([...r("exercises",m),...s("scoped_to",m)],"ac"));return{criteria:f(u),scenarios:f(d),tests:ut(e,t).map(m=>m.test)}}var Pe=60*1024,dt=8*1024,mt=300,N="no-use-case",H="Tests under no use case",pt=300,Ne=10,Ee=20,Me=2*1024,ft=e=>e.trust!=="archived"&&e.freshness!=="superseded"&&e.freshness!=="orphaned",E=e=>e.name??e.cid,Oe=(e,t)=>e.name===null!=(t.name===null)?e.name===null?1:-1:E(e).localeCompare(E(t),"en",{numeric:!0}),J=e=>Buffer.byteLength(JSON.stringify(e),"utf8");function Se(e,t){if(J(e)<=t)return{text:e,cut:!1};let n=e;for(;J(n)>t;)n=n.slice(0,Math.floor(n.length*t/J(n))-1);return{text:/[\uD800-\uDBFF]$/.test(n)?n.slice(0,-1):n,cut:!0}}function gt(e,t){let n=e.replace(/\s+/g," ").trim();if(n.length<=t)return n;let s=n.slice(0,t-1),r=s.lastIndexOf(" ");return`${r>t/2?s.slice(0,r):s}\u2026`}function je(e,t){let n=e.nodes.filter(ft),s=new Map(n.map(a=>[a.cid,a])),r=new Map;for(let a of n)a.name&&(a.label==="usecase"||a.label==="test")&&r.set(`${a.label} ${a.name.toLowerCase()}`,a);let o=n.filter(a=>a.label==="usecase").sort(Oe),f=n.filter(a=>a.label==="test"),d=new Map,u=a=>{let l=d.get(a);return l||d.set(a,l=Te(e,a)),l},m=Re(e),g=new Map,w=a=>{let{criteria:l,scenarios:i,tests:h}=u(a.cid);return{id:E(a),title:a.title??"",description:g.get(a.cid)??"",criteria:l.length,scenarios:i.length,tests:h.length}};return{graph:e,useCases:o,tests:f,noUseCase:m,find(a,l){if(typeof a!="string"||a.trim()==="")return null;let i=s.get(a)??r.get(`${l} ${a.trim().toLowerCase()}`);return i&&i.label===l?i:null},under:u,async index(a){let l=o.slice(a,a+mt);await q(l.filter(h=>!g.has(h.cid)),async h=>{let c=await t(h.cid).catch(()=>({}));g.set(h.cid,gt(Le(c),pt))});let i=l.map(w);return a===0&&m.length>0&&i.push({id:N,title:H,description:"",criteria:0,scenarios:0,tests:m.length}),i},useCaseOf(a,l){let i=se(e,a).useCases.map(c=>s.get(c)).filter(c=>c!==void 0).sort(Oe),h=i.find(c=>l?.has(E(c)))??i[0];return h?{id:E(h),title:h.title??""}:m.includes(a)?{id:N,title:H}:null},known:{use_cases:[...o.map(a=>({id:E(a),cid:a.cid})),...m.length>0?[{id:N,cid:null}]:[]],tests:f.map(a=>({id:E(a),cid:a.cid}))}}}var Le=e=>B(e.description)??B(e.summary)??"";function ht(e){let t=[B(e.description),B(e.intent)].filter(n=>n!==null);return[...new Set(t.map(n=>n.trim()))].join(`
8
- `)}function Ue(e,t,n){let s={useCases:new Set,tests:new Set,listed:new Set},r=(w,a)=>({answer:{ok:!1,error:{code:w,message:a}},opened:null}),o=new Map(e.graph.nodes.map(w=>[w.cid,w])),f=w=>o.get(w),d=(w,a)=>Array.isArray(w.ids)&&w.ids.length>=1&&w.ids.length<=a&&w.ids.every(l=>typeof l=="string"&&l.trim()!=="")?[...new Set(w.ids.map(l=>l.trim()))]:null,u=async w=>{let a=w.map(b=>b.toLowerCase()===N?N:e.find(b,"usecase")),l=w.filter((b,x)=>a[x]===null),i=[...new Map(a.filter(b=>b!==null).map(b=>[b===N?N:b.cid,b])).values()];if(i.length===0)return r("not_found",`no use case ${l.join(", ")} in this project`);let h=[...new Set(i.flatMap(b=>b===N?[]:e.under(b.cid).scenarios))],c=new Map;await q(h,async b=>{c.set(b,ht(await n(b)))});let I=await Promise.all(i.map(async b=>{if(b===N)return{id:N,title:H,description:"",criteria:[],scenarios:[],tests:e.noUseCase.map(m)};let x=e.under(b.cid);return{id:E(b),title:b.title??"",description:Le(await n(b.cid)),criteria:x.criteria.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),text:C.text||(C.title??"")})),scenarios:x.scenarios.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),title:C.title??"",text:c.get(C.cid)??""})),tests:x.tests.map(m)}})),{kept:y,left:_,cut:A}=re(I,b=>b.id,wt);for(let b of y){s.useCases.add(b.id);for(let x of b.tests)s.listed.add(x.id)}return{answer:{ok:!0,result:{use_cases:y,not_found:l,not_included:_,cut:A}},opened:{what:"use_cases",ids:y.map(b=>b.id)}}},m=w=>{let a=f(w);return{id:a?E(a):w,title:a?.title??""}},g=async w=>{let a=w.map(_=>e.find(_,"test")),l=w.filter((_,A)=>a[A]===null),i=[...new Map(a.filter(_=>_!==null).map(_=>[_.cid,_])).values()];if(i.length===0)return r("not_found",`no test ${l.join(", ")} in this project`);let h=await Promise.all(i.map(async _=>{let A=Se(_.text||ne(await n(_.cid)),dt);return{id:E(_),title:_.title??"",use_case:e.useCaseOf(_.cid),steps:A.text,cut:A.cut}})),{kept:c,left:I,cut:y}=re(h,_=>_.id);for(let _ of c)s.tests.add(_.id);return{answer:{ok:!0,result:{tests:c,not_found:l,not_included:I,cut:y}},opened:{what:"tests",ids:c.map(_=>_.id)}}};return{opened:s,async answer(w,a){try{if(w==="impact_open_use_cases"){let l=d(a,Ne);return l?await u(l):r("bad_params",`impact_open_use_cases takes { ids: 1 to ${Ne} use case ids }`)}if(w==="impact_open_tests"){let l=d(a,Ee);return l?await g(l):r("bad_params",`impact_open_tests takes { ids: 1 to ${Ee} test ids }`)}if(w==="impact_change"){if(typeof a.part!="string")return r("bad_params","impact_change takes { part }");let l=t.find(h=>h.id.toLowerCase()===a.part.trim().toLowerCase());if(!l)return r("not_found",`no part ${a.part} in this change`);let i=Se(l.text,Pe-Me);return{answer:{ok:!0,result:{id:l.id,kind:l.kind,file:l.file,label:l.label,text:i.text,cut:i.cut}},opened:{what:"parts",ids:[l.id]}}}if(w==="impact_use_cases"){let l=a.offset??0;if(typeof l!="number"||!Number.isInteger(l)||l<0)return r("bad_params","impact_use_cases takes { offset: a whole number from 0 }");let{kept:i}=re(await e.index(l),c=>c.id),h=l+i.filter(c=>c.id!==N).length;return{answer:{ok:!0,result:{use_cases:i,offset:l,next_offset:h<e.useCases.length?h:null}},opened:{what:"use_case_index",ids:[]}}}}catch{return r("unavailable","the shared project couldn't be read just now: ask again")}return r("unknown_method",`${w} isn't an impact tool`)}}}function re(e,t,n){let s=Pe-Me,r=[],o=[],f=0,d=!1;for(let u of e){let m=u;if(r.length===0&&o.length===0)for(;m!==null&&J(m)>s;)m=n?n(m):null,d=!0;let g=m===null?1/0:J(m)+1;m!==null&&o.length===0&&f+g<=s?(r.push(m),f+=g):(o.push(t(u)),d=!0)}return{kept:r,left:o,cut:d}}function wt(e){let t=e,n=t.criteria.length>=t.scenarios.length&&t.criteria.length>0?"criteria":t.scenarios.length>0?"scenarios":t.tests.length>0?"tests":null;return n===null?null:{...t,[n]:t[n].slice(0,-1)}}var De=4e3,_t=1e3,yt=200,bt=160,kt=100,It=10*6e4,xt=["high","medium","low"],vt={turn_cap:"turn_cap",invalid_answer:"invalid_answer",unreachable:"unreachable"};async function Fe(e,t={}){let n=t.trace??K("context-impact"),s;try{s=await(t.check??Ct)()}catch{return n("review: the controller check failed"),{ok:!1,cause:"unreachable"}}if(!s.preflight.ok){let u=s.preflight.cause??"unknown";return n(`review: the controller check refused (${u})`),{ok:!1,cause:u==="unreachable"||u==="login_unchecked"?"unreachable":"stopped"}}let r;try{r=(t.agent??ke)($t(e),{auth:s.auth,onWarn:()=>n("review: the agent warned"),onStderr:u=>At(u,t.onTurn)})}catch{return n("review: the agent couldn't be started"),{ok:!1,cause:"stopped"}}t.onStart?.();let o={ok:!1,cause:"stopped"},f=!1,d=setTimeout(()=>{f=!0,n("review: the agent ran past its time"),r.kill()},t.timeoutMs??It);try{for await(let u of r.events){let m=u;if(m.type==="graph_query"){let g=String(m.method),w=Date.now(),{answer:a,opened:l}=await e.tools.answer(g,m.params??{}),i=a.ok?{type:"graph_result",id:String(m.id),ok:!0,result:a.result}:{type:"graph_result",id:String(m.id),ok:!1,error:`${a.error.code}: ${a.error.message}`};r.send(i);let h={name:g,ms:Date.now()-w,bytes:Buffer.byteLength(JSON.stringify(i),"utf8"),ok:a.ok};n(`review: ${g} ${a.ok?"answered":`refused (${a.error.code})`} in ${h.ms} ms, ${h.bytes} bytes`),t.onTool?.(h),l&&t.onOpened?.(l)}else if(m.type==="impact"){let g=Rt(m.impact,e);n(g?`review: answered ${g.tests.length} tests, ${g.notAffected.length} not affected`:"review: its answer didn't hold"),o=g?{ok:!0,answer:g}:{ok:!1,cause:"invalid_answer"}}else if(m.type==="error"){let g=typeof m.code=="string"?m.code:null;n(`review: the agent stopped (${g??"no code"})`),o.ok||(o={ok:!1,cause:g&&vt[g]||"stopped"});break}else if(m.type==="ask_user"){n("review: the agent asked a question");break}else if(m.type==="done"||m.type==="session_paused")break}}catch{n("review: the agent's stream failed"),o.ok||(o={ok:!1,cause:"stopped"})}finally{clearTimeout(d),await r.kill()}return f?{ok:!1,cause:"timeout"}:o}var Ct=async()=>(await import("./run-remote-SFR3F2T5.js")).controllerCheck();function At(e,t){if(!(!t||!e.includes("turn_timing")))try{let n=JSON.parse(e);if(n.event!=="turn_timing"||typeof n.ms!="number")return;t({turn:typeof n.turn=="number"?n.turn:0,ms:n.ms,status:typeof n.status=="string"?n.status:"unknown",sentAtMs:typeof n.sent_at_ms=="number"?n.sent_at_ms:null})}catch{}}function $t(e){let t={project_id:e.projectId,parts:e.parts.map(n=>({id:n.id,kind:n.kind,file:n.file,label:n.label,text:n.text.slice(0,De),cut:n.text.length>De})),truncated:e.truncated,use_cases:e.index,use_cases_total:e.project.useCases.length,known:e.project.known};return{type:"run_config",version:1,session_id:ae(),mode:"agent",verb:"impact",graph_reads:!0,max_free_text_rounds:0,existing_use_cases:[],read_basis:null,source:{source_id:"impact",source_cid:"",kind:"impact_input",numbered_text:JSON.stringify(t)}}}function Rt(e,t){if(typeof e!="object"||e===null)return null;let n=e;if(typeof n.rationale!="string"||!Array.isArray(n.use_cases)||!Array.isArray(n.tests)||!Array.isArray(n.not_affected))return null;let{project:s,tools:r}=t,o=(l,i)=>typeof l=="string"&&l.trim()!==""?l.trim().slice(0,i):null,f=l=>{if(typeof l=="string"&&l.trim().toLowerCase()===N)return N;let i=s.find(l,"usecase");return i?i.name??i.cid:null},d=l=>{let i=s.find(l,"test");return i?i.name??i.cid:null},u=new Map(t.parts.map(l=>[l.id.toLowerCase(),l.id])),m=o(n.rationale,_t);if(m===null)return null;let g=[];for(let l of n.use_cases){let i=f(l?.id),h=o(l?.reason,yt);if(!i||!h)return null;g.some(c=>c.id===i)||g.push({id:i,reason:h})}let w=[];for(let l of n.tests){let i=d(l?.id),h=o(l?.reason,bt),c=xt.find(y=>y===l?.confidence);if(!i||!h||!c||w.some(y=>y.id===i)||!r.opened.tests.has(i)&&!r.opened.listed.has(i))return null;let I=Array.isArray(l.parts)?l.parts.map(y=>typeof y=="string"?u.get(y.trim().toLowerCase()):void 0):[];if(I.some(y=>y===void 0))return null;w.push({id:i,confidence:c,parts:[...new Set(I)],reason:h})}let a=[];for(let l of n.not_affected){let i=d(l?.id),h=o(l?.reason,kt);if(!i||!h)return null;(r.opened.tests.has(i)||r.opened.listed.has(i))&&!w.some(I=>I.id===i)&&!a.some(I=>I.id===i)&&a.push({id:i,reason:h})}return{rationale:m,useCases:g,tests:w,notAffected:a}}var Et="No shared work in this project yet: nothing to trace",Ot="The input holds no change: nothing to trace",St="Reviewing the change with AI (this can take a few minutes)\u2026",Pt=1e4,Be={high:0,medium:1,low:2},Mt={high:"High",medium:"Medium",low:"Low"},jt=3,Lt={turn_cap:"the AI review ran out of turns before it answered",unreachable:"the AI review couldn't be reached",invalid_answer:"the AI review didn't give a usable answer",timeout:"the AI review didn't answer within 10 minutes",stopped:"the AI review stopped before it answered"},Ut=async e=>ce({url:e,basicAuth:await pe()}),Dt=()=>({code:"IMPACT_LINKED_ONLY",message:"kane-cli context impact reads a shared project's tests: run it in a folder linked to one",remedy:`to link this folder to the shared project and bring its tests, run:
8
+ `)}function Ue(e,t,n){let s={useCases:new Set,tests:new Set,listed:new Set},r=(w,a)=>({answer:{ok:!1,error:{code:w,message:a}},opened:null}),o=new Map(e.graph.nodes.map(w=>[w.cid,w])),f=w=>o.get(w),d=(w,a)=>Array.isArray(w.ids)&&w.ids.length>=1&&w.ids.length<=a&&w.ids.every(l=>typeof l=="string"&&l.trim()!=="")?[...new Set(w.ids.map(l=>l.trim()))]:null,u=async w=>{let a=w.map(b=>b.toLowerCase()===N?N:e.find(b,"usecase")),l=w.filter((b,x)=>a[x]===null),i=[...new Map(a.filter(b=>b!==null).map(b=>[b===N?N:b.cid,b])).values()];if(i.length===0)return r("not_found",`no use case ${l.join(", ")} in this project`);let h=[...new Set(i.flatMap(b=>b===N?[]:e.under(b.cid).scenarios))],c=new Map;await q(h,async b=>{c.set(b,ht(await n(b)))});let I=await Promise.all(i.map(async b=>{if(b===N)return{id:N,title:H,description:"",criteria:[],scenarios:[],tests:e.noUseCase.map(m)};let x=e.under(b.cid);return{id:E(b),title:b.title??"",description:Le(await n(b.cid)),criteria:x.criteria.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),text:C.text||(C.title??"")})),scenarios:x.scenarios.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),title:C.title??"",text:c.get(C.cid)??""})),tests:x.tests.map(m)}})),{kept:y,left:_,cut:A}=re(I,b=>b.id,wt);for(let b of y){s.useCases.add(b.id);for(let x of b.tests)s.listed.add(x.id)}return{answer:{ok:!0,result:{use_cases:y,not_found:l,not_included:_,cut:A}},opened:{what:"use_cases",ids:y.map(b=>b.id)}}},m=w=>{let a=f(w);return{id:a?E(a):w,title:a?.title??""}},g=async w=>{let a=w.map(_=>e.find(_,"test")),l=w.filter((_,A)=>a[A]===null),i=[...new Map(a.filter(_=>_!==null).map(_=>[_.cid,_])).values()];if(i.length===0)return r("not_found",`no test ${l.join(", ")} in this project`);let h=await Promise.all(i.map(async _=>{let A=Se(_.text||ne(await n(_.cid)),dt);return{id:E(_),title:_.title??"",use_case:e.useCaseOf(_.cid),steps:A.text,cut:A.cut}})),{kept:c,left:I,cut:y}=re(h,_=>_.id);for(let _ of c)s.tests.add(_.id);return{answer:{ok:!0,result:{tests:c,not_found:l,not_included:I,cut:y}},opened:{what:"tests",ids:c.map(_=>_.id)}}};return{opened:s,async answer(w,a){try{if(w==="impact_open_use_cases"){let l=d(a,Ne);return l?await u(l):r("bad_params",`impact_open_use_cases takes { ids: 1 to ${Ne} use case ids }`)}if(w==="impact_open_tests"){let l=d(a,Ee);return l?await g(l):r("bad_params",`impact_open_tests takes { ids: 1 to ${Ee} test ids }`)}if(w==="impact_change"){if(typeof a.part!="string")return r("bad_params","impact_change takes { part }");let l=t.find(h=>h.id.toLowerCase()===a.part.trim().toLowerCase());if(!l)return r("not_found",`no part ${a.part} in this change`);let i=Se(l.text,Pe-Me);return{answer:{ok:!0,result:{id:l.id,kind:l.kind,file:l.file,label:l.label,text:i.text,cut:i.cut}},opened:{what:"parts",ids:[l.id]}}}if(w==="impact_use_cases"){let l=a.offset??0;if(typeof l!="number"||!Number.isInteger(l)||l<0)return r("bad_params","impact_use_cases takes { offset: a whole number from 0 }");let{kept:i}=re(await e.index(l),c=>c.id),h=l+i.filter(c=>c.id!==N).length;return{answer:{ok:!0,result:{use_cases:i,offset:l,next_offset:h<e.useCases.length?h:null}},opened:{what:"use_case_index",ids:[]}}}}catch{return r("unavailable","the shared project couldn't be read just now: ask again")}return r("unknown_method",`${w} isn't an impact tool`)}}}function re(e,t,n){let s=Pe-Me,r=[],o=[],f=0,d=!1;for(let u of e){let m=u;if(r.length===0&&o.length===0)for(;m!==null&&J(m)>s;)m=n?n(m):null,d=!0;let g=m===null?1/0:J(m)+1;m!==null&&o.length===0&&f+g<=s?(r.push(m),f+=g):(o.push(t(u)),d=!0)}return{kept:r,left:o,cut:d}}function wt(e){let t=e,n=t.criteria.length>=t.scenarios.length&&t.criteria.length>0?"criteria":t.scenarios.length>0?"scenarios":t.tests.length>0?"tests":null;return n===null?null:{...t,[n]:t[n].slice(0,-1)}}var De=4e3,_t=1e3,yt=200,bt=160,kt=100,It=10*6e4,xt=["high","medium","low"],vt={turn_cap:"turn_cap",invalid_answer:"invalid_answer",unreachable:"unreachable"};async function Fe(e,t={}){let n=t.trace??K("context-impact"),s;try{s=await(t.check??Ct)()}catch{return n("review: the controller check failed"),{ok:!1,cause:"unreachable"}}if(!s.preflight.ok){let u=s.preflight.cause??"unknown";return n(`review: the controller check refused (${u})`),{ok:!1,cause:u==="unreachable"||u==="login_unchecked"?"unreachable":"stopped"}}let r;try{r=(t.agent??ke)($t(e),{auth:s.auth,onWarn:()=>n("review: the agent warned"),onStderr:u=>At(u,t.onTurn)})}catch{return n("review: the agent couldn't be started"),{ok:!1,cause:"stopped"}}t.onStart?.();let o={ok:!1,cause:"stopped"},f=!1,d=setTimeout(()=>{f=!0,n("review: the agent ran past its time"),r.kill()},t.timeoutMs??It);try{for await(let u of r.events){let m=u;if(m.type==="graph_query"){let g=String(m.method),w=Date.now(),{answer:a,opened:l}=await e.tools.answer(g,m.params??{}),i=a.ok?{type:"graph_result",id:String(m.id),ok:!0,result:a.result}:{type:"graph_result",id:String(m.id),ok:!1,error:`${a.error.code}: ${a.error.message}`};r.send(i);let h={name:g,ms:Date.now()-w,bytes:Buffer.byteLength(JSON.stringify(i),"utf8"),ok:a.ok};n(`review: ${g} ${a.ok?"answered":`refused (${a.error.code})`} in ${h.ms} ms, ${h.bytes} bytes`),t.onTool?.(h),l&&t.onOpened?.(l)}else if(m.type==="impact"){let g=Rt(m.impact,e);n(g?`review: answered ${g.tests.length} tests, ${g.notAffected.length} not affected`:"review: its answer didn't hold"),o=g?{ok:!0,answer:g}:{ok:!1,cause:"invalid_answer"}}else if(m.type==="error"){let g=typeof m.code=="string"?m.code:null;n(`review: the agent stopped (${g??"no code"})`),o.ok||(o={ok:!1,cause:g&&vt[g]||"stopped"});break}else if(m.type==="ask_user"){n("review: the agent asked a question");break}else if(m.type==="done"||m.type==="session_paused")break}}catch{n("review: the agent's stream failed"),o.ok||(o={ok:!1,cause:"stopped"})}finally{clearTimeout(d),await r.kill()}return f?{ok:!1,cause:"timeout"}:o}var Ct=async()=>(await import("./run-remote-PS45MTHW.js")).controllerCheck();function At(e,t){if(!(!t||!e.includes("turn_timing")))try{let n=JSON.parse(e);if(n.event!=="turn_timing"||typeof n.ms!="number")return;t({turn:typeof n.turn=="number"?n.turn:0,ms:n.ms,status:typeof n.status=="string"?n.status:"unknown",sentAtMs:typeof n.sent_at_ms=="number"?n.sent_at_ms:null})}catch{}}function $t(e){let t={project_id:e.projectId,parts:e.parts.map(n=>({id:n.id,kind:n.kind,file:n.file,label:n.label,text:n.text.slice(0,De),cut:n.text.length>De})),truncated:e.truncated,use_cases:e.index,use_cases_total:e.project.useCases.length,known:e.project.known};return{type:"run_config",version:1,session_id:ae(),mode:"agent",verb:"impact",graph_reads:!0,max_free_text_rounds:0,existing_use_cases:[],read_basis:null,source:{source_id:"impact",source_cid:"",kind:"impact_input",numbered_text:JSON.stringify(t)}}}function Rt(e,t){if(typeof e!="object"||e===null)return null;let n=e;if(typeof n.rationale!="string"||!Array.isArray(n.use_cases)||!Array.isArray(n.tests)||!Array.isArray(n.not_affected))return null;let{project:s,tools:r}=t,o=(l,i)=>typeof l=="string"&&l.trim()!==""?l.trim().slice(0,i):null,f=l=>{if(typeof l=="string"&&l.trim().toLowerCase()===N)return N;let i=s.find(l,"usecase");return i?i.name??i.cid:null},d=l=>{let i=s.find(l,"test");return i?i.name??i.cid:null},u=new Map(t.parts.map(l=>[l.id.toLowerCase(),l.id])),m=o(n.rationale,_t);if(m===null)return null;let g=[];for(let l of n.use_cases){let i=f(l?.id),h=o(l?.reason,yt);if(!i||!h)return null;g.some(c=>c.id===i)||g.push({id:i,reason:h})}let w=[];for(let l of n.tests){let i=d(l?.id),h=o(l?.reason,bt),c=xt.find(y=>y===l?.confidence);if(!i||!h||!c||w.some(y=>y.id===i)||!r.opened.tests.has(i)&&!r.opened.listed.has(i))return null;let I=Array.isArray(l.parts)?l.parts.map(y=>typeof y=="string"?u.get(y.trim().toLowerCase()):void 0):[];if(I.some(y=>y===void 0))return null;w.push({id:i,confidence:c,parts:[...new Set(I)],reason:h})}let a=[];for(let l of n.not_affected){let i=d(l?.id),h=o(l?.reason,kt);if(!i||!h)return null;(r.opened.tests.has(i)||r.opened.listed.has(i))&&!w.some(I=>I.id===i)&&!a.some(I=>I.id===i)&&a.push({id:i,reason:h})}return{rationale:m,useCases:g,tests:w,notAffected:a}}var Et="No shared work in this project yet: nothing to trace",Ot="The input holds no change: nothing to trace",St="Reviewing the change with AI (this can take a few minutes)\u2026",Pt=1e4,Be={high:0,medium:1,low:2},Mt={high:"High",medium:"Medium",low:"Low"},jt=3,Lt={turn_cap:"the AI review ran out of turns before it answered",unreachable:"the AI review couldn't be reached",invalid_answer:"the AI review didn't give a usable answer",timeout:"the AI review didn't answer within 10 minutes",stopped:"the AI review stopped before it answered"},Ut=async e=>ce({url:e,basicAuth:await pe()}),Dt=()=>({code:"IMPACT_LINKED_ONLY",message:"kane-cli context impact reads a shared project's tests: run it in a folder linked to one",remedy:`to link this folder to the shared project and bring its tests, run:
9
9
  kane-cli context pull --project <id>`,next:[{cmd:"kane-cli context pull --project <id>",why:"link this folder to the shared project and bring its tests"}]}),Ft=e=>({code:"USAGE",message:`--input ${e} couldn't be read`,remedy:"check the file's path, then run the command again"}),Gt=e=>({code:"IMPACT_FAILED",message:`the tests of "${e}" couldn't be read, so nothing was traced`,remedy:"run the command again",support:!0}),Bt=e=>({code:"IMPACT_REVIEW_FAILED",message:`${Lt[e]}, so no tests were picked`,remedy:"run the command again",support:!0});async function $n(e,t=ye(),n=process.cwd(),s={}){let r=e.mode==="agent"||e.mode==="ci",o=s.now??Date.now,f=o(),d=()=>o()-f,u=t.err??t.out,m=le("ndjson","impact",{stdout:p=>t.out(p.replace(/\n$/,"")),stderr:p=>u(p.replace(/\n$/,""))}),g=(p,R)=>r?(m.event({type:"error",code:p.code,message:p.message,...me(p)}),m.done(R)):(ee(p),R),w={part:p=>p,useCase:p=>p,width:s.width??process.stderr.columns},a=(p,R={})=>{r?m.event({type:"impact_progress",stage:p,...R,elapsed_ms:d()}):u(Ht(p,R,d(),w))},l=[];for(let p of e.input)try{l.push({name:p,text:p==="-"?(s.stdin??(()=>Ge(0,"utf8")))():Ge(Nt(n,p),"utf8")})}catch{return g(Ft(p),2)}let i=await(s.entry??be)("context impact",r);if(i!==null&&"exit"in i)return i.exit;if(i===null)return g(Dt(),2);let{choice:h}=i,c={read_change_ms:null,read_project_ms:null,reads:null,agent_start_ms:null,turns:[],tools:[],review_ms:null,print_ms:null,total_ms:null,parts:null,use_cases:null,tests:null,use_cases_opened:0,tests_opened:0,cases_ms:null,cases_found:null,outcome:"started"},I=s.trace??K("context-impact"),y=p=>(c.total_ms=d(),I(`impact: timing ${JSON.stringify(c)}`),s.telemetry?.event("ASR_IMPACT_TIMING",Yt(c)),p),_=o(),{parts:A,truncated:b}=Ie(l);w.part=p=>A.find(R=>R.id===p)?.label??p,c.read_change_ms=o()-_,c.parts=A.length,a("reading_change",{parts:A.length}),_=o();let x,C,M,W=()=>0,v,k=new Map;try{let p=Ae(await(s.person??Ut)(h.latticeUrl));W=p.reads,v=p.client,C=Ce(p.client,h.projectId);let R=await xe(p.client,h.projectId);x=R===null?null:je(R,C),R!==null&&(k=ve(R)),M=x===null?[]:await x.index(0)}catch(p){return c.reads=W(),c.outcome="read_failed",y(await Z(p,g(...Kt(p,h.projectName))))}c.read_project_ms=o()-_,w.useCase=p=>p===N?H:x?.find(p,"usecase")?.title||p,c.reads=W(),c.use_cases=x?.useCases.length??0,c.tests=x?.tests.length??0,a("reading_project",{use_cases:c.use_cases,tests:c.tests});let L=[..._e(we(n))],P=p=>{let R=L.filter(([G])=>G.toLowerCase()===p.toLowerCase()).flatMap(([,G])=>G);return R.length===1?Tt(n,R[0]):null},X={id:h.projectId,name:h.projectName};if(x===null||x.tests.length===0||A.length===0){let p=x===null||x.tests.length===0?Et:Ot;return c.outcome="nothing",_=o(),r?(m.event(We(X,p,A,{rationale:p,useCases:[],tests:[],notAffected:[]},x,P,()=>null)),m.event({type:"done",status:"complete",exit_code:0,next:[]})):t.out(p),c.print_ms=o()-_,y(0)}let U=Ue(x,A,C),$=Vt(v,h.projectId,o);a("reviewing");let O=setInterval(()=>a("waiting"),s.waitingMs??Pt);O.unref?.();let T=null;_=o();let D=await(s.review??Fe)({projectId:h.projectId,parts:A,truncated:b,project:x,index:M,tools:U},{trace:I,onStart:()=>{T=Date.now()},onOpened:p=>a("opened",{what:p.what,ids:p.ids}),onTool:p=>{c.tools.push({name:p.name,ms:p.ms,bytes:p.bytes})},onTurn:p=>{c.turns.length===0&&T!==null&&p.sentAtMs!==null&&(c.agent_start_ms=Math.max(0,p.sentAtMs-T)),c.turns.push({turn:p.turn,ms:p.ms,status:p.status})}}).finally(()=>clearInterval(O));if(c.review_ms=o()-_,c.use_cases_opened=U.opened.useCases.size,c.tests_opened=U.opened.tests.size,!D.ok){c.outcome=`failed_${D.cause}`,de(`impact_review_${D.cause}`);let p=Bt(D.cause);return r?(m.event({type:"error",code:p.code,cause:D.cause,message:p.message}),m.event({type:"done",status:"failed",exit_code:1,next:[]})):ee(p),y(await Z(null,1))}let F=await $.within(s.caseBudgetMs??fe);c.cases_ms=F.ms,c.cases_found="cases"in F?[...F.cases.values()].filter(p=>p!==null).length:null,"why"in F&&I(`impact: case numbers not read (${F.why}): every test_case is null`);let He="cases"in F?F.cases:new Map,Ye=p=>{let R=x.find(p,"test");return(R&&k.get(R.cid)?.map(G=>He.get(G)??null).find(G=>G!==null))??null};_=o();let Q=We(X,D.answer.rationale,A,D.answer,x,P,Ye),ie=Jt(Q.run,e.input);return r?(m.event(Q),m.event({type:"done",status:"complete",exit_code:0,next:ie.map(p=>({cmd:`${p.cmd} ${p.agentFlag}`,why:p.why}))})):Wt(t,Q,A,b,ie),c.print_ms=o()-_,c.outcome="complete",y(0)}function We(e,t,n,s,r,o,f){let d=new Map(n.map(i=>[i.id.toLowerCase(),i.label])),u=i=>i.replace(/\bc\d+\b/gi,h=>d.get(h.toLowerCase())??h),m=new Set(s.useCases.map(i=>i.id)),g=i=>r?.find(i,"test")?.title??"",w=s.tests.map((i,h)=>({t:i,order:h})).sort((i,h)=>Be[i.t.confidence]-Be[h.t.confidence]||i.order-h.order).map(({t:i})=>{let h=r?.find(i.id,"test")??null;return{id:i.id,test_case:f(i.id),title:h?.title??"",path:o(i.id),use_case:h&&r?r.useCaseOf(h.cid,m):null,confidence:i.confidence,parts:i.parts,reason:u(i.reason)}}),a=new Set(w.flatMap(i=>i.parts)),l=i=>w.filter(h=>h.confidence===i).length;return{type:"impact_result",v:2,project:e,summary:{run:w.length,high:l("high"),medium:l("medium"),low:l("low"),not_affected:s.notAffected.length,parts:n.length},why:u(t),parts:n.filter(i=>a.has(i.id)).map(i=>({id:i.id,kind:i.kind,file:i.file,label:i.label})),use_cases:s.useCases.map(i=>({id:i.id,title:i.id===N?H:r?.find(i.id,"usecase")?.title??"",reason:u(i.reason)})),run:w,not_affected:s.notAffected.map(i=>({id:i.id,test_case:f(i.id),title:g(i.id),path:o(i.id),reason:u(i.reason)})),paths:[...new Set(w.map(i=>i.path).filter(i=>i!==null))]}}function Wt(e,t,n,s,r){let o=process.stdout.columns,f=(d,u="")=>(o?he(d,o-u.length):d).split(`
10
10
  `).map(m=>u+m).join(`
11
11
  `);if(e.out(`Affected tests: ${t.run.length} (from ${Xt(n)})`),s&&e.out(`Only the first ${n.length} parts of the change were read`),e.out(f(`Why: ${t.why}`)),t.use_cases.length>0&&(e.out(""),e.out(f(`Use cases: ${t.use_cases.map(d=>d.title||d.id).join("; ")}`))),t.run.length>0){e.out(""),e.out(t.run.length===1?"Run this test":`Run these ${t.run.length} tests`);let d=Math.max(...t.run.map(g=>g.id.length)),u=Math.max(0,...t.run.map(g=>g.test_case?.length??0)),m=g=>u===0?"":`${(g??"").padEnd(u)} `;for(let g of["high","medium","low"]){let w=t.run.filter(a=>a.confidence===g);if(w.length!==0){e.out(` ${Mt[g]} (${w.length})`);for(let a of w)e.out(` ${a.id.padEnd(d)} ${m(a.test_case)}${a.title}`),e.out(f(a.reason," ".repeat(6+d+m(null).length)))}}}if(e.out(`Not affected: ${t.not_affected.length} (of the tests the AI checked)`),r.length!==0){if(r[0].cmd.startsWith("kane-cli testrun run")){e.out("Run them:"),e.out(" kane-cli testrun run \\"),t.paths.forEach((d,u)=>e.out(` ${oe(d)}${u<t.paths.length-1?" \\":""}`));return}e.out("Run them: first bring the project's tests into this folder");for(let d of r)e.out(`next: ${d.cmd}`),d.note&&e.out(` ${d.note}`)}}function Xt(e){let t=`${e.length} ${e.length===1?"part":"parts"}`,n=[...new Set(e.map(f=>f.file).filter(f=>f!==null))],s=n.slice(0,jt),r=n.length-s.length,o=[...s,...r>0?[`${r} more ${r===1?"file":"files"}`]:[],...e.some(f=>f.file===null)?["the text"]:[]];return n.length===0?`${t} of the text`:`${t} of the change in ${o.length===1?o[0]:`${o.slice(0,-1).join(", ")} and ${o.at(-1)}`}`}function Ht(e,t,n,s){let r=f=>typeof t[f]=="number"?t[f]:0,o=Array.isArray(t.ids)?t.ids:[];return e==="reading_change"?`Reading the change: ${r("parts")} ${r("parts")===1?"part":"parts"}`:e==="reading_project"?`Reading the project: ${r("use_cases")} use ${r("use_cases")===1?"case":"cases"}, ${r("tests")} ${r("tests")===1?"test":"tests"}`:e==="reviewing"?St:e==="waiting"?`Still reviewing (${Math.round(n/1e3)} s)\u2026`:t.what==="use_cases"?Xe("Checking use cases: ",o.map(s.useCase),"; ",s.width,f=>` and ${f} more`):t.what==="tests"?Xe(`Checking ${o.length} ${o.length===1?"test":"tests"}: `,o,", ",s.width,()=>", \u2026"):t.what==="parts"?`Reading in full: ${o.map(s.part).join("; ")}`:"Reading more use cases"}function Xe(e,t,n,s,r){let o=e+t.join(n);if(!s||o.length<=s)return o;for(let f=t.length-1;f>1;f--){let d=e+t.slice(0,f).join(n)+r(t.length-f);if(d.length<=s)return d}return e+t[0]+(t.length>1?r(t.length-1):"")}function Yt(e){let t=s=>s.reduce((r,o)=>r+o,0),n={read_change_ms:e.read_change_ms,read_project_ms:e.read_project_ms,reads:e.reads,agent_start_ms:e.agent_start_ms,turns:e.turns.length,turn_ms_total:t(e.turns.map(s=>s.ms)),turn_ms_max:Math.max(0,...e.turns.map(s=>s.ms)),tool_calls:e.tools.length,tool_ms_total:t(e.tools.map(s=>s.ms)),tool_bytes_total:t(e.tools.map(s=>s.bytes)),review_ms:e.review_ms,print_ms:e.print_ms,total_ms:e.total_ms,parts:e.parts,use_cases:e.use_cases,tests:e.tests,use_cases_opened:e.use_cases_opened,tests_opened:e.tests_opened,cases_ms:e.cases_ms,cases_found:e.cases_found,outcome:e.outcome};return Object.fromEntries(Object.entries(n).filter(([,s])=>s!==null))}function Jt(e,t){if(e.length===0)return[];let n=[...new Set(e.map(s=>s.path))];if(n.includes(null)){let s=t.includes("-"),r=s?"trace again with the tests in place: pass the same change on stdin again":"trace again with the tests in place";return[{cmd:"kane-cli context pull",why:"bring the project's tests into this folder",agentFlag:"--mode agent"},{cmd:`kane-cli context impact --input ${t.map(oe).join(" ")}`,why:r,agentFlag:"--mode agent",...s?{note:r}:{}}]}return[{cmd:`kane-cli testrun run ${n.map(oe).join(" ")}`,why:"run the affected tests",agentFlag:"--agent"}]}function Vt(e,t,n){let s=n(),r=e.testCases(t).then(o=>({cases:o,ms:n()-s}),o=>({why:o instanceof S?`${o.status} ${o.code}`:o instanceof Error?o.name:"failed",ms:n()-s}));return{within:o=>ge(r,o).catch(()=>({why:`late, over ${o} ms`,ms:n()-s}))}}var oe=e=>/^[\w./:=@%+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`;function Kt(e,t){return e instanceof ue?[{code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}},2]:e instanceof S&&e.retryable?[V.noConnection(),2]:e instanceof S&&e.status===401?[V.credentialsRejected(),2]:e instanceof S&&(e.code==="NOT_FOUND"||e.status===403||e.status===404)?[V.noAccess(t),2]:[Gt(t),1]}export{Et as NOTHING_SHARED,Ot as NO_CHANGE,St as REVIEWING,$n as runImpact};