@testmuai/kane-cli 0.10.2 → 0.10.3

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 (249) hide show
  1. package/dist/{ChatSurface-FIYDTZSI.js → ChatSurface-Z26BOE5U.js} +1 -1
  2. package/dist/{ChromeProfilePicker-Q6FIGVYU.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-2NV2G65E.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
  4. package/dist/{CliUploadProgress-JZ5FXODE.js → CliUploadProgress-XFRRFRL4.js} +1 -1
  5. package/dist/{ConfigView-TZ4YINOE.js → ConfigView-6JF4DOJN.js} +1 -1
  6. package/dist/{EvidenceViewOffer-LKPN5BHX.js → EvidenceViewOffer-6344EX74.js} +1 -1
  7. package/dist/FolderPicker-4PCYHE75.js +2 -0
  8. package/dist/InfoBox-NJ2DL7YC.js +2 -0
  9. package/dist/{LinksBox-32TZOANP.js → LinksBox-HNDNFVUT.js} +1 -1
  10. package/dist/{ProfilesView-UC4MPM54.js → ProfilesView-DEJKJOHY.js} +1 -1
  11. package/dist/ProjectPicker-DTWMWOH7.js +2 -0
  12. package/dist/SaveSessionPrompt-3GCLB3ZT.js +2 -0
  13. package/dist/SingleShotApp-HMOXO5DW.js +2 -0
  14. package/dist/{SummaryBox-XGFO5X76.js → SummaryBox-7PPDMSSM.js} +1 -1
  15. package/dist/TestMdRunView-QLKRUU4V.js +2 -0
  16. package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
  17. package/dist/{WhoamiView-4XIJXMTU.js → WhoamiView-H7JNLLCY.js} +1 -1
  18. package/dist/{app-download-XEDO3EMV.js → app-download-GKRF2EIM.js} +1 -1
  19. package/dist/{assurance-job-MD65GQLC.js → assurance-job-F4L3T4VJ.js} +1 -1
  20. package/dist/{binary-NVYLR36K.js → binary-K3XMILST.js} +1 -1
  21. package/dist/{bind-H3ALI2NG.js → bind-SSHAZAB3.js} +1 -1
  22. package/dist/{bootstrap-JEVSVPQ2.js → bootstrap-XGKU4WXB.js} +1 -1
  23. package/dist/{catalog-5UYBWA4W.js → catalog-YCU6OHNV.js} +1 -1
  24. package/dist/{catalog-client-VVKV4JKW.js → catalog-client-MVEEHTG2.js} +1 -1
  25. package/dist/{changelog-FPWJXERY.js → changelog-5UB3AQT6.js} +1 -1
  26. package/dist/{chunk-GJ7MO2FW.js → chunk-2JFRN62I.js} +2 -2
  27. package/dist/chunk-2RBMQTYS.js +26 -0
  28. package/dist/{chunk-44SIFDNY.js → chunk-2TK4MDF2.js} +1 -1
  29. package/dist/{chunk-P4VFC6HO.js → chunk-35WUYKGO.js} +1 -1
  30. package/dist/{chunk-XCUF5AVM.js → chunk-3MD2XLE7.js} +2 -2
  31. package/dist/{chunk-TMH4TPMB.js → chunk-3NWUXRSI.js} +1 -1
  32. package/dist/{chunk-NVD2MXHQ.js → chunk-3RO2YGKH.js} +1 -1
  33. package/dist/{chunk-QUNIY6NN.js → chunk-3ZC7GSMM.js} +1 -1
  34. package/dist/{chunk-LXCTV75T.js → chunk-4CJQ7XZP.js} +1 -1
  35. package/dist/{chunk-LWCP4GLY.js → chunk-4KL3TSTT.js} +5 -5
  36. package/dist/{chunk-2ULYGALF.js → chunk-4UX5N7YI.js} +1 -1
  37. package/dist/{chunk-5KJU4MG4.js → chunk-5YYCCM6K.js} +1 -1
  38. package/dist/{chunk-IT5JVCZN.js → chunk-6FFX4S7N.js} +1 -1
  39. package/dist/{chunk-HM6LZ2KM.js → chunk-6HRNG4CK.js} +1 -1
  40. package/dist/{chunk-OK6NLITG.js → chunk-6QCCTZO3.js} +1 -1
  41. package/dist/{chunk-ZZZGTDYE.js → chunk-6QH75BPJ.js} +1 -1
  42. package/dist/{chunk-6SWHEBPR.js → chunk-7RELCXRW.js} +1 -1
  43. package/dist/{chunk-S7XCOBYD.js → chunk-7SU53QGU.js} +1 -1
  44. package/dist/{chunk-6JUS2ULI.js → chunk-7Y55CO42.js} +1 -1
  45. package/dist/{chunk-B57ZRHEQ.js → chunk-7YV2FCN4.js} +1 -1
  46. package/dist/{chunk-PC22QRIY.js → chunk-A2DODRHG.js} +1 -1
  47. package/dist/{chunk-ABMM37L2.js → chunk-AHT2ORJT.js} +1 -1
  48. package/dist/{chunk-A7IMHUFY.js → chunk-AT7AT3AR.js} +2 -2
  49. package/dist/{chunk-5WLXAQ4H.js → chunk-AVLYSNEG.js} +1 -1
  50. package/dist/{chunk-ZO3ZAMUU.js → chunk-BBJAKSA7.js} +1 -1
  51. package/dist/{chunk-DLP5S3TO.js → chunk-BJO6J5X2.js} +1 -1
  52. package/dist/{chunk-EEOAU43D.js → chunk-BLVDV3QQ.js} +1 -1
  53. package/dist/{chunk-I52NWH4U.js → chunk-C4KAPGBS.js} +1 -1
  54. package/dist/{chunk-7O2FIZB7.js → chunk-CB2BWDHG.js} +2 -2
  55. package/dist/{chunk-HWPWCCEV.js → chunk-CNHKZE4F.js} +1 -1
  56. package/dist/{chunk-5F44KH3R.js → chunk-CTHUX7O4.js} +1 -1
  57. package/dist/{chunk-FYPIF3BE.js → chunk-DC5F2ADJ.js} +1 -1
  58. package/dist/chunk-DIOK3SER.js +34 -0
  59. package/dist/{chunk-NCP54AIQ.js → chunk-DQXQJJOP.js} +2 -2
  60. package/dist/{chunk-W2HRX3DR.js → chunk-EBJW6POT.js} +1 -1
  61. package/dist/{chunk-GZQAETB2.js → chunk-EJGCIGQY.js} +1 -1
  62. package/dist/{chunk-7ZR5CQY3.js → chunk-ERRIDBE7.js} +1 -1
  63. package/dist/chunk-F2F257PU.js +6 -0
  64. package/dist/{chunk-EAWU2TOG.js → chunk-GQAWZEA4.js} +1 -1
  65. package/dist/{chunk-2QKBXRLI.js → chunk-GXQYFOBD.js} +1 -1
  66. package/dist/{chunk-RRKYHUOD.js → chunk-HBLHKQR7.js} +1 -1
  67. package/dist/chunk-HC6VLPUB.js +5 -0
  68. package/dist/{chunk-JUVY6PHY.js → chunk-HRIDAK6Y.js} +1 -1
  69. package/dist/{chunk-5MFPQYW3.js → chunk-HV2CDY4K.js} +1 -1
  70. package/dist/{chunk-YO6SNXBJ.js → chunk-IEHJG6J4.js} +1 -1
  71. package/dist/{chunk-FAMQ4DHU.js → chunk-J4FIESTB.js} +1 -1
  72. package/dist/{chunk-UICJ2KLJ.js → chunk-JBKHX5ES.js} +1 -1
  73. package/dist/{chunk-6CS23F3E.js → chunk-KBGMQYMD.js} +1 -1
  74. package/dist/{chunk-ZDQYGLCZ.js → chunk-KCXLRR3Q.js} +1 -1
  75. package/dist/{chunk-KN7GZWKK.js → chunk-KL7XFNSD.js} +1 -1
  76. package/dist/{chunk-V3OZJO7Y.js → chunk-KQ4XKTIZ.js} +1 -1
  77. package/dist/{chunk-PR5EGLEI.js → chunk-LHJSIHLC.js} +1 -1
  78. package/dist/{chunk-75FF7J5R.js → chunk-LPJKNX6D.js} +1 -1
  79. package/dist/{chunk-3V4J65GN.js → chunk-LRNUGKYH.js} +1 -1
  80. package/dist/{chunk-POA336CU.js → chunk-LUA25RYS.js} +1 -1
  81. package/dist/{chunk-BHQIH2FE.js → chunk-LV7224DG.js} +1 -1
  82. package/dist/{chunk-73HMW2WA.js → chunk-LXK4B2FE.js} +1 -1
  83. package/dist/{chunk-PWNYTIVA.js → chunk-M2E5CPPV.js} +1 -1
  84. package/dist/{chunk-OVNTCBNS.js → chunk-M7A66MSK.js} +1 -1
  85. package/dist/{chunk-MP6NCJFE.js → chunk-MD3RABID.js} +1 -1
  86. package/dist/{chunk-AUSLHNXQ.js → chunk-MEBEVHGP.js} +1 -1
  87. package/dist/{chunk-C6P6YUCR.js → chunk-N7IWR45S.js} +1 -1
  88. package/dist/{chunk-M3TFOFUQ.js → chunk-ND6OP3O2.js} +1 -1
  89. package/dist/{chunk-226AGYHB.js → chunk-NHGPMYM3.js} +1 -1
  90. package/dist/{chunk-VE4HLIGA.js → chunk-NI3TIAD7.js} +1 -1
  91. package/dist/{chunk-GQARXS6F.js → chunk-NPAUSUNM.js} +1 -1
  92. package/dist/{chunk-HX5OLRKU.js → chunk-NRAPCFI2.js} +2 -2
  93. package/dist/{chunk-RAVAJZV2.js → chunk-NZJSGINB.js} +16 -16
  94. package/dist/{chunk-X3A4QPA3.js → chunk-OBNVGD5H.js} +1 -1
  95. package/dist/{chunk-Q5AKIQIE.js → chunk-OCMPWCKQ.js} +1 -1
  96. package/dist/{chunk-BJT6PZXL.js → chunk-OCVDMZWB.js} +1 -1
  97. package/dist/{chunk-XZ6J3Y2W.js → chunk-OHGL4GEJ.js} +1 -1
  98. package/dist/{chunk-54NJJVG5.js → chunk-OOGKX4Y6.js} +1 -1
  99. package/dist/{chunk-UMNCM4RJ.js → chunk-OTMHCHH6.js} +2 -2
  100. package/dist/{chunk-45NM23EQ.js → chunk-OZNYQONA.js} +1 -1
  101. package/dist/{chunk-D4QXYAYA.js → chunk-PB6RXDWQ.js} +2 -2
  102. package/dist/{chunk-2GEAKFAV.js → chunk-PCQK62MP.js} +1 -1
  103. package/dist/{chunk-HHOVANJ7.js → chunk-PTLOOVV4.js} +1 -1
  104. package/dist/{chunk-QB77LRF4.js → chunk-Q4ALB7SH.js} +1 -1
  105. package/dist/{chunk-A474TUCE.js → chunk-Q4SMITTV.js} +1 -1
  106. package/dist/{chunk-HNF3PWF3.js → chunk-QE4AWNOV.js} +3 -3
  107. package/dist/{chunk-6YBH3WUW.js → chunk-QEM5ZRDN.js} +1 -1
  108. package/dist/{chunk-MSYRAPDK.js → chunk-QHH42RH5.js} +1 -1
  109. package/dist/{chunk-IB5WG5YY.js → chunk-RNHSULQM.js} +1 -1
  110. package/dist/chunk-SB26HQO7.js +2 -0
  111. package/dist/{chunk-QVMXL675.js → chunk-SJQTTEXQ.js} +1 -1
  112. package/dist/{chunk-UCVP7ZY4.js → chunk-SMGRXKXX.js} +1 -1
  113. package/dist/{chunk-RDAIOJCR.js → chunk-SXBPUUQ5.js} +1 -1
  114. package/dist/{chunk-K75WIRI5.js → chunk-TM45NPWL.js} +1 -1
  115. package/dist/{chunk-7DLDADQR.js → chunk-TUSG7DIL.js} +1 -1
  116. package/dist/{chunk-K4K2BGQC.js → chunk-UJ37XGSP.js} +3 -3
  117. package/dist/{chunk-DXLZCJH5.js → chunk-ULIIYKZB.js} +1 -1
  118. package/dist/{chunk-7PCLHURF.js → chunk-UXGMKRS4.js} +61 -60
  119. package/dist/{chunk-IH73ZCBB.js → chunk-VCVEZEVS.js} +1 -1
  120. package/dist/{chunk-XNXJXGVB.js → chunk-VKVYT6KZ.js} +2 -2
  121. package/dist/{chunk-PEUIHME2.js → chunk-VO2NNXKR.js} +1 -1
  122. package/dist/{chunk-H4TIVILC.js → chunk-WE7HRAGO.js} +1 -1
  123. package/dist/{chunk-O5KTMDTH.js → chunk-WIVKLNIO.js} +1 -1
  124. package/dist/chunk-WLEWXE6L.js +2 -0
  125. package/dist/{chunk-3YIA3DSL.js → chunk-X2MDL6S4.js} +1 -1
  126. package/dist/{chunk-M7Y5GGVJ.js → chunk-X45RZIAJ.js} +1 -1
  127. package/dist/{chunk-4LGQHTXM.js → chunk-XKOVEMVZ.js} +1 -1
  128. package/dist/{chunk-4HARMERK.js → chunk-Y2HQMJGS.js} +1 -1
  129. package/dist/{chunk-B226SFOV.js → chunk-Y3RJHWNK.js} +1 -1
  130. package/dist/{chunk-4HYPMGDF.js → chunk-YCVEI7BT.js} +1 -1
  131. package/dist/{chunk-HG2ILWCE.js → chunk-YILRYMMG.js} +1 -1
  132. package/dist/{chunk-2COXO5LQ.js → chunk-YNDELIXL.js} +1 -1
  133. package/dist/{chunk-4NEPHIAO.js → chunk-YPGZ5E4I.js} +1 -1
  134. package/dist/{chunk-GT3JDX5H.js → chunk-YQZ736IQ.js} +1 -1
  135. package/dist/{chunk-XHFU5TGS.js → chunk-YVVFXBT5.js} +1 -1
  136. package/dist/{chunk-ET5EK2CM.js → chunk-YWWVF5OU.js} +1 -1
  137. package/dist/{chunk-OKA6FPJM.js → chunk-Z47ZEFH7.js} +1 -1
  138. package/dist/{chunk-FI2DVNRT.js → chunk-ZCBOHWN3.js} +1 -1
  139. package/dist/{chunk-7XJNYLQW.js → chunk-ZIHQ5JGB.js} +4 -4
  140. package/dist/{chunk-Z6SI7YNV.js → chunk-ZMIKNNO6.js} +1 -1
  141. package/dist/{chunk-O3TXAMFW.js → chunk-ZPU3WAC4.js} +1 -1
  142. package/dist/{commands-R5AYK6XM.js → commands-JBFLLT7A.js} +1 -1
  143. package/dist/{config-YMHI3H3Y.js → config-7WTZPMAH.js} +1 -1
  144. package/dist/{cover-cmd-DVQIGFDY.js → cover-cmd-DU6ZYJFL.js} +1 -1
  145. package/dist/{credentials-BCR73VGS.js → credentials-5WIFF5DG.js} +1 -1
  146. package/dist/{deps-bundle-6WLX44OA.js → deps-bundle-BLLJ2BQ4.js} +1 -1
  147. package/dist/{deps-resolve-DSAKPZ3T.js → deps-resolve-WQ6J6RLI.js} +1 -1
  148. package/dist/{design-chat-YUI2JPO6.js → design-chat-ZICGVYIH.js} +1 -1
  149. package/dist/{design-headless-KIP6R7UV.js → design-headless-HYWZIIDS.js} +1 -1
  150. package/dist/{design-remote-XMSHDDUX.js → design-remote-HPX4VZ63.js} +2 -2
  151. package/dist/device-env-4P4GUVBW.js +2 -0
  152. package/dist/{doctor-PGTNOMSP.js → doctor-Z2YQ2DBX.js} +1 -1
  153. package/dist/{evidence-RO3RDZXO.js → evidence-BJIID6VT.js} +1 -1
  154. package/dist/{evolve-cmd-U2ALVGMT.js → evolve-cmd-GZCUSCEK.js} +1 -1
  155. package/dist/{evolve-remote-K2MCCVMM.js → evolve-remote-LILOAHYH.js} +1 -1
  156. package/dist/{explain-cmd-UWK5YVXG.js → explain-cmd-LXIVHGN7.js} +1 -1
  157. package/dist/explore-SA2P3SGX.js +2 -0
  158. package/dist/{explore-context-tty-WJHUSP3A.js → explore-context-tty-PERKIWXD.js} +1 -1
  159. package/dist/{explore-entry-3EX2T3NS.js → explore-entry-E6EY3VV3.js} +4 -4
  160. package/dist/{explore-live-TRY5A2ME.js → explore-live-XIWWUV52.js} +1 -1
  161. package/dist/{explore-run-tty-ZV5XFKZA.js → explore-run-tty-M56I23IF.js} +2 -2
  162. package/dist/{extract-bind-TXUBMK3T.js → extract-bind-LZ22VFKB.js} +3 -3
  163. package/dist/{extract-chat-VPYDGQKO.js → extract-chat-Z64LEAJ5.js} +1 -1
  164. package/dist/{extract-cmd-YUOYMVF5.js → extract-cmd-46E2XDWZ.js} +2 -2
  165. package/dist/{extract-headless-UWTAPOET.js → extract-headless-XLS56LMN.js} +1 -1
  166. package/dist/{folder-flags-WV7UV3JG.js → folder-flags-ZIDJVDKX.js} +1 -1
  167. package/dist/{gaps-cmd-PFV3FZCM.js → gaps-cmd-XYOBJVTO.js} +1 -1
  168. package/dist/{gate-7ALXLCNB.js → gate-AK44VDHC.js} +1 -1
  169. package/dist/{generate-headless-KMBBZTLS.js → generate-headless-HXAVEAEZ.js} +2 -2
  170. package/dist/{impact-cmd-PW33L5RF.js → impact-cmd-TJTUFAFO.js} +2 -2
  171. package/dist/index.js +162 -157
  172. package/dist/{ingest-cmd-MXYILQLV.js → ingest-cmd-OJSKTSQK.js} +3 -3
  173. package/dist/{ingest-remote-2EEJP6ML.js → ingest-remote-2WM6PYUW.js} +1 -1
  174. package/dist/install-JBWBF3WX.js +2 -0
  175. package/dist/{interactive-bind-FDWJUTI6.js → interactive-bind-SOD7VTAY.js} +2 -2
  176. package/dist/{interactive-remote-O2Q2FNOH.js → interactive-remote-7ZSTI66T.js} +1 -1
  177. package/dist/{lattice-auth-TXNDLHM6.js → lattice-auth-UQPFQSG7.js} +1 -1
  178. package/dist/{lifecycle-cmd-GFHDBRXX.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
  179. package/dist/{list-cmd-RR75PMPE.js → list-cmd-HQIN3HX4.js} +1 -1
  180. package/dist/{list-commands-3QGZWJ5P.js → list-commands-OFRRBU3D.js} +1 -1
  181. package/dist/{list-remote-AA3VSWOI.js → list-remote-EFCET42K.js} +1 -1
  182. package/dist/login-flow-SYKXXDLH.js +2 -0
  183. package/dist/{maintenance-cmd-OHGVARQ2.js → maintenance-cmd-X5247RSJ.js} +1 -1
  184. package/dist/{mobile-prompts-FZRKLLTN.js → mobile-prompts-I66ENBDW.js} +1 -1
  185. package/dist/{onboarding-NXGMV3VG.js → onboarding-6HIP3KW6.js} +1 -1
  186. package/dist/{persist-recorded-session-INFN4JZT.js → persist-recorded-session-RSSMTVF3.js} +1 -1
  187. package/dist/pipeline-NTJDH5TC.js +2 -0
  188. package/dist/{policy-commands-3YJ6YCDN.js → policy-commands-4PUGESCW.js} +1 -1
  189. package/dist/{prepare-target-DII5WZCX.js → prepare-target-AI3GGZF6.js} +1 -1
  190. package/dist/{pull-cmd-XZN53XFZ.js → pull-cmd-NRVB5ZN7.js} +1 -1
  191. package/dist/{pull-route-R33BVADE.js → pull-route-FWCZW76M.js} +1 -1
  192. package/dist/real-device-run-NQ7RNH7C.js +2 -0
  193. package/dist/{reconcile-cmd-KFPRCCJB.js → reconcile-cmd-7B7THAFJ.js} +4 -4
  194. package/dist/{reconcile-remote-6WISFGRG.js → reconcile-remote-3W6ZTO3G.js} +2 -2
  195. package/dist/{recording-banner-XOX2CDCF.js → recording-banner-WVDTWTSE.js} +1 -1
  196. package/dist/registry-PFOSXOIH.js +2 -0
  197. package/dist/remote-entry-BZU4NFNS.js +2 -0
  198. package/dist/{remote-mode-4HN27MD4.js → remote-mode-NXUKDUXG.js} +1 -1
  199. package/dist/{remote-words-LFDYKIZ7.js → remote-words-JRDDNOZ6.js} +1 -1
  200. package/dist/{require-project-folder-ZK4JJCDB.js → require-project-folder-3DTI2CVB.js} +1 -1
  201. package/dist/{resolve-run-intent-LYLVNNDZ.js → resolve-run-intent-QCL7QXIB.js} +1 -1
  202. package/dist/{resolver-RMHGGYRP.js → resolver-CDF7QKVD.js} +1 -1
  203. package/dist/{review-cmd-UGF2FC5Y.js → review-cmd-XBK3TGRE.js} +1 -1
  204. package/dist/{run-remote-BGKQDAOA.js → run-remote-SFR3F2T5.js} +1 -1
  205. package/dist/{run-startup-gate-4XE73OON.js → run-startup-gate-QSFJRYUY.js} +1 -1
  206. package/dist/run-test-md-ZSREINDQ.js +20 -0
  207. package/dist/session-worker.js +2 -2
  208. package/dist/{sessions-cmd-CABAX7BO.js → sessions-cmd-TLUITRG5.js} +1 -1
  209. package/dist/{sessions-remote-Y4FTZL7Y.js → sessions-remote-INO7AWKB.js} +1 -1
  210. package/dist/{skill-installer-FS2AV7GX.js → skill-installer-7JH5QCJF.js} +1 -1
  211. package/dist/{store-PLKJZTGC.js → store-X4UK4AP7.js} +1 -1
  212. package/dist/{store-choice-UAB6Z4AL.js → store-choice-27HDIFTU.js} +1 -1
  213. package/dist/{store-guard-DUN2X3SR.js → store-guard-ZXKB5DQH.js} +1 -1
  214. package/dist/{sync-cmd-AGTOGPYM.js → sync-cmd-2PCO7LZA.js} +1 -1
  215. package/dist/{sync-setup-4KIY3PDO.js → sync-setup-5WQO73Y5.js} +1 -1
  216. package/dist/tcg-generate-DGJD5KSM.js +2 -0
  217. package/dist/{testmd-actions-UD6PAWUX.js → testmd-actions-XE2JPQHB.js} +1 -1
  218. package/dist/{testmd-sync-EEJ7GPLR.js → testmd-sync-LYHEXWCT.js} +1 -1
  219. package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
  220. package/dist/token-refresh-E4FTJVHY.js +2 -0
  221. package/dist/{validate-basic-3JZRZL45.js → validate-basic-66XDPA3S.js} +1 -1
  222. package/dist/{version-check-IY3YSQIP.js → version-check-SHNVYTMU.js} +1 -1
  223. package/dist/{view-cmd-WUIGTRFX.js → view-cmd-QOB3O6YW.js} +1 -1
  224. package/dist/{walk-session-EH7227WR.js → walk-session-WIEROYOT.js} +1 -1
  225. package/dist/{with-telemetry-7JMZUBUZ.js → with-telemetry-T2PWI5CY.js} +1 -1
  226. package/package.json +11 -11
  227. package/dist/FolderPicker-H5K74PCH.js +0 -2
  228. package/dist/InfoBox-DNSOAK5L.js +0 -2
  229. package/dist/ProjectPicker-ZJ5RW6XL.js +0 -2
  230. package/dist/SaveSessionPrompt-F327WC7A.js +0 -2
  231. package/dist/SingleShotApp-OMLRYOSI.js +0 -2
  232. package/dist/TestMdRunView-ZZ77QTAQ.js +0 -2
  233. package/dist/TestrunEvidenceTable-G7MPF55X.js +0 -2
  234. package/dist/chunk-6K5BEEAJ.js +0 -2
  235. package/dist/chunk-6LEHGRRG.js +0 -34
  236. package/dist/chunk-A4ZV2SHL.js +0 -5
  237. package/dist/chunk-O2Y46A3G.js +0 -26
  238. package/dist/chunk-Y6Y6RAY4.js +0 -2
  239. package/dist/device-env-K7J5NN66.js +0 -2
  240. package/dist/explore-S2BGQUIF.js +0 -2
  241. package/dist/install-7J34AYB6.js +0 -2
  242. package/dist/login-flow-ZQ6UFTS2.js +0 -2
  243. package/dist/pipeline-MVZRI6YZ.js +0 -2
  244. package/dist/real-device-run-DGENHGUV.js +0 -2
  245. package/dist/registry-NV3EMDMK.js +0 -2
  246. package/dist/remote-entry-BCTFT643.js +0 -2
  247. package/dist/run-test-md-G6U3RU2Q.js +0 -19
  248. package/dist/tcg-generate-CUY4AZ2V.js +0 -2
  249. package/dist/token-refresh-K6PVBBFE.js +0 -2
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-RZ4F3BHX.js";import{a as s,b as o,e as c}from"./chunk-FAMQ4DHU.js";import{readFileSync as f,writeFileSync as d,mkdirSync as g,realpathSync as h}from"fs";import{join as y}from"path";var C="npm install -g @testmuai/kane-cli@latest",b="brew upgrade lambdatest/kane/kane-cli";function N(){try{let t=process.argv[1];if(t&&h(t).includes("/Cellar/"))return b}catch{}return C}var m=y(o,"version-check.json"),w=1440*60*1e3;function A(){try{let t=JSON.parse(f(m,"utf-8"));if(Date.now()-t.checkedAt<w)return t}catch{}return null}function k(t){try{g(o,{recursive:!0}),d(m,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function u(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<3;i++){let a=(r[i]??0)-(n[i]??0);if(a!==0)return a}return 0}function p(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);return(r[0]??0)!==(n[0]??0)?"major":(r[1]??0)!==(n[1]??0)?"minor":"patch"}async function T(){try{let t=A();if(t)return u(s,t.latest)>0?{current:s,latest:t.latest,severity:p(s,t.latest)}:null;let e=new AbortController,n=setTimeout(()=>e.abort(),5e3),r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});if(clearTimeout(n),!r.ok)return null;let a=(await r.json())["dist-tags"]?.latest;return a?(k(a),u(s,a)>0?{current:s,latest:a,severity:p(s,a)}:null):null}catch{return null}}async function v(t=5e3){let e=new AbortController,n=setTimeout(()=>e.abort(),t);try{let r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});return r.ok?(await r.json())["dist-tags"]?.latest??null:null}catch{return null}finally{clearTimeout(n)}}export{N as a,u as b,p as c,T as d,v as e};
2
+ import{a as l}from"./chunk-RZ4F3BHX.js";import{a as s,b as o,e as c}from"./chunk-J4FIESTB.js";import{readFileSync as f,writeFileSync as d,mkdirSync as g,realpathSync as h}from"fs";import{join as y}from"path";var C="npm install -g @testmuai/kane-cli@latest",b="brew upgrade lambdatest/kane/kane-cli";function N(){try{let t=process.argv[1];if(t&&h(t).includes("/Cellar/"))return b}catch{}return C}var m=y(o,"version-check.json"),w=1440*60*1e3;function A(){try{let t=JSON.parse(f(m,"utf-8"));if(Date.now()-t.checkedAt<w)return t}catch{}return null}function k(t){try{g(o,{recursive:!0}),d(m,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function u(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<3;i++){let a=(r[i]??0)-(n[i]??0);if(a!==0)return a}return 0}function p(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);return(r[0]??0)!==(n[0]??0)?"major":(r[1]??0)!==(n[1]??0)?"minor":"patch"}async function T(){try{let t=A();if(t)return u(s,t.latest)>0?{current:s,latest:t.latest,severity:p(s,t.latest)}:null;let e=new AbortController,n=setTimeout(()=>e.abort(),5e3),r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});if(clearTimeout(n),!r.ok)return null;let a=(await r.json())["dist-tags"]?.latest;return a?(k(a),u(s,a)>0?{current:s,latest:a,severity:p(s,a)}:null):null}catch{return null}}async function v(t=5e3){let e=new AbortController,n=setTimeout(()=>e.abort(),t);try{let r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});return r.ok?(await r.json())["dist-tags"]?.latest??null:null}catch{return null}finally{clearTimeout(n)}}export{N as a,u as b,p as c,T as d,v as e};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as n}from"./chunk-K75WIRI5.js";import{y as s}from"./chunk-FAMQ4DHU.js";function E(t="prod",r=process.env){let e=s[t];return t!=="stage"?e:{authBaseUrl:r.KANE_STAGE_AUTH_URL??e.authBaseUrl,consentUrl:r.KANE_STAGE_CONSENT_URL??e.consentUrl,controllerBaseUrl:r.TESTMUAI_BASE_URL??e.controllerBaseUrl,tmsBaseUrl:r.KANE_STAGE_TMS_URL??e.tmsBaseUrl,testGeneratorBaseUrl:r.KANE_STAGE_TCG_URL??e.testGeneratorBaseUrl,secretsBaseUrl:r.KANE_STAGE_SECRETS_URL??e.secretsBaseUrl,testManagerUiUrl:r.KANE_STAGE_TEST_MANAGER_UI_URL??e.testManagerUiUrl,shareApiBaseUrl:r.KANE_STAGE_SHARE_API_URL??e.shareApiBaseUrl,v16ServerHost:r.KANE_STAGE_V16_SERVER_HOST??e.v16ServerHost,evidenceViewerUrl:r.KANE_STAGE_EVIDENCE_VIEWER_URL??e.evidenceViewerUrl,mediaArtefactsHost:r.KANE_STAGE_MEDIA_ARTEFACTS_HOST??e.mediaArtefactsHost,mobileAppBaseUrl:r.KANE_STAGE_MOBILE_APP_URL??e.mobileAppBaseUrl,mobileHubUrl:r.KANE_STAGE_MOBILE_HUB_URL??e.mobileHubUrl,lrmaaBaseUrl:r.KANE_STAGE_LRMAA_URL??e.lrmaaBaseUrl,latticeBaseUrl:r.KANE_LATTICE_URL??e.latticeBaseUrl,deviceStreamUrl:r.KANE_STAGE_DEVICE_STREAM_URL??e.deviceStreamUrl}}function U(){let t=process.env.TESTMUAI_ENV;return t!==void 0&&t!==""?t==="stage"?"stage":"prod":new n().getDefaultEnv()==="stage"?"stage":"prod"}function a(){let t=process.env.KANE_LATTICE_URL;return t!==void 0&&t.trim()===""?"":E(U()).latticeBaseUrl.trim()}export{E as a,U as b,a as c};
2
+ import{a as n}from"./chunk-TM45NPWL.js";import{y as s}from"./chunk-J4FIESTB.js";function E(t="prod",r=process.env){let e=s[t];return t!=="stage"?e:{authBaseUrl:r.KANE_STAGE_AUTH_URL??e.authBaseUrl,consentUrl:r.KANE_STAGE_CONSENT_URL??e.consentUrl,controllerBaseUrl:r.TESTMUAI_BASE_URL??e.controllerBaseUrl,tmsBaseUrl:r.KANE_STAGE_TMS_URL??e.tmsBaseUrl,testGeneratorBaseUrl:r.KANE_STAGE_TCG_URL??e.testGeneratorBaseUrl,secretsBaseUrl:r.KANE_STAGE_SECRETS_URL??e.secretsBaseUrl,testManagerUiUrl:r.KANE_STAGE_TEST_MANAGER_UI_URL??e.testManagerUiUrl,shareApiBaseUrl:r.KANE_STAGE_SHARE_API_URL??e.shareApiBaseUrl,v16ServerHost:r.KANE_STAGE_V16_SERVER_HOST??e.v16ServerHost,evidenceViewerUrl:r.KANE_STAGE_EVIDENCE_VIEWER_URL??e.evidenceViewerUrl,mediaArtefactsHost:r.KANE_STAGE_MEDIA_ARTEFACTS_HOST??e.mediaArtefactsHost,mobileAppBaseUrl:r.KANE_STAGE_MOBILE_APP_URL??e.mobileAppBaseUrl,mobileHubUrl:r.KANE_STAGE_MOBILE_HUB_URL??e.mobileHubUrl,lrmaaBaseUrl:r.KANE_STAGE_LRMAA_URL??e.lrmaaBaseUrl,latticeBaseUrl:r.KANE_LATTICE_URL??e.latticeBaseUrl,deviceStreamUrl:r.KANE_STAGE_DEVICE_STREAM_URL??e.deviceStreamUrl}}function U(){let t=process.env.TESTMUAI_ENV;return t!==void 0&&t!==""?t==="stage"?"stage":"prod":new n().getDefaultEnv()==="stage"?"stage":"prod"}function a(){let t=process.env.KANE_LATTICE_URL;return t!==void 0&&t.trim()===""?"":E(U()).latticeBaseUrl.trim()}export{E as a,U as b,a as c};
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b,c as R}from"./chunk-72KYMWQ5.js";import{b as S}from"./chunk-CCOD4GQJ.js";import{a as y}from"./chunk-TDPWFYTJ.js";import{c as v}from"./chunk-VZ7KXRXB.js";import{a as f}from"./chunk-RZ4F3BHX.js";import{b as _}from"./chunk-FAMQ4DHU.js";import{randomUUID as U}from"crypto";import{mkdirSync as P,writeFileSync as g,appendFileSync as G,existsSync as h,readFileSync as B}from"fs";import{join as d}from"path";import{writeFileSync as E,mkdirSync as A,existsSync as L}from"fs";import{join as c,relative as j}from"path";function I(r){let t=Object.keys(r.frontmatter).length>0?v(r.frontmatter).trimEnd():"",s=["---"];return t&&s.push(t),s.push("---",""),s.push(`# ${r.heading}`,""),r.steps.forEach((n,o)=>{s.push(`## Step ${o+1}`,n,"")}),s.join(`
2
+ import{b,c as R}from"./chunk-72KYMWQ5.js";import{b as S}from"./chunk-CCOD4GQJ.js";import{a as y}from"./chunk-TDPWFYTJ.js";import{c as v}from"./chunk-VZ7KXRXB.js";import{a as f}from"./chunk-RZ4F3BHX.js";import{b as _}from"./chunk-J4FIESTB.js";import{randomUUID as U}from"crypto";import{mkdirSync as P,writeFileSync as g,appendFileSync as B,existsSync as h,readFileSync as G}from"fs";import{join as d}from"path";import{writeFileSync as E,mkdirSync as A,existsSync as L}from"fs";import{join as c,relative as j}from"path";function I(r){let t=Object.keys(r.frontmatter).length>0?v(r.frontmatter).trimEnd():"",s=["---"];return t&&s.push(t),s.push("---",""),s.push(`# ${r.heading}`,""),r.steps.forEach((n,o)=>{s.push(`## Step ${o+1}`,n,"")}),s.join(`
3
3
  `)}var T=new Set(["username","access_key","oauth","profile","project_id","folder_id"]),D=new Set(["model","env"]),u=class{constructor(e){this.opts=e}objectives=[];flushed=!1;lastWrittenPath=null;lastCollisionSuffixed=!1;appendObjective(e){this.objectives.push(e)}flush(){if(this.flushed||(this.flushed=!0,this.objectives.length===0))return;let e=this.opts.getName();if(!e)return;let t=c(this.opts.cwd,".testmuai","tests");try{A(t,{recursive:!0})}catch(a){process.stderr.write(`
4
4
  \u26A0 Failed to create ${j(this.opts.cwd,t)}/
5
5
  ${a.message}
6
6
  Your test recording was NOT saved.
7
7
 
8
- `);return}let s=c(t,`${e}_test.md`),n=2,o=!1;for(;L(s);)s=c(t,`${e}-${n}_test.md`),n++,o=!0;let i=R(F(this.opts.getResolvedGlobal())),l=I({frontmatter:i,heading:`Session: ${e}`,steps:this.objectives.map(b)});try{E(s,l,"utf8")}catch(a){process.stderr.write(`
8
+ `);return}let s=c(t,`${e}_test.md`),n=2,o=!1;for(;L(s);)s=c(t,`${e}-${n}_test.md`),n++,o=!0;let i=R(k(this.opts.getResolvedGlobal())),l=I({frontmatter:i,heading:`Session: ${e}`,steps:this.objectives.map(b)});try{E(s,l,"utf8")}catch(a){process.stderr.write(`
9
9
  \u26A0 Failed to save your test recording.
10
10
  ${a.message}
11
11
  Path: ${s}
12
12
 
13
- `);return}this.lastWrittenPath=s,this.lastCollisionSuffixed=o}};function F(r){let e={};for(let[t,s]of Object.entries(r))T.has(t)||D.has(t)||(e[t]=s);return e}var O="kaneCliSessionCompleted",k={prod:"https://test-backend.lambdatest.com/api/analytics/event",stage:"https://stage-test-backend.lambdatestinternal.com/api/analytics/event"};function $(r,e=process.env){return e.KANE_ANALYTICS_API_URL||k[r]}var p=class{constructor(e,t=3e3){this.endpoint=e;this.timeoutMs=t}async sendSessionCompleted(e,t){let s=new AbortController,n=setTimeout(()=>s.abort(),this.timeoutMs);try{let o=await f(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:e,event:O,data:t}),signal:s.signal});return{ok:o.ok,status:o.status}}catch{return{ok:!1,status:null}}finally{clearTimeout(n)}}};async function m(r,e,t){return new p($(r)).sendSessionCompleted(e,t)}function M(r){let e=Math.max(0,(Date.parse(r.completedAt)-Date.parse(r.startedAt))/1e3);return{referenceId:r.referenceId,startedAt:r.startedAt,completedAt:r.completedAt,durationSeconds:Math.round(Math.max(0,r.durationSeconds??e)*1e3)/1e3,creditsConsumed:Number.isFinite(r.creditsConsumed)?Math.max(0,r.creditsConsumed):0,runType:r.runType,target:r.target}}function ee(r){let e=r.find(t=>t.mobile);return e?e.platform==="ios"?"simulator":"emulator":"desktop"}async function C(r,e=m){if(process.env.KANE_CLI_MODE==="hyperexecute"||!Number.isInteger(r.userId)||r.userId<=0||!r.data.referenceId||r.runsCompleted<=0)return;let t=M(r.data),s=await e(r.env,r.userId,t).catch(()=>({ok:!1,status:null}));r.log?.(s.ok?"info":"warn",s.ok?"CRM_EVENT_SENT":"CRM_EVENT_FAILED",s.ok?"CRM event delivered":"CRM event delivery failed",{event:"kaneCliSessionCompleted",reference_id:r.data.referenceId,status_code:s.status})}var J=d(_,"sessions"),x=class{sessionId;sessionDir;runs=[];_flows=[];_nextIndex=0;_started=!1;_testId=null;_testcaseId=null;_projectId=null;_orgId=null;_userName=null;_userEmail=null;_uploadStatus="pending";_uploadAttempts=0;_uploadError=null;_firstObjective=null;_firstUrl=null;_auteurVariables={};_screenshotSas=null;_model="";_environment="";_profile=null;_plan=null;_startedAt="";_remoteLogger=null;_earlyLogBuffer=[];_recorder=null;_resolvedGlobal={};_sessionName=null;_recordingEnabled=!0;_stepRunRecords=[];_completionUserId=null;_completionMetadata=null;_completionReporter;_reportCompletion;_completionReported=!1;constructor(e){this.sessionId=U();let t=e?.baseDir?d(e.baseDir,"sessions"):J;this.sessionDir=d(t,this.sessionId),this._completionReporter=e?.reporter??((s,n)=>m(this._environment==="stage"?"stage":"prod",s,n)),this._reportCompletion=e?.report!==!1}setCompletionIdentity(e){Number.isInteger(e)&&e>0&&(this._completionUserId=e)}setCompletionMetadata(e){this._completionMetadata??=e}async reportCompletedSession(e){if(this.recordCreditsConsumed(e.creditsConsumed),e.runsCompleted<=0||this._completionReported||!this._reportCompletion||this._completionUserId===null||this._completionMetadata===null||!this._startedAt)return;this._completionReported=!0;let t=e.completedAt??new Date().toISOString();await C({env:this._environment==="stage"?"stage":"prod",userId:this._completionUserId,runsCompleted:e.runsCompleted,data:{referenceId:this.sessionId,startedAt:this._startedAt,completedAt:t,durationSeconds:e.durationSeconds,creditsConsumed:e.creditsConsumed,...this._completionMetadata},log:(s,n,o,i)=>this.log(s,n,o,i)},(s,n,o)=>this._completionReporter(n,o))}recordCreditsConsumed(e){let t=d(this.sessionDir,"session.json");if(h(t))try{let s=JSON.parse(B(t,"utf8"));s.credits_consumed=Number.isFinite(e)?Math.max(0,e):0,g(t,JSON.stringify(s,null,2)+`
13
+ `);return}this.lastWrittenPath=s,this.lastCollisionSuffixed=o}};function k(r){let e={};for(let[t,s]of Object.entries(r))T.has(t)||D.has(t)||(e[t]=s);return e}var F="kaneCliSessionCompleted",O={prod:"https://test-backend.lambdatest.com/api/analytics/event",stage:"https://stage-test-backend.lambdatestinternal.com/api/analytics/event"};function $(r,e=process.env){return e.KANE_ANALYTICS_API_URL||O[r]}var p=class{constructor(e,t=3e3){this.endpoint=e;this.timeoutMs=t}async sendSessionCompleted(e,t){let s=new AbortController,n=setTimeout(()=>s.abort(),this.timeoutMs);try{let o=await f(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:e,event:F,data:t}),signal:s.signal});return{ok:o.ok,status:o.status}}catch{return{ok:!1,status:null}}finally{clearTimeout(n)}}};async function m(r,e,t){return new p($(r)).sendSessionCompleted(e,t)}function M(r){let e=Math.max(0,(Date.parse(r.completedAt)-Date.parse(r.startedAt))/1e3);return{referenceId:r.referenceId,startedAt:r.startedAt,completedAt:r.completedAt,durationSeconds:Math.round(Math.max(0,r.durationSeconds??e)*1e3)/1e3,creditsConsumed:Number.isFinite(r.creditsConsumed)?Math.max(0,r.creditsConsumed):0,runType:r.runType,target:r.target}}function ee(r){let e=r.find(t=>t.mobile);return e?e.platform==="ios"?"simulator":"emulator":"desktop"}async function C(r,e=m){if(process.env.KANE_CLI_MODE==="hyperexecute"||!Number.isInteger(r.userId)||r.userId<=0||!r.data.referenceId||r.runsCompleted<=0)return;let t=M(r.data),s=await e(r.env,r.userId,t).catch(()=>({ok:!1,status:null}));r.log?.(s.ok?"info":"warn",s.ok?"CRM_EVENT_SENT":"CRM_EVENT_FAILED",s.ok?"CRM event delivered":"CRM event delivery failed",{event:"kaneCliSessionCompleted",reference_id:r.data.referenceId,status_code:s.status})}var J=d(_,"sessions"),x=class{sessionId;sessionDir;runs=[];_flows=[];_nextIndex=0;_started=!1;_testId=null;_saveBlocker=null;_testcaseId=null;_projectId=null;_orgId=null;_userName=null;_userEmail=null;_uploadStatus="pending";_uploadAttempts=0;_uploadError=null;_firstObjective=null;_firstUrl=null;_auteurVariables={};_screenshotSas=null;_model="";_environment="";_profile=null;_plan=null;_startedAt="";_remoteLogger=null;_earlyLogBuffer=[];_recorder=null;_resolvedGlobal={};_sessionName=null;_recordingEnabled=!0;_stepRunRecords=[];_completionUserId=null;_completionMetadata=null;_completionReporter;_reportCompletion;_completionReported=!1;constructor(e){this.sessionId=U();let t=e?.baseDir?d(e.baseDir,"sessions"):J;this.sessionDir=d(t,this.sessionId),this._completionReporter=e?.reporter??((s,n)=>m(this._environment==="stage"?"stage":"prod",s,n)),this._reportCompletion=e?.report!==!1}setCompletionIdentity(e){Number.isInteger(e)&&e>0&&(this._completionUserId=e)}setCompletionMetadata(e){this._completionMetadata??=e}async reportCompletedSession(e){if(this.recordCreditsConsumed(e.creditsConsumed),e.runsCompleted<=0||this._completionReported||!this._reportCompletion||this._completionUserId===null||this._completionMetadata===null||!this._startedAt)return;this._completionReported=!0;let t=e.completedAt??new Date().toISOString();await C({env:this._environment==="stage"?"stage":"prod",userId:this._completionUserId,runsCompleted:e.runsCompleted,data:{referenceId:this.sessionId,startedAt:this._startedAt,completedAt:t,durationSeconds:e.durationSeconds,creditsConsumed:e.creditsConsumed,...this._completionMetadata},log:(s,n,o,i)=>this.log(s,n,o,i)},(s,n,o)=>this._completionReporter(n,o))}recordCreditsConsumed(e){let t=d(this.sessionDir,"session.json");if(h(t))try{let s=JSON.parse(G(t,"utf8"));s.credits_consumed=Number.isFinite(e)?Math.max(0,e):0,g(t,JSON.stringify(s,null,2)+`
14
14
  `)}catch{}}setResolvedGlobal(e){this._resolvedGlobal={...this._resolvedGlobal,...e}}setSessionName(e){this._sessionName=e}get sessionName(){return this._sessionName}setRecordingEnabled(e){this._recordingEnabled=e}get recorder(){return this._recorder}flushRecorder(){try{this._recorder?.flush()}catch(e){process.stderr.write(`[recorder] flush failed: ${e.message}
15
15
  `)}}start(e){if(!this._started){this._started=!0,this._model=e.model,this._environment=e.environment,this._profile=e.profile,this._startedAt=new Date().toISOString();try{P(this.sessionDir,{recursive:!0}),this._recorder=new u({cwd:process.cwd(),getResolvedGlobal:()=>this._resolvedGlobal,getName:()=>this._sessionName});let t={session_id:this.sessionId,started_at:this._startedAt,model:e.model,environment:e.environment,profile:e.profile,plan:this._plan,objectives:[],runs:[],status:"in_progress"};g(d(this.sessionDir,"session.json"),JSON.stringify(t,null,2)+`
16
16
  `)}catch{}this._log(`SESSION START session_id=${this.sessionId}`),this._log(`CONFIG model=${e.model} env=${e.environment} profile=${e.profile}`),this._earlyLogBuffer.push({level:"info",event:"SESSION_START",message:"Session started",context:{session_id:this.sessionId}},{level:"info",event:"CONFIG",message:"Session config",context:{model:e.model,environment:e.environment,profile:e.profile}})}}setPlan(e){this._plan=e;let t={level:"info",event:"SESSION_INFO",message:"Session info",context:{session_id:this.sessionId,plan:e??null}};this._remoteLogger?this._remoteLogger.log(t.level,t.event,t.message,t.context):this._earlyLogBuffer.push(t)}get plan(){return this._plan}get apMode(){return y()??"v2"}setRemoteLogger(e){this._remoteLogger=e;for(let t of this._earlyLogBuffer)e.log(t.level,t.event,t.message,t.context);this._earlyLogBuffer=[]}get hasRemoteLogger(){return this._remoteLogger!==null}setAuteurVariables(e){Object.assign(this._auteurVariables,e)}get auteurVariables(){return this._auteurVariables}setScreenshotSas(e){this._screenshotSas=e}get screenshotSas(){return this._screenshotSas}get screenshotBaseUrl(){return this._screenshotSas?`${this._screenshotSas.base_url}/${this._screenshotSas.container}`:""}get startedAt(){return this._startedAt||new Date().toISOString()}log(e,t,s,n){if(t===void 0){this._log(e);let l=e.indexOf(" "),a=l>0?e.slice(0,l):e,w=l>0?e.slice(l+1):"",N=/fail|error/i.test(e)?"error":"info";this._remoteLogger?.log(N,a,w||e);return}let o=e,i=s;this._log(`${t} ${i}`,n),this._remoteLogger?.log(o,t,i,n)}logStep(e,t,s){this._log(`${e} ${t}`,s);let n=this._nextIndex>0?this._nextIndex-1:0;this._remoteLogger?.logStep(n,e,t,s)}logCommand(e){this._log(`COMMAND ${e}`)}logRunStart(e,t,s){this._log(`RUN ${e} START objective="${t.slice(0,100)}" url=${s}`),this._remoteLogger?.setRunIndex(e),this._remoteLogger?.log("info","RUN_START",`Run ${e} started`,{run_index:e,objective:t,url:s})}logRunEnd(e,t,s,n,o){let i=(s??0).toFixed(1),l=(n??"").slice(0,100),a=o==null||o===""||Number.isNaN(Number(o))?null:Number(o);this._log(`RUN ${e} END status=${t} duration=${i}s summary="${l}"`,a!=null?{result_code:a}:void 0),this._remoteLogger?.log("info","RUN_END",`Run ${e} ended`,{run_index:e,status:t,duration:s??0,summary:n??"",result_code:a}),t!=="failed"&&t!=="error"&&this._remoteLogger?.discardSteps(e)}escalateRun(e){this._remoteLogger?.escalate(e)}logChromeLaunch(e,t){this._log(`CHROME LAUNCH port=${e} endpoint=${t}`),this._remoteLogger?.log("info","CHROME_LAUNCH","Chrome launched",{port:e,cdp_endpoint:t})}async finish(e="complete"){let t=new Date().toISOString();this._log(`SESSION END status=${e} total_runs=${this.runs.length}`),this._remoteLogger?.log("info","SESSION_END","Session ended",{status:e,total_runs:this.runs.length}),await this._remoteLogger?.shutdown();let s={session_id:this.sessionId,started_at:this._startedAt,ended_at:t,model:this._model,environment:this._environment,profile:this._profile,plan:this._plan,status:e,total_runs:this.runs.length,test_id:this._testId,testcase_id:this._testcaseId,commit_id:this.sessionId,project_id:this._projectId,upload_status:this._uploadStatus,upload_attempts:this._uploadAttempts,last_upload_attempt:this._uploadAttempts>0?new Date().toISOString():null,upload_error:this._uploadError,runs:this.runs.map(n=>({index:n.index,objective:n.objective,status:n.status,summary:n.summary,run_dir:n.run_dir}))};if(h(this.sessionDir)&&g(d(this.sessionDir,"session.json"),JSON.stringify(s,null,2)+`
17
- `),this.flushRecorder(),this._recorder=null,this._flows.length>0){let n=this._flows.reduce((o,i)=>o+(Number.isFinite(i.creditsConsumed)?i.creditsConsumed??0:0),0);await this.reportCompletedSession({runsCompleted:this._flows.length,completedAt:t,creditsConsumed:n})}}nextRunIndex(){return this._nextIndex}addRunResult(e,t){this.runs.push(e),this._nextIndex+=t??1,this._recordingEnabled&&this._recorder?.appendObjective(e.objective)}getContext(){return{prior_runs:this.runs.map(e=>({index:e.index,objective:e.objective,summary:e.summary,status:e.status,memory:e.context.memory,variables:e.context.variables,pointer:e.context.pointer}))}}addFlow(e){let t={...e,index:this._flows.length+1};return this._flows.push(t),t}getFlows(){return[...this._flows]}getFlow(e){return this._flows.find(t=>t.index===e)}clearFlows(){this._flows=[]}recordStepRun(e){this._stepRunRecords.push(e)}getStepRunRecords(){return[...this._stepRunRecords]}getRunsAsStepRecords(){return this.runs.map((e,t)=>({testmdStepIndex:t+1,runIndex:e.index,totalRunDirs:e.run_dirs?.length??1}))}snapshot(){return{runsLen:this.runs.length,nextRunIndex:this._nextIndex,stepRunRecordsLen:this._stepRunRecords.length}}rollback(e){this.runs.length=e.runsLen,this._nextIndex=e.nextRunIndex,this._stepRunRecords.length=e.stepRunRecordsLen}setTestId(e){this._testId=e}get testId(){return this._testId}setTestcaseId(e){this._testcaseId=e}get testcaseId(){return this._testcaseId}setProjectId(e){this._projectId=e}setOrgId(e){this._orgId=e}get orgId(){return this._orgId}setUserIdentity(e,t){e&&(this._userName=e),t&&(this._userEmail=t)}get userName(){return this._userName}get userEmail(){return this._userEmail}setFirstRun(e,t){this._firstObjective||(this._firstObjective=e,this._firstUrl=t)}get firstObjective(){return this._firstObjective}get firstUrl(){return this._firstUrl}getRunDirs(){let e=[];for(let t of this.runs)t.run_dirs&&t.run_dirs.length>0?e.push(...t.run_dirs):t.run_dir&&e.push(t.run_dir);return e}getRunObjectives(){let e=[];for(let t of this.runs)t.flow_objectives&&t.flow_objectives.length>0?e.push(...t.flow_objectives):e.push(t.objective);return e}getRunMetadata(){let e=[];for(let t of this.runs)if(t.perFlowMetadata&&t.perFlowMetadata.length>0)e.push(...t.perFlowMetadata);else{let s={resultCode:t.resultCode,reasonCode:t.reasonCode,errorMessage:t.status==="failed"?t.summary??null:null,summary:t.summary,oneLiner:t.oneLiner},n=t.run_dirs?.length??1;for(let o=0;o<n;o++)e.push(s)}return e}setUploadStatus(e,t){this._uploadStatus=e,this._uploadAttempts+=1,this._uploadError=t??null}_log(e,t){if(!(!this._started||!h(this.sessionDir)))try{let s=new Date().toISOString().slice(0,19).replace("T"," "),n=d(this.sessionDir,"tui.log"),o=t&&Object.keys(t).length>0?` ${JSON.stringify(t)}`:"";G(n,S(`[${s}] ${e}${o}
17
+ `),this.flushRecorder(),this._recorder=null,this._flows.length>0){let n=this._flows.reduce((o,i)=>o+(Number.isFinite(i.creditsConsumed)?i.creditsConsumed??0:0),0);await this.reportCompletedSession({runsCompleted:this._flows.length,completedAt:t,creditsConsumed:n})}}nextRunIndex(){return this._nextIndex}addRunResult(e,t){this.runs.push(e),this._nextIndex+=t??1,this._recordingEnabled&&this._recorder?.appendObjective(e.objective)}getContext(){return{prior_runs:this.runs.map(e=>({index:e.index,objective:e.objective,summary:e.summary,status:e.status,memory:e.context.memory,variables:e.context.variables,pointer:e.context.pointer}))}}addFlow(e){let t={...e,index:this._flows.length+1};return this._flows.push(t),t}getFlows(){return[...this._flows]}getFlow(e){return this._flows.find(t=>t.index===e)}clearFlows(){this._flows=[]}recordStepRun(e){this._stepRunRecords.push(e)}getStepRunRecords(){return[...this._stepRunRecords]}getRunsAsStepRecords(){return this.runs.map((e,t)=>({testmdStepIndex:t+1,runIndex:e.index,totalRunDirs:e.run_dirs?.length??1}))}snapshot(){return{runsLen:this.runs.length,nextRunIndex:this._nextIndex,stepRunRecordsLen:this._stepRunRecords.length}}rollback(e){this.runs.length=e.runsLen,this._nextIndex=e.nextRunIndex,this._stepRunRecords.length=e.stepRunRecordsLen}setTestId(e){this._testId=e,this._saveBlocker=null}get testId(){return this._testId}setSaveBlocker(e){this._saveBlocker=e}get saveBlocker(){return this._saveBlocker}setTestcaseId(e){this._testcaseId=e}get testcaseId(){return this._testcaseId}setProjectId(e){this._projectId=e}setOrgId(e){this._orgId=e}get orgId(){return this._orgId}setUserIdentity(e,t){e&&(this._userName=e),t&&(this._userEmail=t)}get userName(){return this._userName}get userEmail(){return this._userEmail}setFirstRun(e,t){this._firstObjective||(this._firstObjective=e,this._firstUrl=t)}get firstObjective(){return this._firstObjective}get firstUrl(){return this._firstUrl}getRunDirs(){let e=[];for(let t of this.runs)t.run_dirs&&t.run_dirs.length>0?e.push(...t.run_dirs):t.run_dir&&e.push(t.run_dir);return e}getRunObjectives(){let e=[];for(let t of this.runs)t.flow_objectives&&t.flow_objectives.length>0?e.push(...t.flow_objectives):e.push(t.objective);return e}getRunMetadata(){let e=[];for(let t of this.runs)if(t.perFlowMetadata&&t.perFlowMetadata.length>0)e.push(...t.perFlowMetadata);else{let s={resultCode:t.resultCode,reasonCode:t.reasonCode,errorMessage:t.status==="failed"?t.summary??null:null,summary:t.summary,oneLiner:t.oneLiner},n=t.run_dirs?.length??1;for(let o=0;o<n;o++)e.push(s)}return e}setUploadStatus(e,t){this._uploadStatus=e,this._uploadAttempts+=1,this._uploadError=t??null}_log(e,t){if(!(!this._started||!h(this.sessionDir)))try{let s=new Date().toISOString().slice(0,19).replace("T"," "),n=d(this.sessionDir,"tui.log"),o=t&&Object.keys(t).length>0?` ${JSON.stringify(t)}`:"";B(n,S(`[${s}] ${e}${o}
18
18
  `))}catch{}}};export{I as a,ee as b,C as c,x as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as A,l as E}from"./chunk-GQARXS6F.js";import{e as _,f as v}from"./chunk-6K5BEEAJ.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
2
+ import{c as A,l as E}from"./chunk-NPAUSUNM.js";import{e as _,f as v}from"./chunk-SB26HQO7.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
3
3
  const ids = JSON.parse(process.env.KANE_HPS_IDS || "[]");
4
4
  Promise.allSettled(ids.map((id) => fetch(process.env.KANE_HPS_FORGE + "/kane-cli/v1/browser-sessions/" + encodeURIComponent(id), {
5
5
  method: "DELETE", headers: { Authorization: process.env.KANE_HPS_AUTH, Accept: "application/json" },
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as te,b as E,d as ne,e as se}from"./chunk-YDB72F4K.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{f as z}from"./chunk-Q4JV4U65.js";import{a as Q}from"./chunk-B7ZX5HEN.js";import{d as q}from"./chunk-FAMQ4DHU.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
2
+ import{a as te,b as E,d as ne,e as se}from"./chunk-YDB72F4K.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{f as z}from"./chunk-Q4JV4U65.js";import{a as Q}from"./chunk-B7ZX5HEN.js";import{d as q}from"./chunk-J4FIESTB.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
3
3
  `),"utf8"),t}function $e(e,t){if(!t)return`## ${e.heading} (no outcome)`;let n=t.duration_s!=null?`${t.duration_s}s`:"\u2014";if(t.status==="skipped")return`## ${e.heading} \u23ED skipped`;let r=t.softFailed?" (optional)":"";if(t.refKind&&t.status==="passed"){let o=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2713 passed (via @${t.refKind} ${t.refLabel} \u2014 ${t.inlinedCount} inlined steps, ${n}${o})`}if(t.refKind&&t.status==="failed"){let o=t.failedSubStepIndex&&t.failedSubStepIndex.length>0?` \u2014 at sub-step ${t.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",s=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2717 failed${r} (via @${t.refKind} ${t.refLabel}${o}, ${n}${s})`}return t.status==="passed"?`## ${e.heading} \u2713 passed (${n})`:`## ${e.heading} \u2717 failed${r} (${n})`}var Fe=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Oe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,_e=/^md5:\s+([a-f0-9]{32})\s*$/;function ie(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=_e.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=je(e,"utf8").split(`
4
4
  `),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],u=d[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(u)){let m=Oe.exec(u),w=m?.[1]??"",I=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:ie(n,s+1),importPath:w,helperResultRelPath:I})}else o.push({kind:"objective",heading:a,status:f,md5:ie(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as ae,existsSync as H,mkdirSync as Ae,writeFileSync as de,promises as dt}from"fs";import{join as $,dirname as le,basename as Te}from"path";async function pe(e){for(let t=0;t<e.totalRunDirs;t++){let n=e.runIndex+t,r=$(e.sessionDir,"runs",String(n)),o=$(e.stagingStepDir,"flows",String(t));Ae(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){ae(i,s);continue}let u=le(le(e.packTestDir)),f=Te(e.packTestDir),S=H(u)?await z(u,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;de(s,S??"");continue}let d=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of d)if(H(i)){ae(i,s),a=!0;break}a||de(s,"")}}import{existsSync as ue,readFileSync as fe,readdirSync as Ne}from"fs";import{join as F}from"path";function Ee(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=a=>typeof t[a]=="string"?t[a]:"",r=n("media_id"),o=n("name"),s=n("media_url");if(!r||!o||!s)return null;let d=n("type")||"doc";return{media_id:r,name:o,media_url:s,type:d,alias:n("alias")}}function Le(e){let t=e.action_params?.file_paths,n=Array.isArray(t)?t[0]:t;return typeof n=="string"&&n.length>0?n:null}function Ue(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ke(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function ce(e,t,n,r={}){let o=Ue(e);for(let s of t){let d=Ee(s);if(!d)continue;let a=o[d.media_id]??={name:d.name,media_url:d.media_url,type:d.type,refs:[],recorded_at:n,...d.alias?{alias:d.alias}:{}};a.recorded_at=n;let i=Le(s);if(!(!i||Ke(i,r.ignoreAliasUnder))){for(let[u,f]of Object.entries(o))u!==d.media_id&&(f.refs=f.refs.filter(S=>S!==i));a.refs.includes(i)||a.refs.push(i)}}return o}function ut(e){let t=e?.media;if(!t||typeof t!="object")return[];let n=[];for(let[r,o]of Object.entries(t)){if(!r||!o||typeof o!="object")continue;let s=o;typeof s.name!="string"||!s.name||typeof s.media_url!="string"||!s.media_url||n.push({media_id:r,name:s.name,media_url:s.media_url,type:typeof s.type=="string"&&s.type?s.type:"doc",refs:Array.isArray(s.refs)?s.refs.filter(d=>typeof d=="string"&&d.length>0):[],...typeof s.alias=="string"&&s.alias?{alias:s.alias}:{}})}return n}function Ce(e){let t=[];for(let n of e){let r;try{r=fe(n,"utf8")}catch{continue}for(let o of r.split(`
5
5
  `)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(ue(r)){t.push(r);break}return t}function me(e){let t=[],n=F(e,".internal","steps");for(let r of V(n)){let o=F(n,r,"flows");for(let s of V(o)){let d=F(o,s,"actions.ndjson");ue(d)&&t.push(d)}}return t}function We(e){try{let n=JSON.parse(fe(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function ge(e){let t=We(e.priorMetaPath),n=Ce(e.recordFiles),r=ce(t,n,e.now??new Date().toISOString(),{ignoreAliasUnder:e.ignoreAliasUnder??q});return Object.keys(r).length>0?r:void 0}import{existsSync as L,readdirSync as He}from"fs";import{dirname as Ve,join as O,basename as B}from"path";function wt(e,t){let n=[];return e.steps.forEach((r,o)=>{let s=t[o];r.block||!r.replayOnly||!s||s.kind!=="author"||n.push({flatIndex:r.flatIndex,file:r.owningFile,heading:r.trace[r.trace.length-1].heading,kind:r.replayOnly,reason:s.reason})}),n}function vt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let u=v(i),f=L(u)?D(u):null;return r.set(i,f),f}let s=new Map;function d(i){if(s.has(i))return s.get(i);let u=O(i,"Result.md"),f=L(u)?D(u):null;return s.set(i,f),f}function a(i){for(let u=1;u<i.trace.length;u++){let f=i.trace[u-1],S=o(f.file);if(!S)continue;let m=S.steps[f.stepIndex-1];if(m){if(m.kind!=="import")return{kind:"author",reason:"structure-mismatch"};if(B(m.importPath)!==B(i.trace[u].file))return{kind:"author",reason:"structure-mismatch"};if(m.md5!=null&&m.md5!==f.rowMd5)return{kind:"author",reason:"structure-mismatch"}}}return null}for(let i of e.steps){let u=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[u-1],j=i.controlFlow!==void 0,T=g?.kind==="objective"&&g.status==="skipped";if(j||T){t.push({kind:"replay",recordingDir:"",flowCount:0,unrecorded:!0,...f?{replayOnly:f}:{}});continue}}let S=n.has(i.owningFile);for(let g=0;g<i.trace.length-1&&!S;g++)n.has(i.trace[g].file)&&(S=!0);if(S&&!f){t.push({kind:"author",reason:o(i.owningFile)===null?"no-result-md":"downstream-of-divergence"});continue}let m=a(i);if(m){for(let g=0;g<i.trace.length;g++)n.add(i.trace[g].file);if(!f){t.push(m);continue}}let w=o(i.owningFile),I;if(w===null&&i.trace.length>1){let g=J(i.trace);I=he(i,d(g),u,g)}else I=he(i,w,u);if(f&&I.kind==="replay"&&(I={...I,replayOnly:f}),t.push(I),I.kind==="author"){n.add(i.owningFile);for(let g=0;g<i.trace.length-1;g++)n.add(i.trace[g].file)}}return t}function he(e,t,n,r=null){if(!t)return{kind:"author",reason:"no-result-md"};let o=t.steps[n-1];if(!o)return{kind:"author",reason:"no-result-md"};if(o.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(o.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=E(e);if(s!==o.md5)return{kind:"author",reason:"md5-mismatch"};let d=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Be(d);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:d,flowCount:a}}function Be(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=He(t,{withFileTypes:!0}).filter(o=>o.isDirectory()&&/^\d+$/.test(o.name)).map(o=>parseInt(o.name,10))}catch{return 0}if(n.length===0)return 0;let r=Math.max(...n);for(let o=0;o<=r;o++)if(!L(O(t,String(o),"actions.ndjson")))return 0;return r+1}function Pt(e){return e.some(t=>t.kind==="author")}function jt(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function J(e){let t=s=>{let d=B(s);return d.endsWith("_test.md")?d.slice(0,-8):d.endsWith(".md")?d.slice(0,-3):d},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(Ve(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function Dt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as ye,mkdirSync as Je,rmSync as Ge,cpSync as qe}from"fs";function Se(e,t){ye(e)&&(ye(t)&&Ge(t,{recursive:!0,force:!0}),Je(t,{recursive:!0}),qe(e,t,{recursive:!0}))}async function Vt(e){let t=new Map;for(let a of e.stepRunRecords)t.set(a.testmdStepIndex,a);let n=e.authoredFlatIdx??new Set,r=[],o=[],s=new Map,d=a=>{if(s.has(a))return s.get(a);let i=x(a,"Result.md"),u=P(i)?D(i):null;return s.set(a,u),u};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,u=Q(a.file,ze(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],I=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let l=J(p.trace);g.includes(l)||g.push(l)}let j=p=>{if(S!==null)return null;for(let l of g){let M=d(l)?.steps[p-1];if(M)return{row:M,dir:l}}return null},T=[],U=!1,G=!1,K=!1,N=!1;for(let p of u.steps){let l=p.index,c=S?.steps[l-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===l&&t.has(y.flatIndex)),R=h.length>0?h[h.length-1]:null;if(R){U=!0,n.has(R.flatIndex)&&(G=!0);let y=E(R),k;i?k=e.outcomes.find(we=>we.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}:k={rootStepIndex:l,status:be(R,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:l,md5:y,rec:t.get(R.flatIndex)}),(!c||c.kind!=="objective"||c.status!==k.status||k.status==="passed"&&c.md5!==y)&&(N=!0)}else if(c&&c.kind==="objective")m.push({rootStepIndex:l,status:c.status,...c.md5?{stepMd5:c.md5}:{}}),I.push(l);else if(!i&&j(l)?.row.kind==="objective"){let y=j(l),k=y.row;m.push({rootStepIndex:l,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),T.push({psIdx:l,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}):m.push({rootStepIndex:l,status:"skipped"});continue}let M=Ze(p.body.path)?p.body.path:tt(Ye(a.file),p.body.path),_=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=et(X(a.file),v(M)),A=e.resolvedTest.steps.filter(h=>h.trace.some((R,y)=>y<h.trace.length-1&&R.file===a.file&&R.stepIndex===l)&&t.has(h.flatIndex));if(A.length>0){U=!0;let h;if(i)h=e.outcomes.find(R=>R.rootStepIndex===l)??{rootStepIndex:l,status:"passed",refKind:"import",refLabel:p.body.path};else{let R=A.some(y=>be(y,e.outcomes)==="failed");h={rootStepIndex:l,status:R?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:A.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=_),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!c||c.kind!=="import"||c.status!==h.status||c.md5!==_)&&(N=!0)}else if(c&&c.kind==="import")m.push({rootStepIndex:l,status:c.status,refKind:"import",refLabel:c.importPath,...c.md5?{stepMd5:c.md5}:{},...c.helperResultRelPath?{helperResultRelPath:c.helperResultRelPath}:{}});else if(!i&&j(l)?.row.kind==="import"){let h=j(l).row;m.push({rootStepIndex:l,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===l)??{rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path})}if(!(i||U&&(G||K||S===null||N)))continue;r.push(a.file);let b=Y(a.file);Ie(x(b,".internal"),{recursive:!0});for(let p of w){let l=x(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);Ie(l,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:l,packTestDir:e.packTestDir})}if(I.length>0){let p=Z(a.file);if(P(p))for(let l of ke(p)){let c=parseInt(l.split("-")[0]??"",10);!Number.isNaN(c)&&I.includes(c)&&xe(x(p,l),x(b,".internal","steps",l),{recursive:!0})}}for(let p of T){let l=x(p.dir,".internal","steps");if(P(l))for(let c of ke(l))parseInt(c.split("-")[0]??"",10)===p.psIdx&&xe(x(l,c),x(b,".internal","steps",c),{recursive:!0})}let Me=m.some(p=>p.status==="failed");if(oe({sourcePath:a.file,title:u.title,rootSteps:u.steps,outcomes:m,overallStatus:i?e.overallStatus:Me?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:x(b,"Result.md")}),i){let p={};e.commitId&&(p.commit_id=e.commitId),e.tmsIds.testId&&(p.test_id=e.tmsIds.testId),e.tmsIds.testcaseId&&(p.testcase_id=e.tmsIds.testcaseId),e.tmsIds.projectId&&(p.project_id=e.tmsIds.projectId),e.tmsIds.folderId&&(p.folder_id=e.tmsIds.folderId),e.tmsIds.orgId&&(p.org_id=e.tmsIds.orgId),e.tmsIds.sessionName&&(p.session_name=e.tmsIds.sessionName);let l=ge({priorMetaPath:W(a.file),recordFiles:me(b)});l&&(p.media=l);let c=ne(a.file);c&&(p.tc_id=c);let M=se(a.file);M&&(p.environment_id=M),Xe(x(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{l as a,m as b,n as c,o as d}from"./chunk-GJ7MO2FW.js";import"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-226AGYHB.js";import"./chunk-6K5BEEAJ.js";import"./chunk-3G2LSTK5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{c as resolveVerdictTarget,b as runEvidenceLintPolicy,a as runEvidenceValidate,d as runEvidenceVerdict};
2
+ import{l as a,m as b,n as c,o as d}from"./chunk-2JFRN62I.js";import"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-NHGPMYM3.js";import"./chunk-SB26HQO7.js";import"./chunk-3G2LSTK5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{c as resolveVerdictTarget,b as runEvidenceLintPolicy,a as runEvidenceValidate,d as runEvidenceVerdict};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-FI2DVNRT.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment,c as latticeAddress,b as targetEnv};
2
+ import{a,b,c}from"./chunk-ZCBOHWN3.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment,c as latticeAddress,b as targetEnv};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as X}from"./chunk-ZZZGTDYE.js";import"./chunk-3AGP2BVN.js";import{N as x,O as J,Q as z}from"./chunk-45NM23EQ.js";import"./chunk-6JUS2ULI.js";import"./chunk-HG2ILWCE.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{f as B,g as j}from"./chunk-LXCTV75T.js";import{g as E,h,i as k,k as P,l as L,m as M,n as C,o as F,r as H}from"./chunk-MEMXFTLD.js";import"./chunk-UWPG5MWM.js";import{b as q}from"./chunk-NVD2MXHQ.js";import"./chunk-73Y6T2UK.js";import{e as Y}from"./chunk-VE4HLIGA.js";import{i as K}from"./chunk-XMPTFXPW.js";import{a as D,f as T}from"./chunk-Z36KVIRR.js";import{f as U}from"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as y,c as _}from"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-FOLUB336.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import{Ha as v,f as W,x as R}from"./chunk-H4TIVILC.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import{a as G}from"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-OKA6FPJM.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{oa as I,vb as A}from"./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{b as N}from"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import{a as S}from"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import{z as O}from"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";import{readdirSync as fe,statSync as ge}from"fs";import{join as ve}from"path";import{basename as Q,relative as ae}from"path";var ce={label:"to bring the project's tests into this folder, run:",cmd:"kane-cli context pull",agentCmd:"kane-cli context pull --mode agent",why:"brings the project's tests into this folder"},ie=["proven","partial","failing","not_run","not_designed","no_criteria"],b=e=>`${e} use-case${e===1?"":"s"}`,ue=e=>`${e} ${e===1?"criterion":"criteria"}`,V={high:0,med:1,low:2};function le(e,r){let n=new Map;for(let[t,c]of _(y(r)))c.length===1&&n.set(t,ae(r,c[0]));let{inScope:s}=L(e),o=M(e,new Set(s)),i=new Map(s.map(t=>[C(e,t),t]));return(t,c)=>{for(let l of o.get(i.get(t.id))??[])if(c(C(e,l)))for(let a of F(e,l)){let u=n.get(C(e,a));if(u)return u}}}function Z(e,r){let n=t=>({uc:t.id,title:t.title,cmd:`kane-cli design tests --use-case ${t.id}`,agentCmd:`kane-cli design tests --use-case ${t.id} --mode agent`,why:"designs its tests"}),s=(t,c,l)=>({uc:t.id,title:t.title,cmd:`kane-cli testmd run ${c}`,agentCmd:`kane-cli testmd run ${c} --agent`,why:l}),o=e.perUc.map((t,c)=>({u:t,i:c})).sort((t,c)=>(V[t.u.risk]??3)-(V[c.u.risk]??3)||t.i-c.i).map(({u:t})=>t);if(e.note==="nothing_run_yet"){let t=o.find(c=>c.state==="not_designed"||c.state==="no_criteria");return[{cmd:"kane-cli testrun run",agentCmd:"kane-cli testrun run --agent",why:"runs every test"},...t?[n(t)]:[]]}let i=[];for(let t of o)if(t.state==="not_designed"||t.state==="no_criteria")i.push(n(t));else if(t.state==="failing"){let c=r(t,l=>e.perAc[l]?.state==="failing");c&&i.push(s(t,c,"runs its failing test again"))}else if(t.state==="partial"||t.state==="not_run"){let c=r(t,l=>e.perAc[l]?.state!=="proven");c&&i.push(s(t,c,"runs its test"))}return i.slice(0,2)}function ee(e,r){let n=A(e),s=H({graph:n,runs:P(n)});return{source:"project",doc:s,next:Z(s,le(n,r)).map(({agentCmd:o,...i})=>i)}}function te(e,r){let n=Z(e,()=>{}),s=n.filter(o=>!/^kane-cli (testrun|testmd) run\b/.test(o.cmd));return k(e)===0&&s.length>0?{source:"project",doc:e,next:s}:r.testsHere||k(e)===0?{source:"project",doc:e,next:n}:{source:"project",doc:e,next:[ce,...s]}}async function re(e,r){let n=await T(e,r);if(!n)return{error:`no evidence pack at '${e}'`};let s=await U(n,"coverage/usecases.yaml");if(s==null)return{error:`${Q(n)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`};let o=N(s);if(!o||!Array.isArray(o.usecases))return{error:`${Q(n)}: coverage/usecases.yaml is not a usecases document`};if(o.coverage?.coverage_version===2)return{source:"pack",pack:n,doc:o.coverage};let i=o.rollup?.aspects??{},t=i.lenient??Object.values(i)[0];return{source:"pack",pack:n,sealed_rule:"earlier",pct:t?.summary?.coverage_pct??0,reached:o.usecases.length}}function de(e,r){if(e.state==="no_criteria")return"no criteria yet";let n=e.criteria>0&&e.proven===e.criteria?`${e.proven} of ${e.criteria} criteria proven`:`${e.proven} of ${e.criteria} proven`,s=Object.values(r.perAc).filter(o=>o.uc===e.id&&o.state==="failing").length;return[n,...s?[`${s} failing`]:[],...e.manual_runs?[`${e.manual_runs} run by hand`]:[],...e.stale?["its source changed"]:[]].join(" \xB7 ")}function me(e){let r=e.perUc.filter(s=>s.stale).length,n=e.flags.orphaned_usecases;return[...r===1?["1 use-case's source changed since; kane-cli context list --stale lists it"]:r>1?[`${r} use-cases' sources changed since; kane-cli context list --stale lists them`]:[],...e.flags.sources_not_fully_extracted.map(s=>`"${s}" isn't fully extracted yet, so more use-cases may count later`),...n===1?["1 use-case isn't counted: every source it came from was removed"]:n>1?[`${n} use-cases aren't counted: every source they came from was removed`]:[]]}var pe="a new run can take up to 5 minutes to count";function ne(e,r){let n=a=>r.color?S.hex(O.dim)(a):a,s=a=>X(a,{width:r.width-12,badgeHeader:"coverage",color:r.color}).map(u=>` ${u}`);if("sealed_rule"in e)return["sealed under the earlier rule, this pack counts only the use-cases it reached",` its own figure: ${Math.round(e.pct)}% across the ${e.reached===1?"1 use-case":`${e.reached} use-cases`} it reached`,"for coverage so far, run: kane-cli cover"];let{doc:o}=e;if(e.source==="pack"){let a=o.this_run??{usecases:[],criteria_passed:[],criteria_failed:[]},u=a.criteria_failed.length,$=o.perUc.map(d=>{if(!d.this_run)return{id:d.id,title:d.title,badge:"0% not reached",summary:"not run by this run"};let f=Object.values(o.perAc).filter(p=>p.uc===d.id),m=f.filter(p=>p.this_run==="passed").length,g=f.filter(p=>p.this_run==="failed").length;return{id:d.id,title:d.title,badge:`${Math.round(d.pct)}% ${h[d.state]}`,summary:`${m} of ${d.criteria} passed in this run${g?` \xB7 ${g} failed`:""}`}});return[`coverage from this pack's run: ${Math.round(o.pct)}% across its ${b(o.usecases.total)}`,` the run reached ${b(a.usecases.length)}: ${ue(a.criteria_passed.length)} passed${u?`, ${u} failed`:""}`,"",...s($),"for coverage so far, run: kane-cli cover"]}let i=r.project!==void 0?`"${r.project}"'s`:"this folder's",t=ie.filter(a=>o.usecases[a]>0).map(a=>`${o.usecases[a]} ${h[a]}`),c=me(o),l=o.perUc.map(a=>({id:a.id,title:a.title,badge:`${Math.round(a.pct)}% ${h[a.state]}`,summary:de(a,o)}));return[`coverage: ${Math.round(o.pct)}% across ${i} ${b(o.usecases.total)}${o.note==="nothing_run_yet"?" \xB7 nothing run yet":""}`,...t.length?[` ${t.join(" \xB7 ")}`]:[],...r.recentRun?[pe]:[],...l.length?["",...s(l)]:[],...c.map(a=>n(` ${a}`)),...c.length&&e.next.length?[""]:[],...e.next.flatMap(a=>[a.label!==void 0?`next: ${a.label}`:a.uc!==void 0?`next: for ${I(a.uc)} "${a.title}", run:`:"next: to run every test, run:",` ${a.cmd}`])]}var he=5*6e4;function Ce(e,r=Date.now()){let n=D(e);try{return fe(n).some(s=>s.endsWith(".evidence")&&r-ge(ve(n,s)).mtimeMs<he)}catch{return!1}}function w(e,r=!1){return e.source==="project"?{source:"project",...e.doc,...r?{recent_run:{may_not_count_yet:!0,up_to_minutes:5}}:{}}:"sealed_rule"in e?{source:"pack",pack:e.pack,sealed_rule:e.sealed_rule,pct:e.pct,usecases_reached:e.reached}:{source:"pack",pack:e.pack,...e.doc}}async function oe(e,r,n){if(e.from){let o=await re(e.from,n);return"error"in o?(x(r,o.error),null):o}let s=J(n,r);return s?ee(s,n):null}var ye={coverage_version:2,scope:"project",config:{rule:"newest_counted_verdict",weighting:"risk",weights:E},pct:0,note:"nothing_run_yet",usecases:{total:0,proven:0,partial:0,failing:0,not_run:0,not_designed:0,no_criteria:0},criteria:{total:0,proven:0},perUc:[],perAc:{},flags:{stale_sources:0,sources_not_fully_extracted:[],orphaned_usecases:0}};async function se(e,r,n,s){let o=e.projectName;try{let i=n.read??(async l=>W({url:e.latticeUrl,basicAuth:await(n.auth??Y)()}).projectCoverage(l)),{state:t,doc:c}=await i(e.projectId);return t==="computing"?"computing":t==="ready"&&c!==null?te(c,{testsHere:s}):R(null,j(v.coverReadFailed(o),"cover",r))}catch(i){return i instanceof K?B({code:i.code,message:i.message,...i.remedy?{remedy:i.remedy}:{}},"cover",r):i instanceof G&&i.code==="NO_CONTEXT"?{source:"project",doc:ye,next:[]}:R(i,j(v.assuranceOffOr(i,o,v.coverReadFailed(o)),"cover",r))}}async function Be(e,r=z(),n=process.cwd(),s={}){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return x(r,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;let o=e.mode==="agent"||e.mode==="ci",i=e.from===void 0?q(n):null,t=i?.kind==="remote"?i:null,c=t!==null&&Ce(n),l=t!==null&&_(y(n)).size>0;if(o){let{makeHeadlessIO:u,agentRefusal:$}=await import("./headless-io-FFM5T6KL.js"),d=u("ndjson","cover",{stdout:m=>r.out(m.replace(/\n$/,"")),stderr:m=>(r.err??r.out)(m.replace(/\n$/,""))}),f;if(t!==null){let m=await se(t,!0,s,l);if(typeof m=="number")return m;if(m==="computing")return d.event({type:"coverage",source:"project",state:"computing"}),d.done(0,void 0,[{cmd:"kane-cli cover --mode agent",why:"the shared project is still working it out"}]);f=m}else{let m=[],g=await oe(e,{out:()=>{},err:p=>m.push(p),confirm:async()=>!1,isTTY:!1},n);if(!g)return $(d,m.join("; ")||"cover refused");f=g}return d.event({type:"coverage",...w(f,c)}),d.done(0,void 0,f.source==="project"?f.next.map(({cmd:m,agentCmd:g,why:p})=>({cmd:g??m,why:p})):[])}let a;if(t!==null){let u=await se(t,!1,s,l);if(typeof u=="number")return u;if(e.json)return r.out(JSON.stringify(u==="computing"?{source:"project",state:"computing"}:w(u,c),null,2)),0;if(r.out(`using project "${t.projectName}", shared with your team`),r.out(""),u==="computing")return r.out(v.coverComputing(t.projectName)),0;a=u}else{let u=await oe(e,r,n);if(!u)return 2;if(a=u,e.json)return r.out(JSON.stringify(w(a),null,2)),0}for(let u of ne(a,{color:r.isTTY===!0,width:process.stdout.columns??120,...t!==null?{project:t.projectName}:{},...c?{recentRun:c}:{}}))r.out(u);return 0}export{Be as coverCommand};
2
+ import{a as X}from"./chunk-6QH75BPJ.js";import"./chunk-3AGP2BVN.js";import{N as x,O as J,Q as z}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{f as B,g as j}from"./chunk-4CJQ7XZP.js";import{g as E,h,i as k,k as P,l as L,m as M,n as C,o as F,r as H}from"./chunk-MEMXFTLD.js";import"./chunk-UWPG5MWM.js";import{b as q}from"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import{e as Y}from"./chunk-NI3TIAD7.js";import{i as K}from"./chunk-XMPTFXPW.js";import{a as D,f as T}from"./chunk-Z36KVIRR.js";import{f as U}from"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as y,c as _}from"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-FOLUB336.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import{Ha as v,f as W,x as R}from"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import{a as G}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{oa as I,vb as A}from"./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{b as N}from"./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{a as S}from"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import{z as O}from"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{readdirSync as fe,statSync as ge}from"fs";import{join as ve}from"path";import{basename as Q,relative as ae}from"path";var ce={label:"to bring the project's tests into this folder, run:",cmd:"kane-cli context pull",agentCmd:"kane-cli context pull --mode agent",why:"brings the project's tests into this folder"},ie=["proven","partial","failing","not_run","not_designed","no_criteria"],b=e=>`${e} use-case${e===1?"":"s"}`,ue=e=>`${e} ${e===1?"criterion":"criteria"}`,V={high:0,med:1,low:2};function le(e,r){let n=new Map;for(let[t,c]of _(y(r)))c.length===1&&n.set(t,ae(r,c[0]));let{inScope:s}=L(e),o=M(e,new Set(s)),i=new Map(s.map(t=>[C(e,t),t]));return(t,c)=>{for(let l of o.get(i.get(t.id))??[])if(c(C(e,l)))for(let a of F(e,l)){let u=n.get(C(e,a));if(u)return u}}}function Z(e,r){let n=t=>({uc:t.id,title:t.title,cmd:`kane-cli design tests --use-case ${t.id}`,agentCmd:`kane-cli design tests --use-case ${t.id} --mode agent`,why:"designs its tests"}),s=(t,c,l)=>({uc:t.id,title:t.title,cmd:`kane-cli testmd run ${c}`,agentCmd:`kane-cli testmd run ${c} --agent`,why:l}),o=e.perUc.map((t,c)=>({u:t,i:c})).sort((t,c)=>(V[t.u.risk]??3)-(V[c.u.risk]??3)||t.i-c.i).map(({u:t})=>t);if(e.note==="nothing_run_yet"){let t=o.find(c=>c.state==="not_designed"||c.state==="no_criteria");return[{cmd:"kane-cli testrun run",agentCmd:"kane-cli testrun run --agent",why:"runs every test"},...t?[n(t)]:[]]}let i=[];for(let t of o)if(t.state==="not_designed"||t.state==="no_criteria")i.push(n(t));else if(t.state==="failing"){let c=r(t,l=>e.perAc[l]?.state==="failing");c&&i.push(s(t,c,"runs its failing test again"))}else if(t.state==="partial"||t.state==="not_run"){let c=r(t,l=>e.perAc[l]?.state!=="proven");c&&i.push(s(t,c,"runs its test"))}return i.slice(0,2)}function ee(e,r){let n=A(e),s=H({graph:n,runs:P(n)});return{source:"project",doc:s,next:Z(s,le(n,r)).map(({agentCmd:o,...i})=>i)}}function te(e,r){let n=Z(e,()=>{}),s=n.filter(o=>!/^kane-cli (testrun|testmd) run\b/.test(o.cmd));return k(e)===0&&s.length>0?{source:"project",doc:e,next:s}:r.testsHere||k(e)===0?{source:"project",doc:e,next:n}:{source:"project",doc:e,next:[ce,...s]}}async function re(e,r){let n=await T(e,r);if(!n)return{error:`no evidence pack at '${e}'`};let s=await U(n,"coverage/usecases.yaml");if(s==null)return{error:`${Q(n)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`};let o=N(s);if(!o||!Array.isArray(o.usecases))return{error:`${Q(n)}: coverage/usecases.yaml is not a usecases document`};if(o.coverage?.coverage_version===2)return{source:"pack",pack:n,doc:o.coverage};let i=o.rollup?.aspects??{},t=i.lenient??Object.values(i)[0];return{source:"pack",pack:n,sealed_rule:"earlier",pct:t?.summary?.coverage_pct??0,reached:o.usecases.length}}function de(e,r){if(e.state==="no_criteria")return"no criteria yet";let n=e.criteria>0&&e.proven===e.criteria?`${e.proven} of ${e.criteria} criteria proven`:`${e.proven} of ${e.criteria} proven`,s=Object.values(r.perAc).filter(o=>o.uc===e.id&&o.state==="failing").length;return[n,...s?[`${s} failing`]:[],...e.manual_runs?[`${e.manual_runs} run by hand`]:[],...e.stale?["its source changed"]:[]].join(" \xB7 ")}function me(e){let r=e.perUc.filter(s=>s.stale).length,n=e.flags.orphaned_usecases;return[...r===1?["1 use-case's source changed since; kane-cli context list --stale lists it"]:r>1?[`${r} use-cases' sources changed since; kane-cli context list --stale lists them`]:[],...e.flags.sources_not_fully_extracted.map(s=>`"${s}" isn't fully extracted yet, so more use-cases may count later`),...n===1?["1 use-case isn't counted: every source it came from was removed"]:n>1?[`${n} use-cases aren't counted: every source they came from was removed`]:[]]}var pe="a new run can take up to 5 minutes to count";function ne(e,r){let n=a=>r.color?S.hex(O.dim)(a):a,s=a=>X(a,{width:r.width-12,badgeHeader:"coverage",color:r.color}).map(u=>` ${u}`);if("sealed_rule"in e)return["sealed under the earlier rule, this pack counts only the use-cases it reached",` its own figure: ${Math.round(e.pct)}% across the ${e.reached===1?"1 use-case":`${e.reached} use-cases`} it reached`,"for coverage so far, run: kane-cli cover"];let{doc:o}=e;if(e.source==="pack"){let a=o.this_run??{usecases:[],criteria_passed:[],criteria_failed:[]},u=a.criteria_failed.length,$=o.perUc.map(d=>{if(!d.this_run)return{id:d.id,title:d.title,badge:"0% not reached",summary:"not run by this run"};let f=Object.values(o.perAc).filter(p=>p.uc===d.id),m=f.filter(p=>p.this_run==="passed").length,g=f.filter(p=>p.this_run==="failed").length;return{id:d.id,title:d.title,badge:`${Math.round(d.pct)}% ${h[d.state]}`,summary:`${m} of ${d.criteria} passed in this run${g?` \xB7 ${g} failed`:""}`}});return[`coverage from this pack's run: ${Math.round(o.pct)}% across its ${b(o.usecases.total)}`,` the run reached ${b(a.usecases.length)}: ${ue(a.criteria_passed.length)} passed${u?`, ${u} failed`:""}`,"",...s($),"for coverage so far, run: kane-cli cover"]}let i=r.project!==void 0?`"${r.project}"'s`:"this folder's",t=ie.filter(a=>o.usecases[a]>0).map(a=>`${o.usecases[a]} ${h[a]}`),c=me(o),l=o.perUc.map(a=>({id:a.id,title:a.title,badge:`${Math.round(a.pct)}% ${h[a.state]}`,summary:de(a,o)}));return[`coverage: ${Math.round(o.pct)}% across ${i} ${b(o.usecases.total)}${o.note==="nothing_run_yet"?" \xB7 nothing run yet":""}`,...t.length?[` ${t.join(" \xB7 ")}`]:[],...r.recentRun?[pe]:[],...l.length?["",...s(l)]:[],...c.map(a=>n(` ${a}`)),...c.length&&e.next.length?[""]:[],...e.next.flatMap(a=>[a.label!==void 0?`next: ${a.label}`:a.uc!==void 0?`next: for ${I(a.uc)} "${a.title}", run:`:"next: to run every test, run:",` ${a.cmd}`])]}var he=5*6e4;function Ce(e,r=Date.now()){let n=D(e);try{return fe(n).some(s=>s.endsWith(".evidence")&&r-ge(ve(n,s)).mtimeMs<he)}catch{return!1}}function w(e,r=!1){return e.source==="project"?{source:"project",...e.doc,...r?{recent_run:{may_not_count_yet:!0,up_to_minutes:5}}:{}}:"sealed_rule"in e?{source:"pack",pack:e.pack,sealed_rule:e.sealed_rule,pct:e.pct,usecases_reached:e.reached}:{source:"pack",pack:e.pack,...e.doc}}async function oe(e,r,n){if(e.from){let o=await re(e.from,n);return"error"in o?(x(r,o.error),null):o}let s=J(n,r);return s?ee(s,n):null}var ye={coverage_version:2,scope:"project",config:{rule:"newest_counted_verdict",weighting:"risk",weights:E},pct:0,note:"nothing_run_yet",usecases:{total:0,proven:0,partial:0,failing:0,not_run:0,not_designed:0,no_criteria:0},criteria:{total:0,proven:0},perUc:[],perAc:{},flags:{stale_sources:0,sources_not_fully_extracted:[],orphaned_usecases:0}};async function se(e,r,n,s){let o=e.projectName;try{let i=n.read??(async l=>W({url:e.latticeUrl,basicAuth:await(n.auth??Y)()}).projectCoverage(l)),{state:t,doc:c}=await i(e.projectId);return t==="computing"?"computing":t==="ready"&&c!==null?te(c,{testsHere:s}):R(null,j(v.coverReadFailed(o),"cover",r))}catch(i){return i instanceof K?B({code:i.code,message:i.message,...i.remedy?{remedy:i.remedy}:{}},"cover",r):i instanceof G&&i.code==="NO_CONTEXT"?{source:"project",doc:ye,next:[]}:R(i,j(v.assuranceOffOr(i,o,v.coverReadFailed(o)),"cover",r))}}async function Be(e,r=z(),n=process.cwd(),s={}){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return x(r,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;let o=e.mode==="agent"||e.mode==="ci",i=e.from===void 0?q(n):null,t=i?.kind==="remote"?i:null,c=t!==null&&Ce(n),l=t!==null&&_(y(n)).size>0;if(o){let{makeHeadlessIO:u,agentRefusal:$}=await import("./headless-io-FFM5T6KL.js"),d=u("ndjson","cover",{stdout:m=>r.out(m.replace(/\n$/,"")),stderr:m=>(r.err??r.out)(m.replace(/\n$/,""))}),f;if(t!==null){let m=await se(t,!0,s,l);if(typeof m=="number")return m;if(m==="computing")return d.event({type:"coverage",source:"project",state:"computing"}),d.done(0,void 0,[{cmd:"kane-cli cover --mode agent",why:"the shared project is still working it out"}]);f=m}else{let m=[],g=await oe(e,{out:()=>{},err:p=>m.push(p),confirm:async()=>!1,isTTY:!1},n);if(!g)return $(d,m.join("; ")||"cover refused");f=g}return d.event({type:"coverage",...w(f,c)}),d.done(0,void 0,f.source==="project"?f.next.map(({cmd:m,agentCmd:g,why:p})=>({cmd:g??m,why:p})):[])}let a;if(t!==null){let u=await se(t,!1,s,l);if(typeof u=="number")return u;if(e.json)return r.out(JSON.stringify(u==="computing"?{source:"project",state:"computing"}:w(u,c),null,2)),0;if(r.out(`using project "${t.projectName}", shared with your team`),r.out(""),u==="computing")return r.out(v.coverComputing(t.projectName)),0;a=u}else{let u=await oe(e,r,n);if(!u)return 2;if(a=u,e.json)return r.out(JSON.stringify(w(a),null,2)),0}for(let u of ne(a,{color:r.isTTY===!0,width:process.stdout.columns??120,...t!==null?{project:t.projectName}:{},...c?{recentRun:c}:{}}))r.out(u);return 0}export{Be as coverCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
2
+ import{a}from"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-HX5OLRKU.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-NRAPCFI2.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as DEPS_INSTALL_SCHEMA_VERSION,i as DepsBundleResolver,c as DepsInstallRequiredError,h as NoPublishedBundleError,b as classOfTarget,g as downloadPayload,e as formatEta,d as formatRate,j as managedDeps,f as planRangeParts};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-BCR73VGS.js"),import("./token-refresh-K6PVBBFE.js"),import("./config-YMHI3H3Y.js"),import("./controller-client-PB3AZAGG.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
2
+ import"./chunk-UR6MHSHU.js";var c="Mobile dependencies are resolved through your KaneAI account. Run `kane-cli login` first.";function d(l,o,e=process.env){return e.KANE_MOBILE_DEPS_BASE_URL||o(l)}async function u(){let[{CredentialsManager:l},{refreshOAuthToken:o},{getEnvironment:e},{ControllerClient:n}]=await Promise.all([import("./credentials-5WIFF5DG.js"),import("./token-refresh-E4FTJVHY.js"),import("./config-7WTZPMAH.js"),import("./controller-client-PB3AZAGG.js")]),s=new l;return{creds:s,refresh:r=>o({creds:s,profile:r.profile,env:r.env,credentials:r.credentials}),controllerBaseUrlFor:r=>d(r,t=>e(t).controllerBaseUrl),makeClient:(r,t)=>new n(r,t)}}function p(l){return async o=>{let e=l??await u(),n=e.creds.getActiveProfile();if(!n)throw new Error(c);let s=e.creds.getDefaultEnv(),r=e.controllerBaseUrlFor(s),t=e.creds.loadBasicAuth(n,s);if(t)return e.makeClient(r,{username:t.username,accessKey:t.access_key}).resolveMobileDepsBundle(o);let i=e.creds.loadCredentials(n,s);if(!i)throw new Error(c);try{await e.refresh({creds:e.creds,profile:n,env:s,credentials:i})}catch{}let a=(e.creds.loadCredentials(n,s)??i).access_token;if(typeof a!="string"||!a)throw new Error(c);return e.makeClient(r,a).resolveMobileDepsBundle(o)}}export{p as controllerResolveBundle,d as depsControllerBaseUrl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as c}from"./chunk-KM3YCIDV.js";import{a as l}from"./chunk-2COXO5LQ.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";async function S(e){let{site:i,store:s}=e,[{makeChatController:p},{commitChatTurn:m},{topologyDescriptor:u},{explain:g},{buildDossier:h},{testDefinitionOf:d}]=await Promise.all([import("./chat-controller-FXRJXUG3.js"),import("./chat-committer-ZKEKJA2R.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-5XKNAK6Q.js"),import("./test-definition-53XNBEDE.js")]),n={current:null},a={current:[]},o=p({commitChatTurn:t=>m({...t,store:s,definitionOf:d}),descriptor:u("design"),store:s,refreshGraph:()=>i.graph(),graph:i.graph(),explain:g,by:{kind:"human",id:"owner"},templateVersion:()=>n.current,pendingForceScope:()=>a.current,...e.useCase?{ucRef:e.useCase}:{}});return{controller:o,inspect:t=>{try{return h(i.graph(),t)}catch{return null}},runDeps:t=>({store:s,projectDir:process.cwd(),...e.testFilesAt?{testFilesAt:e.testFilesAt}:{},agent:e.agent,tracePath:l,credentials:e.credentials,onIngestRefusal:c,onTemplateVersion:r=>{n.current=r},onForceScope:r=>{a.current=r},preflightTurn:e.preflight,...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>o.ask(r),out:r=>o.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:o,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{S as buildDesignChat};
2
+ import{a as c}from"./chunk-KM3YCIDV.js";import{a as l}from"./chunk-YNDELIXL.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";async function S(e){let{site:i,store:s}=e,[{makeChatController:p},{commitChatTurn:m},{topologyDescriptor:u},{explain:g},{buildDossier:h},{testDefinitionOf:d}]=await Promise.all([import("./chat-controller-FXRJXUG3.js"),import("./chat-committer-ZKEKJA2R.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-5XKNAK6Q.js"),import("./test-definition-53XNBEDE.js")]),n={current:null},a={current:[]},o=p({commitChatTurn:t=>m({...t,store:s,definitionOf:d}),descriptor:u("design"),store:s,refreshGraph:()=>i.graph(),graph:i.graph(),explain:g,by:{kind:"human",id:"owner"},templateVersion:()=>n.current,pendingForceScope:()=>a.current,...e.useCase?{ucRef:e.useCase}:{}});return{controller:o,inspect:t=>{try{return h(i.graph(),t)}catch{return null}},runDeps:t=>({store:s,projectDir:process.cwd(),...e.testFilesAt?{testFilesAt:e.testFilesAt}:{},agent:e.agent,tracePath:l,credentials:e.credentials,onIngestRefusal:c,onTemplateVersion:r=>{n.current=r},onForceScope:r=>{a.current=r},preflightTurn:e.preflight,...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>o.ask(r),out:r=>o.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:o,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{S as buildDesignChat};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-Q5AKIQIE.js";import"./chunk-KM3YCIDV.js";import"./chunk-PRBWZXFA.js";import"./chunk-QI5RZ7LL.js";import"./chunk-4KCYNP2K.js";import"./chunk-W54BX6HC.js";import"./chunk-JNPFEBUR.js";import"./chunk-ZMWTRXFH.js";import"./chunk-MINDIQET.js";import"./chunk-LX2I4JEH.js";import"./chunk-GEZVC4S3.js";import"./chunk-5F5IVART.js";import"./chunk-IZ66FKPC.js";import"./chunk-GLM5UGTF.js";import"./chunk-VZJ6LUXX.js";import"./chunk-DXIQVBMI.js";import"./chunk-W5HFUBXD.js";import"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-U2VYTVKV.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-32HED7X2.js";import"./chunk-2COXO5LQ.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-SIHX5FW5.js";import"./chunk-X7S7IGCV.js";import"./chunk-2RUSXQ3O.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-ZDCXWEQG.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-32MFECUA.js";import"./chunk-4IEQNX7F.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-EHB55V23.js";import"./chunk-TD6GCEIK.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-B57ZRHEQ.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-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{a as headlessDesign};
2
+ import{a}from"./chunk-OCMPWCKQ.js";import"./chunk-KM3YCIDV.js";import"./chunk-PRBWZXFA.js";import"./chunk-QI5RZ7LL.js";import"./chunk-4KCYNP2K.js";import"./chunk-W54BX6HC.js";import"./chunk-JNPFEBUR.js";import"./chunk-ZMWTRXFH.js";import"./chunk-MINDIQET.js";import"./chunk-LX2I4JEH.js";import"./chunk-GEZVC4S3.js";import"./chunk-5F5IVART.js";import"./chunk-IZ66FKPC.js";import"./chunk-GLM5UGTF.js";import"./chunk-VZJ6LUXX.js";import"./chunk-DXIQVBMI.js";import"./chunk-W5HFUBXD.js";import"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-U2VYTVKV.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-32HED7X2.js";import"./chunk-YNDELIXL.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-SIHX5FW5.js";import"./chunk-X7S7IGCV.js";import"./chunk-2RUSXQ3O.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-ZDCXWEQG.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-32MFECUA.js";import"./chunk-4IEQNX7F.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-EHB55V23.js";import"./chunk-TD6GCEIK.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.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-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as headlessDesign};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-HNF3PWF3.js";import"./chunk-45NM23EQ.js";import"./chunk-6JUS2ULI.js";import"./chunk-HG2ILWCE.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import{d as h}from"./chunk-NVD2MXHQ.js";import"./chunk-73Y6T2UK.js";import{e as C}from"./chunk-VE4HLIGA.js";import{b as p,e as g,h as u,i as w}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as v}from"./chunk-REKHAN53.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import"./chunk-H4TIVILC.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-OKA6FPJM.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{na as f,oa as l}from"./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-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";function b(n){return n.useCase!==void 0&&f.test(n.useCase)?{...n,useCase:n.useCase.toLowerCase()}:n}async function E(n,a,e="agent"){let s=b(n),r=v(g(p(e,s.json===!0),"design"),{atQuestionsOnly:!0}),o=m(s);if("error"in o)return u(r,o.error,"USAGE");let{answerGate:d}=await import("./gate-7ALXLCNB.js"),i=d({...s,mode:e},"design tests");if(i!==null)return u(r,i.message,i.code,i.remedy);let c;try{c=await C()}catch(t){if(t instanceof w)return u(r,t.message,t.code,t.remedy);throw t}let{runRemote:x,controllerCheck:y}=await import("./run-remote-BGKQDAOA.js"),I=await x({verb:"design",mode:"agent",choice:a,basicAuth:c,start:s.resume?{kind:"resume",sessionId:s.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"agent",useCase:s.useCase}},run:{...s.useCase!==void 0?{useCase:s.useCase}:{},...s.message!==void 0?{message:s.message}:{},...s.force!==void 0?{force:s.force}:{},...s.allowUnreviewed!==void 0?{allowUnreviewed:s.allowUnreviewed}:{},...s.phase!==void 0?{phase:s.phase}:{},...s.plan!==void 0?{plan:s.plan}:{},...s.max!==void 0?{max:s.max}:{},...s.strength!==void 0?{strength:s.strength}:{},...s.answer?.length?{answer:s.answer}:{},...e==="override"?{override:!0}:{}},io:r,check:y,onProgress:()=>{},onOpened:t=>h(process.cwd(),t.userId),signals:!0});return r.done(I)}async function T(n,a){let e=b(n),{answerGate:s,printPair:r}=await import("./gate-7ALXLCNB.js"),o=m(e);if("error"in o)return process.stderr.write(`${o.error}
3
- `),2;let d=s(e,"design tests");if(d!==null)return r(d),2;let{runInteractiveRemote:i}=await import("./interactive-remote-O2Q2FNOH.js");return i({verb:"design",choice:a,start:e.resume?{kind:"resume",sessionId:e.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"interactive",useCase:e.useCase}},run:{...e.useCase!==void 0?{useCase:e.useCase}:{},...e.message!==void 0?{message:e.message}:{},...e.force!==void 0?{force:e.force}:{},...e.allowUnreviewed!==void 0?{allowUnreviewed:e.allowUnreviewed}:{},...e.phase!==void 0?{phase:e.phase}:{},...e.plan!==void 0?{plan:e.plan}:{},...e.max!==void 0?{max:e.max}:{},...e.strength!==void 0?{strength:e.strength}:{}},...e.useCase?{subject:l(e.useCase)}:{}})}export{E as bindDesignRemote,T as bindDesignRemoteInteractive};
2
+ import{a as m}from"./chunk-QE4AWNOV.js";import"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import{d as h}from"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import{e as C}from"./chunk-NI3TIAD7.js";import{b as p,e as g,h as u,i as w}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as v}from"./chunk-REKHAN53.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{na as f,oa as l}from"./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";function b(n){return n.useCase!==void 0&&f.test(n.useCase)?{...n,useCase:n.useCase.toLowerCase()}:n}async function E(n,a,e="agent"){let s=b(n),r=v(g(p(e,s.json===!0),"design"),{atQuestionsOnly:!0}),o=m(s);if("error"in o)return u(r,o.error,"USAGE");let{answerGate:d}=await import("./gate-AK44VDHC.js"),i=d({...s,mode:e},"design tests");if(i!==null)return u(r,i.message,i.code,i.remedy);let c;try{c=await C()}catch(t){if(t instanceof w)return u(r,t.message,t.code,t.remedy);throw t}let{runRemote:x,controllerCheck:y}=await import("./run-remote-SFR3F2T5.js"),I=await x({verb:"design",mode:"agent",choice:a,basicAuth:c,start:s.resume?{kind:"resume",sessionId:s.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"agent",useCase:s.useCase}},run:{...s.useCase!==void 0?{useCase:s.useCase}:{},...s.message!==void 0?{message:s.message}:{},...s.force!==void 0?{force:s.force}:{},...s.allowUnreviewed!==void 0?{allowUnreviewed:s.allowUnreviewed}:{},...s.phase!==void 0?{phase:s.phase}:{},...s.plan!==void 0?{plan:s.plan}:{},...s.max!==void 0?{max:s.max}:{},...s.strength!==void 0?{strength:s.strength}:{},...s.answer?.length?{answer:s.answer}:{},...e==="override"?{override:!0}:{}},io:r,check:y,onProgress:()=>{},onOpened:t=>h(process.cwd(),t.userId),signals:!0});return r.done(I)}async function T(n,a){let e=b(n),{answerGate:s,printPair:r}=await import("./gate-AK44VDHC.js"),o=m(e);if("error"in o)return process.stderr.write(`${o.error}
3
+ `),2;let d=s(e,"design tests");if(d!==null)return r(d),2;let{runInteractiveRemote:i}=await import("./interactive-remote-7ZSTI66T.js");return i({verb:"design",choice:a,start:e.resume?{kind:"resume",sessionId:e.resume}:{kind:"new",body:{projectId:a.projectId,verb:"design",mode:"interactive",useCase:e.useCase}},run:{...e.useCase!==void 0?{useCase:e.useCase}:{},...e.message!==void 0?{message:e.message}:{},...e.force!==void 0?{force:e.force}:{},...e.allowUnreviewed!==void 0?{allowUnreviewed:e.allowUnreviewed}:{},...e.phase!==void 0?{phase:e.phase}:{},...e.plan!==void 0?{plan:e.plan}:{},...e.max!==void 0?{max:e.max}:{},...e.strength!==void 0?{strength:e.strength}:{}},...e.useCase?{subject:l(e.useCase)}:{}})}export{E as bindDesignRemote,T as bindDesignRemoteInteractive};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{c as a,d as b,e as c}from"./chunk-5YYCCM6K.js";import"./chunk-WLEWXE6L.js";import"./chunk-LPJKNX6D.js";import"./chunk-SXRHKXSE.js";import"./chunk-ZCBOHWN3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as evidenceAppName,b as readFirstStepPixelWindow,c as withDeviceSkin};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-IB5WG5YY.js";import"./chunk-I52NWH4U.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-HX5OLRKU.js";import"./chunk-TZXXJWHA.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{d as doctorExitCode,c as doctorPreflightBlocked,b as renderDoctorText,a as runDoctor};
2
+ import{a,b,c,d}from"./chunk-RNHSULQM.js";import"./chunk-C4KAPGBS.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-NRAPCFI2.js";import"./chunk-TZXXJWHA.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{d as doctorExitCode,c as doctorPreflightBlocked,b as renderDoctorText,a as runDoctor};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{A as M,B as N,C as O,D as P,E as Q,H as R,I as S,J as T,K as U,L as _,N as $,O as aa,P as ba,Q as ca,S as da,T as ea,U as fa,V as ga,W as ha,X as ia,Y as ja,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as t,j as u,k as v,l as w,m as x,n as y,o as z,p as A,q as B,r as C,s as D,t as F,u as G,v as H,w as I,x as J,y as K,z as L}from"./chunk-7O2FIZB7.js";import"./chunk-DREQ3RAA.js";import{a as V,b as W,c as X,d as Y,e as Z}from"./chunk-P4VFC6HO.js";import"./chunk-YO6SNXBJ.js";import"./chunk-MEMXFTLD.js";import"./chunk-SSOUYKVG.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-TAY7J5VS.js";import"./chunk-UWPG5MWM.js";import"./chunk-NVD2MXHQ.js";import{a,f as b}from"./chunk-IINZZ4BZ.js";import"./chunk-73Y6T2UK.js";import"./chunk-VE4HLIGA.js";import"./chunk-XMPTFXPW.js";import{l as E}from"./chunk-GJ7MO2FW.js";import{a as n,b as o,c as p,e as q,f as r,g as s}from"./chunk-Z36KVIRR.js";import{a as k,b as l,c as m}from"./chunk-Q4JV4U65.js";import"./chunk-44SIFDNY.js";import"./chunk-5KJU4MG4.js";import"./chunk-Y6Y6RAY4.js";import"./chunk-75FF7J5R.js";import"./chunk-226AGYHB.js";import"./chunk-6K5BEEAJ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-HX5OLRKU.js";import"./chunk-SXRHKXSE.js";import"./chunk-4JOD47QI.js";import"./chunk-3G2LSTK5.js";import"./chunk-FOLUB336.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import"./chunk-H4TIVILC.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-OKA6FPJM.js";import"./chunk-B57ZRHEQ.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-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,b as buildEnvironment,j as buildEvidenceRunConfig,i as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,ea as flattenAuteurLeafIds,da as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,a as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ja as readPackLeafIds,ia as readPackLeaves,s as recoverStore,ga as remapReplayActionIds,r as resolvePack,ha as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,f as shortHash,e as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,fa as synthesizeSkippedTail,h as testIdForInline,g as testIdForTestmd,k as validatePack,c as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,d as worstOf,G as worstResultCode,ca as writeAuteurDataset,B as writeLogsMeta,A as writeResult};
2
+ import{A as M,B as N,C as O,D as P,E as Q,H as R,I as S,J as T,K as U,L as _,N as $,O as aa,P as ba,Q as ca,S as da,T as ea,U as fa,V as ga,W as ha,X as ia,Y as ja,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as t,j as u,k as v,l as w,m as x,n as y,o as z,p as A,q as B,r as C,s as D,t as F,u as G,v as H,w as I,x as J,y as K,z as L}from"./chunk-CB2BWDHG.js";import"./chunk-DREQ3RAA.js";import{a as V,b as W,c as X,d as Y,e as Z}from"./chunk-35WUYKGO.js";import"./chunk-IEHJG6J4.js";import"./chunk-MEMXFTLD.js";import"./chunk-SSOUYKVG.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-TAY7J5VS.js";import"./chunk-UWPG5MWM.js";import"./chunk-3RO2YGKH.js";import{a,f as b}from"./chunk-IINZZ4BZ.js";import"./chunk-73Y6T2UK.js";import"./chunk-NI3TIAD7.js";import"./chunk-XMPTFXPW.js";import{l as E}from"./chunk-2JFRN62I.js";import{a as n,b as o,c as p,e as q,f as r,g as s}from"./chunk-Z36KVIRR.js";import{a as k,b as l,c as m}from"./chunk-Q4JV4U65.js";import"./chunk-2TK4MDF2.js";import"./chunk-5YYCCM6K.js";import"./chunk-WLEWXE6L.js";import"./chunk-LPJKNX6D.js";import"./chunk-NHGPMYM3.js";import"./chunk-SB26HQO7.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-NRAPCFI2.js";import"./chunk-SXRHKXSE.js";import"./chunk-4JOD47QI.js";import"./chunk-3G2LSTK5.js";import"./chunk-FOLUB336.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./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-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,b as buildEnvironment,j as buildEvidenceRunConfig,i as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,ea as flattenAuteurLeafIds,da as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,a as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ja as readPackLeafIds,ia as readPackLeaves,s as recoverStore,ga as remapReplayActionIds,r as resolvePack,ha as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,f as shortHash,e as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,fa as synthesizeSkippedTail,h as testIdForInline,g as testIdForTestmd,k as validatePack,c as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,d as worstOf,G as worstResultCode,ca as writeAuteurDataset,B as writeLogsMeta,A as writeResult};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as h,b as i,c as j,d as k}from"./chunk-D4QXYAYA.js";import"./chunk-45NM23EQ.js";import"./chunk-6JUS2ULI.js";import"./chunk-HG2ILWCE.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-YDSGXB25.js";import{a,b,c,d,f as e,g as f,h as g}from"./chunk-TM6VLC6V.js";import"./chunk-ZMWTRXFH.js";import"./chunk-I6S6DZ2E.js";import"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-HD6NR44L.js";import"./chunk-LD5B3QFW.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.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-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";export{f as EVOLVE_SCOPE_ADVICE,g as composeEvolveStatement,b as designStateOf,k as evolveCommand,c as evolveOneUc,j as forwardChildLine,i as liveRunDesignForUc,e as namedEntityOf,a as resolveParentUc,h as runEvolveCommand,d as staleTargets};
2
+ import{a as h,b as i,c as j,d as k}from"./chunk-PB6RXDWQ.js";import"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-YDSGXB25.js";import{a,b,c,d,f as e,g as f,h as g}from"./chunk-TM6VLC6V.js";import"./chunk-ZMWTRXFH.js";import"./chunk-I6S6DZ2E.js";import"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-HD6NR44L.js";import"./chunk-LD5B3QFW.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.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-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.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";export{f as EVOLVE_SCOPE_ADVICE,g as composeEvolveStatement,b as designStateOf,k as evolveCommand,c as evolveOneUc,j as forwardChildLine,i as liveRunDesignForUc,e as namedEntityOf,a as resolveParentUc,h as runEvolveCommand,d as staleTargets};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{f as E,k as O}from"./chunk-S7XCOBYD.js";import"./chunk-RDAIOJCR.js";import"./chunk-HM6LZ2KM.js";import"./chunk-UICJ2KLJ.js";import{k as S}from"./chunk-LXCTV75T.js";import"./chunk-TAY7J5VS.js";import{d as R}from"./chunk-NVD2MXHQ.js";import"./chunk-73Y6T2UK.js";import{e as w}from"./chunk-VE4HLIGA.js";import{d as v,e as l,h as f,i as b}from"./chunk-XMPTFXPW.js";import"./chunk-HIUAUZNL.js";import"./chunk-3YIA3DSL.js";import"./chunk-2COXO5LQ.js";import"./chunk-3V4J65GN.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-LZPYIFHZ.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as y}from"./chunk-REKHAN53.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-W2HRX3DR.js";import"./chunk-PVN64537.js";import"./chunk-H4TIVILC.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-OKA6FPJM.js";import"./chunk-B57ZRHEQ.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{na as p}from"./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-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-K75WIRI5.js";import"./chunk-FOJHSG5M.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";var k=t=>t!==void 0&&p.test(t)&&/^uc-/i.test(t)?t.toLowerCase():void 0;async function _(t){let{opts:n,ref:s}=t,r=n.mode==="agent",g=t.testing?.agentLines?{stdout:t.testing.agentLines,stderr:()=>{}}:void 0;if(n.mode!==void 0&&n.mode!=="interactive"&&n.mode!=="agent")return f(l("ndjson","evolve",g),`--mode must be interactive | agent, got '${n.mode}'`,"MODE_USAGE");let i=r?y(l("ndjson","evolve",g),{atQuestionsOnly:!0}):null,I=!r&&(t.testing?.terminal??v()),a=(e,o=2)=>i?f(i,e.message,e.code,e.remedy):(S(e),o);if(s&&n.fromStale)return a({code:"USAGE",message:"pass a <ref> OR --from-stale, not both"});if(!s&&!n.fromStale)return a({code:"USAGE",message:"evolve needs a <ref> or --from-stale"});if(!r&&(n.answer?.length??0)>0)return a({code:"USAGE",message:"--answer rides --mode agent: the blast-radius question is asked on the stream and answered on the next call. In a terminal, answer the prompt instead"});if(!r&&!I)return a({code:"USAGE",message:"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless, run with --mode agent (the question rides the stream and is answered with --answer on the next call)"});if(!r){let{runInteractiveRemote:e}=await import("./interactive-remote-O2Q2FNOH.js"),o=k(s);return e({verb:"evolve",choice:t.choice,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"interactive",...o?{useCase:o}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...o?{useCase:o}:{}},...o?{subject:o}:{}})}let h;try{h=t.testing?.basicAuth??await w()}catch(e){if(e instanceof b)return a({code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}});throw e}let d=k(s),m=[],u=null,c=await O({verb:"evolve",mode:"agent",choice:t.choice,basicAuth:h,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"agent",...d?{useCase:d}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...n.answer?.length?{answer:n.answer}:{},...d?{useCase:d}:{}},io:i,check:t.testing?.check??E,onProgress:()=>{},onNotUpdated:e=>{e.length>0&&(m=e)},onOpened:e=>{u=e.sessionId,R(process.cwd(),e.userId)},signals:!0,...t.testing?.run?{testing:t.testing.run}:{}});if(m.length===0)return i.done(c);let A=[...c===0&&u!==null?[{cmd:`kane-cli context sessions save ${u} --mode agent --yes`,why:"save the updates that finished"}]:[],...m.map(e=>({cmd:`kane-cli maintain evolve ${e} --mode agent`,why:"update its tests"}))];return i.done(c===0?1:c,void 0,A,{not_updated:m})}export{_ as remoteEvolve};
2
+ import{f as E,k as O}from"./chunk-7SU53QGU.js";import"./chunk-SXBPUUQ5.js";import"./chunk-6HRNG4CK.js";import"./chunk-JBKHX5ES.js";import{k as S}from"./chunk-4CJQ7XZP.js";import"./chunk-TAY7J5VS.js";import{d as R}from"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import{e as w}from"./chunk-NI3TIAD7.js";import{d as v,e as l,h as f,i as b}from"./chunk-XMPTFXPW.js";import"./chunk-HIUAUZNL.js";import"./chunk-X2MDL6S4.js";import"./chunk-YNDELIXL.js";import"./chunk-LRNUGKYH.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-LZPYIFHZ.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import{j as y}from"./chunk-REKHAN53.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import{na as p}from"./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-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-TM45NPWL.js";import"./chunk-FOJHSG5M.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";var k=t=>t!==void 0&&p.test(t)&&/^uc-/i.test(t)?t.toLowerCase():void 0;async function _(t){let{opts:n,ref:s}=t,r=n.mode==="agent",g=t.testing?.agentLines?{stdout:t.testing.agentLines,stderr:()=>{}}:void 0;if(n.mode!==void 0&&n.mode!=="interactive"&&n.mode!=="agent")return f(l("ndjson","evolve",g),`--mode must be interactive | agent, got '${n.mode}'`,"MODE_USAGE");let i=r?y(l("ndjson","evolve",g),{atQuestionsOnly:!0}):null,I=!r&&(t.testing?.terminal??v()),a=(e,o=2)=>i?f(i,e.message,e.code,e.remedy):(S(e),o);if(s&&n.fromStale)return a({code:"USAGE",message:"pass a <ref> OR --from-stale, not both"});if(!s&&!n.fromStale)return a({code:"USAGE",message:"evolve needs a <ref> or --from-stale"});if(!r&&(n.answer?.length??0)>0)return a({code:"USAGE",message:"--answer rides --mode agent: the blast-radius question is asked on the stream and answered on the next call. In a terminal, answer the prompt instead"});if(!r&&!I)return a({code:"USAGE",message:"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless, run with --mode agent (the question rides the stream and is answered with --answer on the next call)"});if(!r){let{runInteractiveRemote:e}=await import("./interactive-remote-7ZSTI66T.js"),o=k(s);return e({verb:"evolve",choice:t.choice,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"interactive",...o?{useCase:o}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...o?{useCase:o}:{}},...o?{subject:o}:{}})}let h;try{h=t.testing?.basicAuth??await w()}catch(e){if(e instanceof b)return a({code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}});throw e}let d=k(s),m=[],u=null,c=await O({verb:"evolve",mode:"agent",choice:t.choice,basicAuth:h,start:{kind:"new",body:{projectId:t.choice.projectId,verb:"evolve",mode:"agent",...d?{useCase:d}:{}}},run:{...s!==void 0?{ref:s}:{},...n.fromStale?{fromStale:!0}:{},...n.because?{because:n.because}:{},...n.answer?.length?{answer:n.answer}:{},...d?{useCase:d}:{}},io:i,check:t.testing?.check??E,onProgress:()=>{},onNotUpdated:e=>{e.length>0&&(m=e)},onOpened:e=>{u=e.sessionId,R(process.cwd(),e.userId)},signals:!0,...t.testing?.run?{testing:t.testing.run}:{}});if(m.length===0)return i.done(c);let A=[...c===0&&u!==null?[{cmd:`kane-cli context sessions save ${u} --mode agent --yes`,why:"save the updates that finished"}]:[],...m.map(e=>({cmd:`kane-cli maintain evolve ${e} --mode agent`,why:"update its tests"}))];return i.done(c===0?1:c,void 0,A,{not_updated:m})}export{_ as remoteEvolve};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-DTUPEKEO.js";import{b as f}from"./chunk-4LTHDJ3D.js";import{O as d}from"./chunk-45NM23EQ.js";import"./chunk-6JUS2ULI.js";import"./chunk-HG2ILWCE.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as m}from"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-6PIIUAZF.js";import{R as p,S as a,vb as u}from"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.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-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-FAMQ4DHU.js";import"./chunk-UR6MHSHU.js";async function y(e,c){let s=d(process.cwd(),{out:r=>process.stdout.write(r+`
2
+ import{a as l}from"./chunk-DTUPEKEO.js";import{b as f}from"./chunk-4LTHDJ3D.js";import{O as d}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as m}from"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-6PIIUAZF.js";import{R as p,S as a,vb as u}from"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.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-RZ4F3BHX.js";import"./chunk-A7RJQJNT.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";async function y(e,c){let s=d(process.cwd(),{out:r=>process.stdout.write(r+`
3
3
  `),err:r=>process.stderr.write(r+`
4
4
  `),confirm:async()=>!1,isTTY:!!process.stdout.isTTY});if(!s)return 2;let g=m(s),n=u(s),i=a(n,e);if(i!==null)return process.stdout.write(c.json?JSON.stringify({target:null,error:i})+`
5
5
  `:`error: ${i}
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p}from"./chunk-NZJSGINB.js";import"./chunk-N7IWR45S.js";import"./chunk-VCVEZEVS.js";import"./chunk-ERRIDBE7.js";import"./chunk-3ZC7GSMM.js";import"./chunk-OTMHCHH6.js";import"./chunk-YPGZ5E4I.js";import"./chunk-ZUZ6QJRA.js";import{b,f as c}from"./chunk-ZMIKNNO6.js";import"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-NPAUSUNM.js";import"./chunk-3AGP2BVN.js";import"./chunk-BJO6J5X2.js";import"./chunk-OOGKX4Y6.js";import"./chunk-7Y55CO42.js";import"./chunk-Q4SMITTV.js";import"./chunk-4CJQ7XZP.js";import"./chunk-DREQ3RAA.js";import"./chunk-3RO2YGKH.js";import"./chunk-72KYMWQ5.js";import"./chunk-CCOD4GQJ.js";import"./chunk-JQ64X2TO.js";import"./chunk-UTM7D4PI.js";import"./chunk-ULIIYKZB.js";import"./chunk-SMGRXKXX.js";import"./chunk-5Y2G4NC7.js";import"./chunk-TDPWFYTJ.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-X45RZIAJ.js";import"./chunk-LV7224DG.js";import"./chunk-OCVDMZWB.js";import{b as a}from"./chunk-F2F257PU.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-4IEQNX7F.js";import"./chunk-REKHAN53.js";import"./chunk-TD6GCEIK.js";import"./chunk-PVN64537.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./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-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.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";export{b as MAX_LOCAL_PARALLEL,c as MAX_REMOTE_PARALLEL,d as RETIRED_SETUP_ERROR,e as RUN_HELP_AFTER,l as TUNNEL_REMOTE_WARNING,n as VIEW_CONTEXT_TIMEOUT_MS,k as contextOption,h as normalizeAllowPosts,g as normalizeDomains,i as parseDepthCaps,j as parseSlowBudgets,f as registerExplore,m as runExploreAction,o as runExploreViewAction,p as takeSigint,a as tunnelOption};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as H}from"./chunk-IT5JVCZN.js";import{b as D}from"./chunk-GZQAETB2.js";import{a as S,b as J}from"./chunk-C6P6YUCR.js";import{a as y,b as F,d as h,h as K,i as q,j as z}from"./chunk-UMNCM4RJ.js";import"./chunk-4NEPHIAO.js";import"./chunk-ZUZ6QJRA.js";import"./chunk-Z6SI7YNV.js";import{a as G}from"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-GQARXS6F.js";import"./chunk-3AGP2BVN.js";import"./chunk-54NJJVG5.js";import"./chunk-6JUS2ULI.js";import{b as Y}from"./chunk-HG2ILWCE.js";import"./chunk-A474TUCE.js";import"./chunk-CCOD4GQJ.js";import"./chunk-UCVP7ZY4.js";import"./chunk-5Y2G4NC7.js";import"./chunk-M7Y5GGVJ.js";import"./chunk-BHQIH2FE.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SMXABALN.js";import"./chunk-6K5BEEAJ.js";import"./chunk-ZDQYGLCZ.js";import"./chunk-2GEAKFAV.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-PVN64537.js";import"./chunk-QSCXXNC2.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-FI2DVNRT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-K75WIRI5.js";import{a as V}from"./chunk-HCBYKLMW.js";import{a as $,b as E,i as L}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as I}from"./chunk-6YGTRKDT.js";import{z as a}from"./chunk-FAMQ4DHU.js";import{e as _}from"./chunk-UR6MHSHU.js";var s=_(I(),1);var i=_(V(),1);function ee(n){let t=n.last_job,l=t?.use_cases?.added?.length??0,f=t?.use_cases?.modified?.length??0,g=t?.tests?.failed??[],c=t?t.status==="ok"||t.status==="noop"?a.green:t.status==="partial"?a.amber:a.red:void 0;return{title:"Assurance context",state:{text:F(n),color:n.enabled?n.off_reason?a.amber:a.green:a.dim},rows:[{label:"last job",text:t?[t.status,y(t.cut),l||f?`${l} use case${l===1?"":"s"} added, ${f} modified`:""].filter(Boolean).join(" \xB7 "):"none yet",...c?{color:c}:{}},{label:"behind",text:g.length?g.map(r=>`${r} (design failed)`).join(", "):""},{label:"held",text:t?.held?.length?`${t.held.length} \xB7 ${t.held.map(r=>`${r.ref} ${r.why}`).join("; ")}`:""},{label:"running job",text:n.running_job?`${n.running_job.trigger==="run_end"?"run end":n.running_job.trigger} \xB7 ${y(n.running_job.cut)}`:""},{label:"pending cut",text:n.pending_cut?`${y(n.pending_cut.cut)} (${n.pending_cut.trigger==="run_end"?"run end":n.pending_cut.trigger})`:"none"},...(t?.attempt??1)>1?[{label:"",text:"retry of a failed attempt; counts cover this attempt only",color:a.dim}]:[]]}}var M=["\u2191\u2193 select","\u23CE confirm","esc back","ctrl+c exit"];function te({client:n,explorationId:t,env:l,done:f,cols:g,compact:c,subject:v}){let[r,Q]=(0,s.useState)(null),[B,A]=(0,s.useState)(null),[O,C]=(0,s.useState)([]),[p,k]=(0,s.useState)("reading the assurance context"),[d,x]=(0,s.useState)(!1),[T,m]=(0,s.useState)(0),U=(e,o)=>h(S(e,o,t).message),w=(0,s.useCallback)(async()=>{try{Q(await n.getContext(t)),A(null)}catch(e){A(S(e,"status",t).message)}},[n,t]);(0,s.useEffect)(()=>{w().finally(()=>k(null))},[w]);let R=async e=>{k(e==="sync"?"asking for an assurance job":`turning assurance context ${e}`);try{if(e==="sync"){let o=await n.syncContext(t);C(o.state==="failed"?h(J(t,o)):q(t,o))}else C(z(t,await n.setContext(t,e==="on"),e))}catch(o){C(U(o,e))}await w(),m(0),k(null)},N=r?.enabled??!0,u=d?[{key:"no",label:"No",detail:"keep it on"},{key:"yes",label:"Yes, turn off",detail:"the next cut is skipped; nothing is deleted"}]:[{key:"sync",label:"Sync now",detail:"a job on the newest cut"},N?{key:"off",label:"Turn off",detail:"the next cut is skipped; nothing is deleted"}:{key:"on",label:"Turn on",detail:"catches up from the newest ended run"},{key:"back",label:"Back"}],b=e=>{if(e==="back")return f("back");if(e==="off"){x(!0),m(0);return}if(e==="no"){x(!1),m(0);return}if(e==="yes"){x(!1),R("off");return}R(e)};L((e,o)=>{if(o.ctrl&&e==="c")return f("exit");if(o.escape){if(d){x(!1),m(0);return}return f("back")}if(p)return;if(o.upArrow)return m(P=>(P+u.length-1)%u.length);if(o.downArrow)return m(P=>(P+1)%u.length);if(d&&(e==="y"||e==="Y"))return b("yes");if(d&&(e==="n"||e==="N"))return b("no");let j=Number.parseInt(e,10);if(j>=1&&j<=u.length)return b(u[j-1].key);if(o.return)return b(u[T].key)});let W=p?{kind:"working",step:p}:{kind:"waiting"},X=r?[`context ${N?"on":"off"}`,...r.last_job?[`last job ${r.last_job.status}`]:[]]:[],Z=r?c?[]:K(r):B?h(B):[];return(0,i.jsxs)($,{flexDirection:"column",children:[c&&r?(0,i.jsx)(H,{...ee(r)}):null,Z.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`s${o}`)),O.length>0&&(0,i.jsx)($,{flexDirection:"column",marginTop:1,children:O.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`o${o}`))}),!p&&(0,i.jsx)(Y,{headline:d?"Turn assurance context off? (y/N)":"Context",ask:d,rows:u,sel:T,focused:!0,accent:a.orange}),(0,i.jsx)(D,{status:W,meta:{verb:"explore",sid:c?t.slice(0,8):t,env:l,subject:v??"assurance context"},tallies:{items:X},keys:c?M.map(e=>e==="esc back"?"esc card":e):M,remote:!0,gapAbove:!0,accent:a.orange,...g!==void 0?{cols:g}:{}})]})}async function de(n){return await G(l=>(0,i.jsx)(te,{client:n.client,explorationId:n.explorationId,env:n.env,compact:n.compact,subject:n.subject,done:l}))??"exit"}export{te as ContextPanel,M as PANEL_KEYS,ee as compactCard,de as runContextPanel};
2
+ import{a as H}from"./chunk-6FFX4S7N.js";import{b as D}from"./chunk-EJGCIGQY.js";import{a as S,b as J}from"./chunk-N7IWR45S.js";import{a as y,b as F,d as h,h as K,i as q,j as z}from"./chunk-OTMHCHH6.js";import"./chunk-YPGZ5E4I.js";import"./chunk-ZUZ6QJRA.js";import"./chunk-ZMIKNNO6.js";import{a as G}from"./chunk-YDPTSDIJ.js";import"./chunk-KGNE5CIM.js";import"./chunk-NPAUSUNM.js";import"./chunk-3AGP2BVN.js";import"./chunk-OOGKX4Y6.js";import"./chunk-7Y55CO42.js";import{b as Y}from"./chunk-YILRYMMG.js";import"./chunk-Q4SMITTV.js";import"./chunk-CCOD4GQJ.js";import"./chunk-SMGRXKXX.js";import"./chunk-5Y2G4NC7.js";import"./chunk-X45RZIAJ.js";import"./chunk-LV7224DG.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SMXABALN.js";import"./chunk-SB26HQO7.js";import"./chunk-KCXLRR3Q.js";import"./chunk-PCQK62MP.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-PVN64537.js";import"./chunk-QSCXXNC2.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import{a as V}from"./chunk-HCBYKLMW.js";import{a as $,b as E,i as L}from"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import{a as I}from"./chunk-6YGTRKDT.js";import{z as a}from"./chunk-J4FIESTB.js";import{e as _}from"./chunk-UR6MHSHU.js";var s=_(I(),1);var i=_(V(),1);function ee(n){let t=n.last_job,l=t?.use_cases?.added?.length??0,f=t?.use_cases?.modified?.length??0,g=t?.tests?.failed??[],c=t?t.status==="ok"||t.status==="noop"?a.green:t.status==="partial"?a.amber:a.red:void 0;return{title:"Assurance context",state:{text:F(n),color:n.enabled?n.off_reason?a.amber:a.green:a.dim},rows:[{label:"last job",text:t?[t.status,y(t.cut),l||f?`${l} use case${l===1?"":"s"} added, ${f} modified`:""].filter(Boolean).join(" \xB7 "):"none yet",...c?{color:c}:{}},{label:"behind",text:g.length?g.map(r=>`${r} (design failed)`).join(", "):""},{label:"held",text:t?.held?.length?`${t.held.length} \xB7 ${t.held.map(r=>`${r.ref} ${r.why}`).join("; ")}`:""},{label:"running job",text:n.running_job?`${n.running_job.trigger==="run_end"?"run end":n.running_job.trigger} \xB7 ${y(n.running_job.cut)}`:""},{label:"pending cut",text:n.pending_cut?`${y(n.pending_cut.cut)} (${n.pending_cut.trigger==="run_end"?"run end":n.pending_cut.trigger})`:"none"},...(t?.attempt??1)>1?[{label:"",text:"retry of a failed attempt; counts cover this attempt only",color:a.dim}]:[]]}}var M=["\u2191\u2193 select","\u23CE confirm","esc back","ctrl+c exit"];function te({client:n,explorationId:t,env:l,done:f,cols:g,compact:c,subject:v}){let[r,Q]=(0,s.useState)(null),[B,A]=(0,s.useState)(null),[O,C]=(0,s.useState)([]),[p,k]=(0,s.useState)("reading the assurance context"),[d,x]=(0,s.useState)(!1),[T,m]=(0,s.useState)(0),U=(e,o)=>h(S(e,o,t).message),w=(0,s.useCallback)(async()=>{try{Q(await n.getContext(t)),A(null)}catch(e){A(S(e,"status",t).message)}},[n,t]);(0,s.useEffect)(()=>{w().finally(()=>k(null))},[w]);let R=async e=>{k(e==="sync"?"asking for an assurance job":`turning assurance context ${e}`);try{if(e==="sync"){let o=await n.syncContext(t);C(o.state==="failed"?h(J(t,o)):q(t,o))}else C(z(t,await n.setContext(t,e==="on"),e))}catch(o){C(U(o,e))}await w(),m(0),k(null)},N=r?.enabled??!0,u=d?[{key:"no",label:"No",detail:"keep it on"},{key:"yes",label:"Yes, turn off",detail:"the next cut is skipped; nothing is deleted"}]:[{key:"sync",label:"Sync now",detail:"a job on the newest cut"},N?{key:"off",label:"Turn off",detail:"the next cut is skipped; nothing is deleted"}:{key:"on",label:"Turn on",detail:"catches up from the newest ended run"},{key:"back",label:"Back"}],b=e=>{if(e==="back")return f("back");if(e==="off"){x(!0),m(0);return}if(e==="no"){x(!1),m(0);return}if(e==="yes"){x(!1),R("off");return}R(e)};L((e,o)=>{if(o.ctrl&&e==="c")return f("exit");if(o.escape){if(d){x(!1),m(0);return}return f("back")}if(p)return;if(o.upArrow)return m(P=>(P+u.length-1)%u.length);if(o.downArrow)return m(P=>(P+1)%u.length);if(d&&(e==="y"||e==="Y"))return b("yes");if(d&&(e==="n"||e==="N"))return b("no");let j=Number.parseInt(e,10);if(j>=1&&j<=u.length)return b(u[j-1].key);if(o.return)return b(u[T].key)});let W=p?{kind:"working",step:p}:{kind:"waiting"},X=r?[`context ${N?"on":"off"}`,...r.last_job?[`last job ${r.last_job.status}`]:[]]:[],Z=r?c?[]:K(r):B?h(B):[];return(0,i.jsxs)($,{flexDirection:"column",children:[c&&r?(0,i.jsx)(H,{...ee(r)}):null,Z.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`s${o}`)),O.length>0&&(0,i.jsx)($,{flexDirection:"column",marginTop:1,children:O.map((e,o)=>(0,i.jsx)(E,{children:e||" "},`o${o}`))}),!p&&(0,i.jsx)(Y,{headline:d?"Turn assurance context off? (y/N)":"Context",ask:d,rows:u,sel:T,focused:!0,accent:a.orange}),(0,i.jsx)(D,{status:W,meta:{verb:"explore",sid:c?t.slice(0,8):t,env:l,subject:v??"assurance context"},tallies:{items:X},keys:c?M.map(e=>e==="esc back"?"esc card":e):M,remote:!0,gapAbove:!0,accent:a.orange,...g!==void 0?{cols:g}:{}})]})}async function de(n){return await G(l=>(0,i.jsx)(te,{client:n.client,explorationId:n.explorationId,env:n.env,compact:n.compact,subject:n.subject,done:l}))??"exit"}export{te as ContextPanel,M as PANEL_KEYS,ee as compactCard,de as runContextPanel};