@testmuai/kane-cli 0.10.3 → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/dist/ChatSurface-WKYH5MYP.js +2 -0
  2. package/dist/ChromeProfilePicker-ROQIRMWR.js +2 -0
  3. package/dist/{CliFeedbackPrompt-JWCTMIGI.js → CliFeedbackPrompt-55OKAT4W.js} +1 -1
  4. package/dist/{CliUploadProgress-XFRRFRL4.js → CliUploadProgress-NK2U3CKQ.js} +1 -1
  5. package/dist/{ConfigView-6JF4DOJN.js → ConfigView-7A5JTKLF.js} +1 -1
  6. package/dist/EvidenceViewOffer-U7J5ZRVK.js +2 -0
  7. package/dist/FolderPicker-R4QDIFTW.js +2 -0
  8. package/dist/InfoBox-SRQ4TSUT.js +2 -0
  9. package/dist/LinksBox-7BWLLQVR.js +2 -0
  10. package/dist/ProfilesView-TQTJR4WQ.js +2 -0
  11. package/dist/ProjectPicker-A5SXNDUL.js +2 -0
  12. package/dist/SaveSessionPrompt-IECYZMXW.js +2 -0
  13. package/dist/SingleShotApp-MN5IE6EU.js +2 -0
  14. package/dist/SummaryBox-WFOS6GON.js +2 -0
  15. package/dist/TestMdRunView-URNSXIVC.js +2 -0
  16. package/dist/TestrunEvidenceTable-SZPZMW3J.js +2 -0
  17. package/dist/{WhoamiView-H7JNLLCY.js → WhoamiView-G6QP4SID.js} +1 -1
  18. package/dist/{app-client-U2YYF65L.js → app-client-2RR5ATI6.js} +1 -1
  19. package/dist/app-download-UGLDWWTX.js +2 -0
  20. package/dist/{assurance-job-F4L3T4VJ.js → assurance-job-V5QB36WJ.js} +1 -1
  21. package/dist/{binary-K3XMILST.js → binary-32FXH6PQ.js} +1 -1
  22. package/dist/bind-3PB77PWJ.js +2 -0
  23. package/dist/bootstrap-A2O4UZUJ.js +2 -0
  24. package/dist/{bridge-2UHJOVLX.js → bridge-SPGIYAAG.js} +1 -1
  25. package/dist/{catalog-YCU6OHNV.js → catalog-P5IOIVYP.js} +1 -1
  26. package/dist/{catalog-client-MVEEHTG2.js → catalog-client-LR2KPSU7.js} +1 -1
  27. package/dist/{changelog-5UB3AQT6.js → changelog-GKIKDJ32.js} +1 -1
  28. package/dist/chat-committer-7E3TRZ6P.js +2 -0
  29. package/dist/chat-controller-5ZBG23L6.js +2 -0
  30. package/dist/child-MNLSG77W.js +2 -0
  31. package/dist/{chunk-5YYCCM6K.js → chunk-2AHQ3D3D.js} +1 -1
  32. package/dist/{chunk-UWPG5MWM.js → chunk-2EKLTUY2.js} +1 -1
  33. package/dist/{chunk-KL7XFNSD.js → chunk-2G7UYQOW.js} +1 -1
  34. package/dist/{chunk-GXQYFOBD.js → chunk-2MBNAW2G.js} +1 -1
  35. package/dist/{chunk-Y2HQMJGS.js → chunk-2NP3THOE.js} +1 -1
  36. package/dist/chunk-37KFCYHG.js +18 -0
  37. package/dist/{chunk-ZHAMVLQZ.js → chunk-3A4KK22B.js} +1 -1
  38. package/dist/{chunk-L3BUPFAQ.js → chunk-3CFAE36M.js} +1 -1
  39. package/dist/{chunk-TU2KPOW2.js → chunk-3DFBFYTD.js} +2 -2
  40. package/dist/{chunk-QE4AWNOV.js → chunk-3RJRCAUX.js} +6 -6
  41. package/dist/chunk-3UY4WPMQ.js +8 -0
  42. package/dist/{chunk-3NWUXRSI.js → chunk-4DM5EWEV.js} +1 -1
  43. package/dist/{chunk-ZMWTRXFH.js → chunk-4DRFMDAW.js} +1 -1
  44. package/dist/{chunk-PI7OXS62.js → chunk-5EAJO372.js} +1 -1
  45. package/dist/{chunk-4KL3TSTT.js → chunk-5K7PCSTP.js} +4 -4
  46. package/dist/{chunk-HV2CDY4K.js → chunk-5LKDOE3P.js} +1 -1
  47. package/dist/{chunk-AT7AT3AR.js → chunk-5OFHMBZC.js} +5 -5
  48. package/dist/{chunk-CQDCNP7V.js → chunk-5ORBAYTU.js} +1 -1
  49. package/dist/{chunk-2TK4MDF2.js → chunk-63BFLTJI.js} +1 -1
  50. package/dist/{chunk-BBJAKSA7.js → chunk-642GD7E6.js} +2 -2
  51. package/dist/{chunk-KKLCXRW6.js → chunk-642LB5R2.js} +1 -1
  52. package/dist/{chunk-Q4SMITTV.js → chunk-66C5A2F5.js} +1 -1
  53. package/dist/{chunk-X6FCXBXU.js → chunk-6FVGPKVX.js} +1 -1
  54. package/dist/{chunk-32HED7X2.js → chunk-6KUUSONE.js} +1 -1
  55. package/dist/{chunk-6FFX4S7N.js → chunk-6OL5EVRC.js} +1 -1
  56. package/dist/{chunk-SXBPUUQ5.js → chunk-6PZ3SVWE.js} +1 -1
  57. package/dist/{chunk-SJQTTEXQ.js → chunk-6VG2FG67.js} +1 -1
  58. package/dist/chunk-6WN4WSXR.js +2 -0
  59. package/dist/{chunk-CB2BWDHG.js → chunk-76MKY7FG.js} +4 -4
  60. package/dist/{chunk-LRNUGKYH.js → chunk-77BZTEHJ.js} +1 -1
  61. package/dist/chunk-7TSM2FCL.js +5 -0
  62. package/dist/{chunk-KQ4XKTIZ.js → chunk-A5C7HIAH.js} +1 -1
  63. package/dist/{chunk-ENRFXGID.js → chunk-ABAUIIPD.js} +1 -1
  64. package/dist/{chunk-JTNEF5ZP.js → chunk-AL6IAMYV.js} +1 -1
  65. package/dist/{chunk-4CJQ7XZP.js → chunk-AXOSLGQ4.js} +1 -1
  66. package/dist/{chunk-CNHKZE4F.js → chunk-BDZWRJAL.js} +1 -1
  67. package/dist/{chunk-VCVEZEVS.js → chunk-BFRWZPIK.js} +1 -1
  68. package/dist/{chunk-IZ66FKPC.js → chunk-BIGOLVK6.js} +1 -1
  69. package/dist/{chunk-Q4ALB7SH.js → chunk-BLHFNL5K.js} +1 -1
  70. package/dist/chunk-BRWCWZE3.js +2 -0
  71. package/dist/{chunk-X7S7IGCV.js → chunk-BXJNL22L.js} +1 -1
  72. package/dist/chunk-BZEW7CSM.js +3 -0
  73. package/dist/{chunk-Z24SD2EJ.js → chunk-C3DMMAFP.js} +1 -1
  74. package/dist/{chunk-DQXQJJOP.js → chunk-C466XER3.js} +2 -2
  75. package/dist/{chunk-BLVDV3QQ.js → chunk-C4UME2PA.js} +1 -1
  76. package/dist/chunk-CBEMXSWF.js +2 -0
  77. package/dist/{chunk-6QCCTZO3.js → chunk-CBPACEYQ.js} +1 -1
  78. package/dist/{chunk-MD3RABID.js → chunk-CJGQFKLJ.js} +1 -1
  79. package/dist/{chunk-YVVFXBT5.js → chunk-CQBLJTDU.js} +1 -1
  80. package/dist/{chunk-X2MDL6S4.js → chunk-CVVUBCB7.js} +1 -1
  81. package/dist/{chunk-35BG2EMW.js → chunk-E3C4OWSD.js} +1 -1
  82. package/dist/{chunk-ERRIDBE7.js → chunk-EIQSXD7B.js} +1 -1
  83. package/dist/{chunk-YPGZ5E4I.js → chunk-EP4WGGMY.js} +1 -1
  84. package/dist/{chunk-GAKBHNC4.js → chunk-EUGFABAS.js} +1 -1
  85. package/dist/{chunk-HBLHKQR7.js → chunk-F4GWIX66.js} +1 -1
  86. package/dist/{chunk-SALZ6WSF.js → chunk-F4XCCOWC.js} +1 -1
  87. package/dist/{chunk-NHGPMYM3.js → chunk-FHULYIG3.js} +1 -1
  88. package/dist/{chunk-7RELCXRW.js → chunk-FKA5SWWF.js} +1 -1
  89. package/dist/{chunk-OCVDMZWB.js → chunk-FLGOQ6Q6.js} +1 -1
  90. package/dist/{chunk-YILRYMMG.js → chunk-FNBHP75S.js} +1 -1
  91. package/dist/{chunk-JBKHX5ES.js → chunk-FOURJ24E.js} +1 -1
  92. package/dist/{chunk-DC5F2ADJ.js → chunk-FOUUD3LI.js} +1 -1
  93. package/dist/{chunk-IEHJG6J4.js → chunk-FP6JCXOS.js} +1 -1
  94. package/dist/{chunk-ZDCXWEQG.js → chunk-GRQKMOKE.js} +1 -1
  95. package/dist/{chunk-XKOVEMVZ.js → chunk-H23ZMHHC.js} +1 -1
  96. package/dist/{chunk-E4GIGM5V.js → chunk-H6IPGZTP.js} +1 -1
  97. package/dist/{chunk-MINDIQET.js → chunk-HBGYEA3O.js} +1 -1
  98. package/dist/{chunk-KBGMQYMD.js → chunk-HHF7AM3D.js} +1 -1
  99. package/dist/{chunk-PCQK62MP.js → chunk-HTJDMLZS.js} +1 -1
  100. package/dist/{chunk-ZPU3WAC4.js → chunk-HY5BBSYX.js} +1 -1
  101. package/dist/{chunk-TM6VLC6V.js → chunk-IPIARGHE.js} +1 -1
  102. package/dist/{chunk-M2E5CPPV.js → chunk-IPXITNFD.js} +1 -1
  103. package/dist/{chunk-NI3TIAD7.js → chunk-IT6M7OMG.js} +1 -1
  104. package/dist/{chunk-Y3RJHWNK.js → chunk-ITG5WMQG.js} +1 -1
  105. package/dist/{chunk-WEJR2V7R.js → chunk-J3XOEMKO.js} +1 -1
  106. package/dist/{chunk-OHGL4GEJ.js → chunk-J3YID4A5.js} +1 -1
  107. package/dist/{chunk-OCMPWCKQ.js → chunk-J44FV6CH.js} +1 -1
  108. package/dist/{chunk-3MD2XLE7.js → chunk-J5D4IGAM.js} +9 -8
  109. package/dist/{chunk-6QH75BPJ.js → chunk-J5QFO7LW.js} +1 -1
  110. package/dist/{chunk-GJXO6FF7.js → chunk-JBUKEIYL.js} +1 -1
  111. package/dist/{chunk-EJGCIGQY.js → chunk-JGQ3VB44.js} +1 -1
  112. package/dist/{chunk-GEZVC4S3.js → chunk-JM6AKCN4.js} +1 -1
  113. package/dist/{chunk-3KY7HHQU.js → chunk-JSSM2TWY.js} +1 -1
  114. package/dist/{chunk-3ZC7GSMM.js → chunk-JVXEAO62.js} +1 -1
  115. package/dist/{chunk-TM45NPWL.js → chunk-JYH7CTF7.js} +1 -1
  116. package/dist/{chunk-YNDELIXL.js → chunk-JZ7GFPKZ.js} +1 -1
  117. package/dist/{chunk-CTHUX7O4.js → chunk-KUSHV5SR.js} +1 -1
  118. package/dist/{chunk-LTPOMMAB.js → chunk-LB5NIDW6.js} +1 -1
  119. package/dist/{chunk-SIHX5FW5.js → chunk-LJKTIKZY.js} +1 -1
  120. package/dist/{chunk-LPJKNX6D.js → chunk-LMOW4NM5.js} +1 -1
  121. package/dist/{chunk-WIVKLNIO.js → chunk-LPJX5L3F.js} +1 -1
  122. package/dist/{chunk-HRIDAK6Y.js → chunk-LWP7E5FU.js} +1 -1
  123. package/dist/{chunk-YWWVF5OU.js → chunk-LXYXCANZ.js} +1 -1
  124. package/dist/{chunk-35WUYKGO.js → chunk-MAQVRBUQ.js} +1 -1
  125. package/dist/{chunk-NPAUSUNM.js → chunk-MBNSCXVK.js} +1 -1
  126. package/dist/{chunk-ZMIKNNO6.js → chunk-MIQ6J5YG.js} +1 -1
  127. package/dist/chunk-MTMHB5LF.js +2 -0
  128. package/dist/{chunk-RNHSULQM.js → chunk-MUL2QFG2.js} +1 -1
  129. package/dist/{chunk-MEBEVHGP.js → chunk-N4XUGIAK.js} +1 -1
  130. package/dist/{chunk-GQAWZEA4.js → chunk-NAUIJF72.js} +1 -1
  131. package/dist/{chunk-PB6RXDWQ.js → chunk-NFDVDEOH.js} +2 -2
  132. package/dist/{chunk-LHJSIHLC.js → chunk-NGBXXBHP.js} +1 -1
  133. package/dist/{chunk-YCVEI7BT.js → chunk-NIBNVPAE.js} +1 -1
  134. package/dist/chunk-NKJRAQ6L.js +6 -0
  135. package/dist/{chunk-OZNYQONA.js → chunk-NNVHWFLI.js} +3 -3
  136. package/dist/{chunk-7SU53QGU.js → chunk-NZ7UCAN6.js} +1 -1
  137. package/dist/{chunk-7V34ZMMS.js → chunk-OKCVG7AG.js} +1 -1
  138. package/dist/{chunk-LZGAFKYH.js → chunk-OMCJD4LH.js} +1 -1
  139. package/dist/{chunk-VO2NNXKR.js → chunk-OPR5XIPT.js} +1 -1
  140. package/dist/{chunk-EZMRWXRT.js → chunk-OVB5GVRB.js} +1 -1
  141. package/dist/{chunk-LV7224DG.js → chunk-PCL2FYPE.js} +1 -1
  142. package/dist/{chunk-AVLYSNEG.js → chunk-PE3CEG6E.js} +1 -1
  143. package/dist/{chunk-MEMXFTLD.js → chunk-PEHVBCXM.js} +1 -1
  144. package/dist/{chunk-6HRNG4CK.js → chunk-PKXWYYVK.js} +1 -1
  145. package/dist/{chunk-YQZ736IQ.js → chunk-PSBR2LVL.js} +1 -1
  146. package/dist/{chunk-R6TFRAMZ.js → chunk-PUNFWBRW.js} +1 -1
  147. package/dist/{chunk-7Y55CO42.js → chunk-PZOQ2IQK.js} +1 -1
  148. package/dist/{chunk-SMGRXKXX.js → chunk-Q4QCSO6Y.js} +1 -1
  149. package/dist/{chunk-TUSG7DIL.js → chunk-QJ5XHVS5.js} +1 -1
  150. package/dist/{chunk-TAY7J5VS.js → chunk-QLGQDNA3.js} +1 -1
  151. package/dist/{chunk-QEM5ZRDN.js → chunk-QRUAI2ST.js} +1 -1
  152. package/dist/{chunk-C4KAPGBS.js → chunk-QWEQ742S.js} +3 -3
  153. package/dist/{chunk-Z47ZEFH7.js → chunk-R6S4EJ5R.js} +1 -1
  154. package/dist/{chunk-WE7HRAGO.js → chunk-RHQLDNZL.js} +1 -1
  155. package/dist/{chunk-3RO2YGKH.js → chunk-RM5ZVDVR.js} +1 -1
  156. package/dist/{chunk-N7IWR45S.js → chunk-RU3SWHRE.js} +1 -1
  157. package/dist/{chunk-OBNVGD5H.js → chunk-S5UITUBB.js} +1 -1
  158. package/dist/chunk-SACFQNUH.js +47 -0
  159. package/dist/{chunk-X45RZIAJ.js → chunk-SDIHDYWT.js} +1 -1
  160. package/dist/{chunk-AHT2ORJT.js → chunk-SFHDRKUX.js} +1 -1
  161. package/dist/{chunk-OTMHCHH6.js → chunk-SLISNOG6.js} +1 -1
  162. package/dist/{chunk-T77LTLAD.js → chunk-SULRMI2J.js} +1 -1
  163. package/dist/{chunk-OOGKX4Y6.js → chunk-TC2PHBPH.js} +1 -1
  164. package/dist/{chunk-HVOXMCKE.js → chunk-TCK7WR3M.js} +1 -1
  165. package/dist/{chunk-FOLUB336.js → chunk-TFSWG7AS.js} +1 -1
  166. package/dist/{chunk-PRBWZXFA.js → chunk-TOOJTCON.js} +6 -6
  167. package/dist/chunk-TPCW5OU5.js +3 -0
  168. package/dist/chunk-U5V3L5QH.js +2 -0
  169. package/dist/{chunk-LXK4B2FE.js → chunk-UJYC2XDD.js} +1 -1
  170. package/dist/chunk-UV7FPIBL.js +2 -0
  171. package/dist/{chunk-23DKB2MT.js → chunk-UVL6XQHU.js} +1 -1
  172. package/dist/{chunk-M7A66MSK.js → chunk-UWEBI76C.js} +1 -1
  173. package/dist/{chunk-PTLOOVV4.js → chunk-UWQ4KXLB.js} +1 -1
  174. package/dist/{chunk-ZCBOHWN3.js → chunk-V24LUINK.js} +1 -1
  175. package/dist/{chunk-ND6OP3O2.js → chunk-V3IWCGZT.js} +1 -1
  176. package/dist/{chunk-YDB72F4K.js → chunk-V4SL74TK.js} +1 -1
  177. package/dist/chunk-VEE2O524.js +34 -0
  178. package/dist/{chunk-VKVYT6KZ.js → chunk-VJRXJJML.js} +2 -2
  179. package/dist/{chunk-NRAPCFI2.js → chunk-VKIUHHNT.js} +2 -2
  180. package/dist/{chunk-QHH42RH5.js → chunk-W3PQMIXE.js} +1 -1
  181. package/dist/{chunk-LLQWEGXD.js → chunk-W5EDS4DF.js} +1 -1
  182. package/dist/{chunk-LUA25RYS.js → chunk-WAC5WISH.js} +1 -1
  183. package/dist/{chunk-W54BX6HC.js → chunk-WCIRLITM.js} +1 -1
  184. package/dist/chunk-WMXBRC4B.js +21 -0
  185. package/dist/{chunk-RQKMSNEU.js → chunk-WTMCDYR3.js} +1 -1
  186. package/dist/{chunk-DXIQVBMI.js → chunk-WZ3FE5MT.js} +1 -1
  187. package/dist/{chunk-GLM5UGTF.js → chunk-X66NIHT4.js} +1 -1
  188. package/dist/{chunk-B7ZX5HEN.js → chunk-XDAFRUAJ.js} +1 -1
  189. package/dist/{chunk-JNPFEBUR.js → chunk-XDAHKZ4J.js} +1 -1
  190. package/dist/chunk-XJV5SF3X.js +26 -0
  191. package/dist/{chunk-ZCL7XIVS.js → chunk-XKJZG4GR.js} +1 -1
  192. package/dist/{chunk-EBJW6POT.js → chunk-XRJH4UF3.js} +1 -1
  193. package/dist/chunk-XTQUCCJH.js +2 -0
  194. package/dist/chunk-Y3RDLUH5.js +7 -0
  195. package/dist/{chunk-SVIIUKJ2.js → chunk-Y7GSOKXS.js} +1 -1
  196. package/dist/{chunk-UJ37XGSP.js → chunk-YF22VTR5.js} +3 -3
  197. package/dist/chunk-YIBLZIXF.js +13 -0
  198. package/dist/{chunk-2JFRN62I.js → chunk-YLI7DQMJ.js} +2 -2
  199. package/dist/chunk-YQXOD7SV.js +102 -0
  200. package/dist/{chunk-4UX5N7YI.js → chunk-YTWBNACA.js} +1 -1
  201. package/dist/{chunk-KCXLRR3Q.js → chunk-YUFXE6WU.js} +1 -1
  202. package/dist/{chunk-SSOUYKVG.js → chunk-ZIRSTOEV.js} +1 -1
  203. package/dist/command-span-HZSKIZH7.js +2 -0
  204. package/dist/commands-TRAUFCRZ.js +2 -0
  205. package/dist/{committer-UO3B3S5Y.js → committer-L2HXEODA.js} +1 -1
  206. package/dist/{config-7WTZPMAH.js → config-O3BWQUP4.js} +1 -1
  207. package/dist/cover-cmd-SAWVP7TL.js +2 -0
  208. package/dist/{credentials-5WIFF5DG.js → credentials-NNNODDXF.js} +1 -1
  209. package/dist/{deps-bundle-BLLJ2BQ4.js → deps-bundle-CXKBCA7W.js} +1 -1
  210. package/dist/{deps-resolve-WQ6J6RLI.js → deps-resolve-K7XNTRZX.js} +1 -1
  211. package/dist/design-chat-S4KYE6PP.js +2 -0
  212. package/dist/{design-committer-7YIPFKMO.js → design-committer-ZKNW5LUS.js} +1 -1
  213. package/dist/design-headless-DDAFAJNR.js +2 -0
  214. package/dist/design-remote-UITWJ72Q.js +3 -0
  215. package/dist/device-env-SBTHFSVK.js +2 -0
  216. package/dist/dispatch-BGH5PVZ4.js +2 -0
  217. package/dist/doctor-SRMLENYN.js +2 -0
  218. package/dist/{docx-convert-DO5AQYD3.js → docx-convert-PA5S2S7P.js} +1 -1
  219. package/dist/{dossier-5XKNAK6Q.js → dossier-B6KBSRJY.js} +1 -1
  220. package/dist/evidence-FOWW3MOS.js +2 -0
  221. package/dist/evolve-cmd-MDK2H4JY.js +2 -0
  222. package/dist/evolve-remote-4G7YFC5H.js +2 -0
  223. package/dist/exit-manager-UZ7DGXS4.js +2 -0
  224. package/dist/{explain-cmd-KNDORU2D.js → explain-cmd-A5YMPXAJ.js} +1 -1
  225. package/dist/explain-cmd-Q4NLNJFB.js +12 -0
  226. package/dist/explore-MWUMVGRM.js +2 -0
  227. package/dist/explore-context-tty-QLMZGYBX.js +2 -0
  228. package/dist/explore-entry-QMCVGRP4.js +6 -0
  229. package/dist/{explore-live-XIWWUV52.js → explore-live-QIET6WO4.js} +1 -1
  230. package/dist/{explore-run-tty-M56I23IF.js → explore-run-tty-6UTBRCEF.js} +2 -2
  231. package/dist/{extract-bind-LZ22VFKB.js → extract-bind-UTERWZMW.js} +3 -3
  232. package/dist/extract-chat-4WBNRVPG.js +2 -0
  233. package/dist/{extract-cmd-46E2XDWZ.js → extract-cmd-SYZX6CML.js} +2 -2
  234. package/dist/extract-headless-QBF77JWP.js +2 -0
  235. package/dist/{feeder-NGWIPZ26.js → feeder-VAY4NYBX.js} +1 -1
  236. package/dist/folder-flags-IJ556UET.js +2 -0
  237. package/dist/gaps-cmd-E55OGZ7P.js +3 -0
  238. package/dist/gate-5UIJVMHL.js +2 -0
  239. package/dist/gate-VJ7W5QIH.js +2 -0
  240. package/dist/{generate-headless-HXAVEAEZ.js → generate-headless-VYD2QIUO.js} +3 -3
  241. package/dist/hold-passthrough-ZHOC2Q26.js +2 -0
  242. package/dist/identity-66TGWITQ.js +2 -0
  243. package/dist/{impact-cmd-TJTUFAFO.js → impact-cmd-3P6SKFJC.js} +2 -2
  244. package/dist/index.js +185 -184
  245. package/dist/ingest-6UQGSQYU.js +2 -0
  246. package/dist/ingest-cmd-HMTLO5MB.js +8 -0
  247. package/dist/ingest-remote-NIW5VAGW.js +2 -0
  248. package/dist/install-KJDAGU2R.js +2 -0
  249. package/dist/{interactive-bind-SOD7VTAY.js → interactive-bind-K3ZQFHLH.js} +4 -4
  250. package/dist/{interactive-remote-7ZSTI66T.js → interactive-remote-SGM76D6M.js} +2 -2
  251. package/dist/lane-EHU4JRRU.js +2 -0
  252. package/dist/lattice-auth-DCAVEQKY.js +2 -0
  253. package/dist/lifecycle-cmd-Y5DH2PL5.js +2 -0
  254. package/dist/list-cmd-RYHICCUV.js +3 -0
  255. package/dist/list-commands-QFTIQE6Q.js +2 -0
  256. package/dist/{list-remote-EFCET42K.js → list-remote-PWAQBF57.js} +1 -1
  257. package/dist/{locks-cmd-AZKCSGHI.js → locks-cmd-76IU4JB7.js} +1 -1
  258. package/dist/{logical-ids-74PLU3VR.js → logical-ids-YMNV2MDB.js} +1 -1
  259. package/dist/login-flow-W7RAVXSD.js +2 -0
  260. package/dist/maintenance-cmd-JNP2KCSI.js +2 -0
  261. package/dist/mobile-prompts-SP2RULD7.js +2 -0
  262. package/dist/onboarding-YPIKXNYA.js +5 -0
  263. package/dist/open-provider-LXCPVNUU.js +2 -0
  264. package/dist/{pdf-convert-YB6PJFMI.js → pdf-convert-N2C3KB4Q.js} +1 -1
  265. package/dist/persist-recorded-session-BWGA7WXR.js +3 -0
  266. package/dist/phase-seed-G5JSYKSL.js +2 -0
  267. package/dist/pipeline-YE4IRKQX.js +2 -0
  268. package/dist/{policy-commands-4PUGESCW.js → policy-commands-MSJIPHDB.js} +1 -1
  269. package/dist/prepare-target-G7LU4LYX.js +2 -0
  270. package/dist/pull-cmd-G3PVSSFP.js +2 -0
  271. package/dist/pull-route-5JQUUSU7.js +2 -0
  272. package/dist/readmodel-FARAAPUU.js +2 -0
  273. package/dist/real-device-run-425XK527.js +2 -0
  274. package/dist/reconcile-cmd-QJBYZVUB.js +5 -0
  275. package/dist/reconcile-deps-TILDRCHG.js +2 -0
  276. package/dist/{reconcile-remote-3W6ZTO3G.js → reconcile-remote-JMV26DLX.js} +2 -2
  277. package/dist/recording-banner-VZ67EWWQ.js +2 -0
  278. package/dist/registry-3YMKU5GC.js +2 -0
  279. package/dist/remote-entry-6LQRYR5F.js +2 -0
  280. package/dist/remote-mode-35BQUMEL.js +4 -0
  281. package/dist/remote-words-QXVFVHOB.js +2 -0
  282. package/dist/{require-project-folder-3DTI2CVB.js → require-project-folder-O2XCXDRE.js} +1 -1
  283. package/dist/resolve-run-intent-QCRZPYXM.js +2 -0
  284. package/dist/{resolver-CDF7QKVD.js → resolver-LWXOB7PH.js} +1 -1
  285. package/dist/revert-F6MKJ73M.js +2 -0
  286. package/dist/review-cmd-PYU7YCAC.js +5 -0
  287. package/dist/run-EABFRFOF.js +2 -0
  288. package/dist/run-LX3ARF53.js +2 -0
  289. package/dist/run-remote-PS45MTHW.js +2 -0
  290. package/dist/run-startup-gate-YBQB2JLF.js +2 -0
  291. package/dist/run-test-md-XYOCVA6F.js +20 -0
  292. package/dist/session-worker.js +2 -2
  293. package/dist/{sessions-cmd-TLUITRG5.js → sessions-cmd-WUWZYZJW.js} +2 -2
  294. package/dist/{sessions-remote-INO7AWKB.js → sessions-remote-4J7ITZB4.js} +1 -1
  295. package/dist/{skill-installer-7JH5QCJF.js → skill-installer-54ZAFNOB.js} +1 -1
  296. package/dist/store-2F26FIUS.js +2 -0
  297. package/dist/store-choice-ZE7AZMRC.js +2 -0
  298. package/dist/store-guard-X5FIEZWZ.js +2 -0
  299. package/dist/{store-site-K5NHLI7D.js → store-site-AFXB6SBW.js} +1 -1
  300. package/dist/{stream-warnings-GM7YEOVG.js → stream-warnings-I5LUWVFU.js} +1 -1
  301. package/dist/support-id-RISKXA53.js +2 -0
  302. package/dist/sync-cmd-TAVE44DU.js +2 -0
  303. package/dist/sync-setup-M65RX34Y.js +2 -0
  304. package/dist/tcg-generate-OXZF7TNQ.js +2 -0
  305. package/dist/{test-definition-53XNBEDE.js → test-definition-GXEKFRRB.js} +1 -1
  306. package/dist/testmd-actions-4OHRME2Z.js +2 -0
  307. package/dist/{testmd-sync-LYHEXWCT.js → testmd-sync-HM24JCS7.js} +1 -1
  308. package/dist/token-refresh-3SEDPIXO.js +2 -0
  309. package/dist/{use-case-ref-44BPIP4N.js → use-case-ref-E3PJDHQB.js} +1 -1
  310. package/dist/{validate-basic-66XDPA3S.js → validate-basic-HWDR665U.js} +1 -1
  311. package/dist/verdicts-KB6YTIY6.js +2 -0
  312. package/dist/{version-check-SHNVYTMU.js → version-check-DRE5KT7F.js} +1 -1
  313. package/dist/{view-cmd-QOB3O6YW.js → view-cmd-3UKV3YEX.js} +1 -1
  314. package/dist/walk-session-W6OLG5NT.js +2 -0
  315. package/dist/with-telemetry-BF4BGK5S.js +2 -0
  316. package/package.json +11 -11
  317. package/dist/ChatSurface-Z26BOE5U.js +0 -2
  318. package/dist/ChromeProfilePicker-ODRIAXL3.js +0 -2
  319. package/dist/EvidenceViewOffer-6344EX74.js +0 -2
  320. package/dist/FolderPicker-4PCYHE75.js +0 -2
  321. package/dist/InfoBox-NJ2DL7YC.js +0 -2
  322. package/dist/LinksBox-HNDNFVUT.js +0 -2
  323. package/dist/ProfilesView-DEJKJOHY.js +0 -2
  324. package/dist/ProjectPicker-DTWMWOH7.js +0 -2
  325. package/dist/SaveSessionPrompt-3GCLB3ZT.js +0 -2
  326. package/dist/SingleShotApp-HMOXO5DW.js +0 -2
  327. package/dist/SummaryBox-7PPDMSSM.js +0 -2
  328. package/dist/TestMdRunView-QLKRUU4V.js +0 -2
  329. package/dist/TestrunEvidenceTable-T2JUB4TE.js +0 -2
  330. package/dist/app-download-GKRF2EIM.js +0 -2
  331. package/dist/bind-SSHAZAB3.js +0 -2
  332. package/dist/bootstrap-XGKU4WXB.js +0 -2
  333. package/dist/chat-committer-ZKEKJA2R.js +0 -2
  334. package/dist/chat-controller-FXRJXUG3.js +0 -2
  335. package/dist/child-JHYENXE7.js +0 -2
  336. package/dist/chunk-2RBMQTYS.js +0 -26
  337. package/dist/chunk-5F5IVART.js +0 -8
  338. package/dist/chunk-6SD4XTYC.js +0 -6
  339. package/dist/chunk-7YV2FCN4.js +0 -3
  340. package/dist/chunk-A2DODRHG.js +0 -2
  341. package/dist/chunk-BJO6J5X2.js +0 -3
  342. package/dist/chunk-DIOK3SER.js +0 -34
  343. package/dist/chunk-DREQ3RAA.js +0 -2
  344. package/dist/chunk-HC6VLPUB.js +0 -5
  345. package/dist/chunk-J4FIESTB.js +0 -2
  346. package/dist/chunk-NZJSGINB.js +0 -47
  347. package/dist/chunk-SXRHKXSE.js +0 -2
  348. package/dist/chunk-UJLULWSR.js +0 -21
  349. package/dist/chunk-ULIIYKZB.js +0 -7
  350. package/dist/chunk-UXGMKRS4.js +0 -102
  351. package/dist/chunk-VO66KP2W.js +0 -2
  352. package/dist/chunk-X52YIWGG.js +0 -13
  353. package/dist/chunk-ZIHQ5JGB.js +0 -18
  354. package/dist/commands-JBFLLT7A.js +0 -2
  355. package/dist/cover-cmd-DU6ZYJFL.js +0 -2
  356. package/dist/design-chat-ZICGVYIH.js +0 -2
  357. package/dist/design-headless-HYWZIIDS.js +0 -2
  358. package/dist/design-remote-HPX4VZ63.js +0 -3
  359. package/dist/device-env-4P4GUVBW.js +0 -2
  360. package/dist/dispatch-BV6XMCN3.js +0 -2
  361. package/dist/doctor-Z2YQ2DBX.js +0 -2
  362. package/dist/evidence-BJIID6VT.js +0 -2
  363. package/dist/evolve-cmd-GZCUSCEK.js +0 -2
  364. package/dist/evolve-remote-LILOAHYH.js +0 -2
  365. package/dist/exit-manager-EGWAZHCR.js +0 -2
  366. package/dist/explain-cmd-LXIVHGN7.js +0 -12
  367. package/dist/explore-SA2P3SGX.js +0 -2
  368. package/dist/explore-context-tty-PERKIWXD.js +0 -2
  369. package/dist/explore-entry-E6EY3VV3.js +0 -6
  370. package/dist/extract-chat-Z64LEAJ5.js +0 -2
  371. package/dist/extract-headless-XLS56LMN.js +0 -2
  372. package/dist/folder-flags-ZIDJVDKX.js +0 -2
  373. package/dist/gaps-cmd-XYOBJVTO.js +0 -3
  374. package/dist/gate-AK44VDHC.js +0 -2
  375. package/dist/gate-NB5CJMTN.js +0 -2
  376. package/dist/hold-passthrough-JGHWMYDM.js +0 -2
  377. package/dist/identity-HL5CJJXR.js +0 -2
  378. package/dist/ingest-ZHHHBUXR.js +0 -2
  379. package/dist/ingest-cmd-OJSKTSQK.js +0 -8
  380. package/dist/ingest-remote-2WM6PYUW.js +0 -2
  381. package/dist/install-JBWBF3WX.js +0 -2
  382. package/dist/lane-CNGO7LH5.js +0 -2
  383. package/dist/lattice-auth-UQPFQSG7.js +0 -2
  384. package/dist/lifecycle-cmd-DGIO3VAO.js +0 -2
  385. package/dist/list-cmd-HQIN3HX4.js +0 -3
  386. package/dist/list-commands-OFRRBU3D.js +0 -2
  387. package/dist/login-flow-SYKXXDLH.js +0 -2
  388. package/dist/maintenance-cmd-X5247RSJ.js +0 -2
  389. package/dist/mobile-prompts-I66ENBDW.js +0 -2
  390. package/dist/onboarding-6HIP3KW6.js +0 -5
  391. package/dist/open-provider-XDJKT3W3.js +0 -2
  392. package/dist/persist-recorded-session-RSSMTVF3.js +0 -3
  393. package/dist/phase-seed-ZZSJME7M.js +0 -2
  394. package/dist/pipeline-NTJDH5TC.js +0 -2
  395. package/dist/prepare-target-AI3GGZF6.js +0 -2
  396. package/dist/pull-cmd-NRVB5ZN7.js +0 -2
  397. package/dist/pull-route-FWCZW76M.js +0 -2
  398. package/dist/readmodel-TRV4E3MW.js +0 -2
  399. package/dist/real-device-run-NQ7RNH7C.js +0 -2
  400. package/dist/reconcile-cmd-7B7THAFJ.js +0 -5
  401. package/dist/reconcile-deps-UDQBWSLE.js +0 -2
  402. package/dist/recording-banner-WVDTWTSE.js +0 -2
  403. package/dist/registry-PFOSXOIH.js +0 -2
  404. package/dist/remote-entry-BZU4NFNS.js +0 -2
  405. package/dist/remote-mode-NXUKDUXG.js +0 -4
  406. package/dist/remote-words-JRDDNOZ6.js +0 -2
  407. package/dist/resolve-run-intent-QCL7QXIB.js +0 -2
  408. package/dist/revert-QKHPCRT6.js +0 -2
  409. package/dist/review-cmd-XBK3TGRE.js +0 -5
  410. package/dist/run-CSYGVV3D.js +0 -2
  411. package/dist/run-YUHHD54J.js +0 -2
  412. package/dist/run-remote-SFR3F2T5.js +0 -2
  413. package/dist/run-startup-gate-QSFJRYUY.js +0 -2
  414. package/dist/run-test-md-ZSREINDQ.js +0 -20
  415. package/dist/store-X4UK4AP7.js +0 -2
  416. package/dist/store-choice-27HDIFTU.js +0 -2
  417. package/dist/store-guard-ZXKB5DQH.js +0 -2
  418. package/dist/sync-cmd-2PCO7LZA.js +0 -2
  419. package/dist/sync-setup-5WQO73Y5.js +0 -2
  420. package/dist/tcg-generate-DGJD5KSM.js +0 -2
  421. package/dist/testmd-actions-XE2JPQHB.js +0 -2
  422. package/dist/token-refresh-E4FTJVHY.js +0 -2
  423. package/dist/verdicts-PVB7TV5S.js +0 -2
  424. package/dist/walk-session-WIEROYOT.js +0 -2
  425. package/dist/with-telemetry-T2PWI5CY.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as g,d as u}from"./chunk-BJO6J5X2.js";import{a as f}from"./chunk-72KYMWQ5.js";import{readFileSync as E}from"fs";var p=/\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;function h(a){let e=[];for(let o of a){let r=o.trim();if(r){if(r.startsWith("@")){let n=r.slice(1).trim(),t;try{t=E(n,"utf8")}catch(l){throw new Error(`--deps @${n}: ${l.message}`)}let s=t.trim();s&&e.push(s);continue}e.push(r)}}return e.join(`
2
+ import{c as g,d as u}from"./chunk-TPCW5OU5.js";import{a as f}from"./chunk-72KYMWQ5.js";import{readFileSync as E}from"fs";var p=/\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;function h(a){let e=[];for(let o of a){let r=o.trim();if(r){if(r.startsWith("@")){let n=r.slice(1).trim(),t;try{t=E(n,"utf8")}catch(l){throw new Error(`--deps @${n}: ${l.message}`)}let s=t.trim();s&&e.push(s);continue}e.push(r)}}return e.join(`
3
3
 
4
4
  `)}function y(a,e){let o=a.prompt.trim(),r=a.deps.trim(),n=[["--prompt",o],["--deps",r]];if(!n.some(([,i])=>p.test(i)))return p.lastIndex=0,{prompt:o,deps:r,variables:{},secretNames:[]};p.lastIndex=0;let t=u({objective:[o,r].join(`
5
5
  `),globalDir:e.globalDir,localDir:e.localDir,file:e.file,inline:e.inline,onLoadError:e.onLoadError});for(let[i,x]of n)for(let v of x.matchAll(p)){let c=v[1],b=c.replace(/^(global\.|secrets\.user\.)/,"");if(!(c in t.raw)&&!(b in t.raw))return{error:`${i} uses {{${c}}} but no variable "${b}" is defined (variables files, --variables-file or --variables)`}}let s=o?f(t.raw,o).objective:"",l=r?f(t.raw,r).objective:"",m=g(t.auteur,[s,l].join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{L as N,a as k,pa as S,r as w}from"./chunk-PI7OXS62.js";import{f as _,h as $}from"./chunk-KU3YHPWZ.js";var T=3,F={edit:"edit",reject:"mistake",dedup_dropped:"mistake",approve:"usage",enhance:"directed-edit",add:"directed-edit",default_accepted:"usage",default_overridden:"edit",gap_resolution:"usage",dedup_kept:"usage"};function P(m){let{store:u,graph:s,watermark:v,by:f}=m,{signals:b}=u.signals().snapshot(v),E=b.filter(e=>e.event_id===void 0||s.appliedEvents.has(e.event_id)),n=new Map;for(let e of E){let t=e.event_id??`${e.ts}|${e.id}|${e.verdict}|${e.polarity}`;n.has(`${t}|${e.polarity}|${e.verdict}`)||n.set(`${t}|${e.polarity}|${e.verdict}`,e)}let j=[...n.values()].sort((e,t)=>(e.event_id??e.ts)<(t.event_id??t.ts)?-1:1),i=new Map;for(let e of j){let t=`${e.verdict}|${e.tag??""}`,r=i.get(t)??{verdict:e.verdict,tag:e.tag,events:new Set};r.events.add(e.event_id??e.ts),i.set(t,r)}let d=[],a=[],g=new Set,c=[],y=0;for(let[,e]of[...i.entries()].sort(([t],[r])=>t<r?-1:1)){if(e.events.size<T)continue;let r={derived:!0,statement:`${e.verdict}${e.tag?`/${e.tag}`:""} recurs (${e.events.size} distinct events) \u2014 bias future proposals ${e.verdict==="approve"?"toward":"away from"} this pattern`,learned_from_kind:F[e.verdict]??"usage",learned_from:[...e.events].sort()},h=$("stylenote",r);if(h.length>0)return{record:null,errors:h.map(o=>({code:o.code,detail:o.detail})),minted:0};let p=k("stylenote",r);if(s.hasNode(p))continue;d.push({cid:p,label:_.STYLENOTE,content:r});for(let o of r.learned_from)c.includes(o)||c.push(o);let l=S("stylenote",o=>g.has(o),s.names.keys());l!==null&&(g.add(l),a.push({cid:p,slug:l,by:f})),y+=1}return d.length===0?{record:null,errors:null,minted:0}:{record:N(u,{ts:new Date().toISOString(),proposal_id:null,nodes:d,edges:[],review:[],supersessions:[],source_head_moves:{},...a.length>0?{names:a}:{}},{graph:s,expectPrev:s.latestHash,intent:{v:1,verb:"distill",args:w({watermark:v,by:f}),pins:{events:c}},provenance:m.provenance}).record,errors:null,minted:y}}export{P as a};
2
+ import{L as N,a as k,pa as S,r as w}from"./chunk-5EAJO372.js";import{f as _,h as $}from"./chunk-KU3YHPWZ.js";var T=3,F={edit:"edit",reject:"mistake",dedup_dropped:"mistake",approve:"usage",enhance:"directed-edit",add:"directed-edit",default_accepted:"usage",default_overridden:"edit",gap_resolution:"usage",dedup_kept:"usage"};function P(m){let{store:u,graph:s,watermark:v,by:f}=m,{signals:b}=u.signals().snapshot(v),E=b.filter(e=>e.event_id===void 0||s.appliedEvents.has(e.event_id)),n=new Map;for(let e of E){let t=e.event_id??`${e.ts}|${e.id}|${e.verdict}|${e.polarity}`;n.has(`${t}|${e.polarity}|${e.verdict}`)||n.set(`${t}|${e.polarity}|${e.verdict}`,e)}let j=[...n.values()].sort((e,t)=>(e.event_id??e.ts)<(t.event_id??t.ts)?-1:1),i=new Map;for(let e of j){let t=`${e.verdict}|${e.tag??""}`,r=i.get(t)??{verdict:e.verdict,tag:e.tag,events:new Set};r.events.add(e.event_id??e.ts),i.set(t,r)}let d=[],a=[],g=new Set,c=[],y=0;for(let[,e]of[...i.entries()].sort(([t],[r])=>t<r?-1:1)){if(e.events.size<T)continue;let r={derived:!0,statement:`${e.verdict}${e.tag?`/${e.tag}`:""} recurs (${e.events.size} distinct events) \u2014 bias future proposals ${e.verdict==="approve"?"toward":"away from"} this pattern`,learned_from_kind:F[e.verdict]??"usage",learned_from:[...e.events].sort()},h=$("stylenote",r);if(h.length>0)return{record:null,errors:h.map(o=>({code:o.code,detail:o.detail})),minted:0};let p=k("stylenote",r);if(s.hasNode(p))continue;d.push({cid:p,label:_.STYLENOTE,content:r});for(let o of r.learned_from)c.includes(o)||c.push(o);let l=S("stylenote",o=>g.has(o),s.names.keys());l!==null&&(g.add(l),a.push({cid:p,slug:l,by:f})),y+=1}return d.length===0?{record:null,errors:null,minted:0}:{record:N(u,{ts:new Date().toISOString(),proposal_id:null,nodes:d,edges:[],review:[],supersessions:[],source_head_moves:{},...a.length>0?{names:a}:{}},{graph:s,expectPrev:s.latestHash,intent:{v:1,verb:"distill",args:w({watermark:v,by:f}),pins:{events:c}},provenance:m.provenance}).record,errors:null,minted:y}}export{P as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as C}from"./chunk-SMGRXKXX.js";import{h as Q}from"./chunk-A2DODRHG.js";import{b as G}from"./chunk-LPJKNX6D.js";import{c as O}from"./chunk-SMXABALN.js";import{a as E}from"./chunk-LXK4B2FE.js";import{a as z}from"./chunk-C4KAPGBS.js";import{a as B}from"./chunk-YCVEI7BT.js";import{e as q}from"./chunk-Z7S3IWUX.js";import{l as M,q as R,t as Z}from"./chunk-A7RJQJNT.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as n,b as r,i as N}from"./chunk-33DWJV67.js";import{a as L}from"./chunk-6YGTRKDT.js";import{z as o}from"./chunk-J4FIESTB.js";import{e as g}from"./chunk-UR6MHSHU.js";var H=g(L(),1);var y=g(A(),1);function ie(e){return[{value:"local",label:"Local build",hint:R(e).join(" / "),available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function he({kind:e,onSelect:i,onCancel:m}){let s=ie(e),[b,f]=(0,H.useState)(0),[l,d]=(0,H.useState)(null);return N((p,a)=>{if(a.escape){m();return}if(a.upArrow&&f(t=>Math.max(0,t-1)),a.downArrow&&f(t=>Math.min(s.length-1,t+1)),a.return){let t=s[b];if(!t.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(t.value)}}),(0,y.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,y.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,y.jsx)(n,{marginTop:1,flexDirection:"column",children:s.map((p,a)=>{let t=a===b,S=p.available?t?o.orange:void 0:o.muted;return(0,y.jsxs)(n,{children:[(0,y.jsxs)(r,{color:S,children:[t?"\u276F ":" ",p.label]}),(0,y.jsxs)(r,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{color:o.red,children:l})}),(0,y.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var x=g(L(),1);var u=g(A(),1),j=50,J=500;function ae(e){return`${e.name} (${e.appId})`}function Re({kind:e,listApps:i,onSelect:m,onManualEntry:s,onCancel:b,busyMessage:f}){let[l,d]=(0,x.useState)([]),[p,a]=(0,x.useState)(!0),[t,S]=(0,x.useState)(!1),[ee,$]=(0,x.useState)(!1),[w,V]=(0,x.useState)(null),[X,oe]=(0,x.useState)(""),[re,_]=(0,x.useState)(!1),F=(0,x.useRef)(!0),D=(0,x.useRef)(0);if((0,x.useEffect)(()=>{let T=++D.current,k=X.trim();F.current?a(!0):k&&$(!0),S(!0),V(null),_(!1),(async()=>{let I=[];try{for(let P=0;;P+=j){let Y=await i({limit:j,offset:P,search:k});if(T!==D.current)return;if(I.push(...Y.apps),d([...I]),F.current&&(a(!1),F.current=!1),$(!1),Y.apps.length===0||I.length>=Y.total)break;if(I.length>=J){_(!0);break}}}catch(P){if(T!==D.current)return;V(P instanceof Error?P.message:String(P)),a(!1),$(!1)}finally{T===D.current&&S(!1)}})()},[X,i]),N((T,k)=>{if(k.tab){s();return}k.escape&&b()},{isActive:!!w&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(r,{color:o.secondary,children:[" ",f]})]})]});if(w)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.dim,children:w})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let te=new Map(l.map(T=>[T.appId,T])),ne=l.map(T=>({id:T.appId,label:ae(T)})),W=!p&&!t&&l.length===0&&!X.trim()?`No builds for ${M(e)} uploaded to this account yet \u2014 press Tab to enter an app id.`:null;return(0,u.jsx)(E,{title:"App under test",items:ne,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:t,searching:ee,itemNoun:"uploads",preserveSelectionById:!0,onSearch:oe,onTab:s,extraHint:"tab to enter an id",footer:W?(0,u.jsx)(r,{color:o.dim,children:W}):re?(0,u.jsx)(r,{color:o.dim,children:`Showing the first ${J} \u2014 type to search the rest.`}):void 0,onSelect:T=>{let k=te.get(T.id);k&&m({appId:k.appId,name:k.name})},onCancel:b})}var U=g(L(),1);var c=g(A(),1);function we({busyMessage:e,onSubmit:i,onBack:m}){let[s,b]=(0,U.useState)(""),[f,l]=(0,U.useState)(null);return e?(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(C,{}),(0,c.jsxs)(r,{color:o.secondary,children:[" ",e]})]})]}):(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsx)(n,{marginTop:1,children:(0,c.jsx)(r,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(r,{color:o.dim,children:" "}),(0,c.jsx)(O,{value:s,onChange:d=>{b(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!G(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:m,placeholder:"APP1016032231178585590501450"})]}),f&&(0,c.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,c.jsx)(r,{color:o.red,children:f}),(0,c.jsx)(r,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,c.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}var K=g(L(),1);var h=g(A(),1);function le(e){return Q(e.trim())}function _e({kind:e,onBack:i,onSelect:m,onCancel:s}){let[b,f]=(0,K.useState)(""),[l,d]=(0,K.useState)(null),p=R(e).join(" / ");return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.dim,children:`Path to a build (${p}): `})}),(0,h.jsxs)(n,{marginTop:1,children:[(0,h.jsx)(r,{color:o.dim,children:" "}),(0,h.jsx)(O,{value:b,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let t=le(a);if(!t){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!Z(e,t.value)){d(`${t.kind} builds don't run on ${M(e)} \u2014 expected ${p}.`);return}d(null),m(t).then(S=>{!S.ok&&S.error&&d(S.error)})},onCancel:i,placeholder:`/path/to/app${R(e)[0]}`})]}),l&&(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.red,children:l})}),(0,h.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var v=g(A(),1);function pe(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function ce(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function se(e,i){let m=i.id!==void 0?{...i,id:z(i.id)}:i,s=e.virtualName!==void 0?{...e,virtualName:z(e.virtualName)}:e;return q(s,m)}function de(e){return e.virtualName??e.displayName}function ue(e,i){let m=e.state==="ready"||e.state==="stopped",s=ce(e),b=e.osVersion?` (${e.osVersion})`:"";return{id:e.id,label:`${de(e)}${b} \xB7 ${pe(e)}`,...i&&se(e,i)?{isActive:!0}:{},...m?{}:{disabled:!0},...!m&&s?{disabledHint:s}:{}}}function me(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function eo({targets:e,preselectedTarget:i,preselectedId:m,busyMessage:s,onSelect:b,onCancel:f,kind:l}){if(s)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsxs)(n,{marginTop:1,children:[(0,v.jsx)(C,{}),(0,v.jsxs)(r,{color:o.secondary,children:[" ",s]})]})]});if(e.length===0)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(r,{color:o.dim,children:me(l)})})]});let d=e.map(t=>ue(t,i)),p=i?d.find(t=>t.isActive)?.id??null:m?e.find(t=>t.id===m||t.virtualName===m)?.id??null:null,a=new Map(e.map(t=>[t.id,t]));return(0,v.jsx)(E,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:t=>{let S=a.get(t.id);S&&b(S)},onCancel:f})}export{he as a,Re as b,we as c,_e as d,eo as e};
2
+ import{a as C}from"./chunk-Q4QCSO6Y.js";import{a as E}from"./chunk-UJYC2XDD.js";import{c as O}from"./chunk-SMXABALN.js";import{h as Q}from"./chunk-6WN4WSXR.js";import{b as G}from"./chunk-LMOW4NM5.js";import{a as z}from"./chunk-QWEQ742S.js";import{a as B}from"./chunk-NIBNVPAE.js";import{a as A}from"./chunk-HCBYKLMW.js";import{e as q}from"./chunk-Z7S3IWUX.js";import{A as o}from"./chunk-BRWCWZE3.js";import{a as n,b as r,i as N}from"./chunk-33DWJV67.js";import{a as L}from"./chunk-6YGTRKDT.js";import{l as M,q as R,t as Z}from"./chunk-A7RJQJNT.js";import{e as g}from"./chunk-UR6MHSHU.js";var H=g(L(),1);var y=g(A(),1);function ie(e){return[{value:"local",label:"Local build",hint:R(e).join(" / "),available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function he({kind:e,onSelect:i,onCancel:m}){let s=ie(e),[b,f]=(0,H.useState)(0),[l,d]=(0,H.useState)(null);return N((p,a)=>{if(a.escape){m();return}if(a.upArrow&&f(t=>Math.max(0,t-1)),a.downArrow&&f(t=>Math.min(s.length-1,t+1)),a.return){let t=s[b];if(!t.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(t.value)}}),(0,y.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,y.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,y.jsx)(n,{marginTop:1,flexDirection:"column",children:s.map((p,a)=>{let t=a===b,S=p.available?t?o.orange:void 0:o.muted;return(0,y.jsxs)(n,{children:[(0,y.jsxs)(r,{color:S,children:[t?"\u276F ":" ",p.label]}),(0,y.jsxs)(r,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{color:o.red,children:l})}),(0,y.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var x=g(L(),1);var u=g(A(),1),j=50,J=500;function ae(e){return`${e.name} (${e.appId})`}function Re({kind:e,listApps:i,onSelect:m,onManualEntry:s,onCancel:b,busyMessage:f}){let[l,d]=(0,x.useState)([]),[p,a]=(0,x.useState)(!0),[t,S]=(0,x.useState)(!1),[ee,$]=(0,x.useState)(!1),[w,V]=(0,x.useState)(null),[X,oe]=(0,x.useState)(""),[re,_]=(0,x.useState)(!1),F=(0,x.useRef)(!0),D=(0,x.useRef)(0);if((0,x.useEffect)(()=>{let T=++D.current,k=X.trim();F.current?a(!0):k&&$(!0),S(!0),V(null),_(!1),(async()=>{let I=[];try{for(let P=0;;P+=j){let Y=await i({limit:j,offset:P,search:k});if(T!==D.current)return;if(I.push(...Y.apps),d([...I]),F.current&&(a(!1),F.current=!1),$(!1),Y.apps.length===0||I.length>=Y.total)break;if(I.length>=J){_(!0);break}}}catch(P){if(T!==D.current)return;V(P instanceof Error?P.message:String(P)),a(!1),$(!1)}finally{T===D.current&&S(!1)}})()},[X,i]),N((T,k)=>{if(k.tab){s();return}k.escape&&b()},{isActive:!!w&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(r,{color:o.secondary,children:[" ",f]})]})]});if(w)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.dim,children:w})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let te=new Map(l.map(T=>[T.appId,T])),ne=l.map(T=>({id:T.appId,label:ae(T)})),W=!p&&!t&&l.length===0&&!X.trim()?`No builds for ${M(e)} uploaded to this account yet \u2014 press Tab to enter an app id.`:null;return(0,u.jsx)(E,{title:"App under test",items:ne,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:t,searching:ee,itemNoun:"uploads",preserveSelectionById:!0,onSearch:oe,onTab:s,extraHint:"tab to enter an id",footer:W?(0,u.jsx)(r,{color:o.dim,children:W}):re?(0,u.jsx)(r,{color:o.dim,children:`Showing the first ${J} \u2014 type to search the rest.`}):void 0,onSelect:T=>{let k=te.get(T.id);k&&m({appId:k.appId,name:k.name})},onCancel:b})}var U=g(L(),1);var c=g(A(),1);function we({busyMessage:e,onSubmit:i,onBack:m}){let[s,b]=(0,U.useState)(""),[f,l]=(0,U.useState)(null);return e?(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(C,{}),(0,c.jsxs)(r,{color:o.secondary,children:[" ",e]})]})]}):(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsx)(n,{marginTop:1,children:(0,c.jsx)(r,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(r,{color:o.dim,children:" "}),(0,c.jsx)(O,{value:s,onChange:d=>{b(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!G(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:m,placeholder:"APP1016032231178585590501450"})]}),f&&(0,c.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,c.jsx)(r,{color:o.red,children:f}),(0,c.jsx)(r,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,c.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}var K=g(L(),1);var h=g(A(),1);function le(e){return Q(e.trim())}function _e({kind:e,onBack:i,onSelect:m,onCancel:s}){let[b,f]=(0,K.useState)(""),[l,d]=(0,K.useState)(null),p=R(e).join(" / ");return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.dim,children:`Path to a build (${p}): `})}),(0,h.jsxs)(n,{marginTop:1,children:[(0,h.jsx)(r,{color:o.dim,children:" "}),(0,h.jsx)(O,{value:b,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let t=le(a);if(!t){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!Z(e,t.value)){d(`${t.kind} builds don't run on ${M(e)} \u2014 expected ${p}.`);return}d(null),m(t).then(S=>{!S.ok&&S.error&&d(S.error)})},onCancel:i,placeholder:`/path/to/app${R(e)[0]}`})]}),l&&(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.red,children:l})}),(0,h.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var v=g(A(),1);function pe(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function ce(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function se(e,i){let m=i.id!==void 0?{...i,id:z(i.id)}:i,s=e.virtualName!==void 0?{...e,virtualName:z(e.virtualName)}:e;return q(s,m)}function de(e){return e.virtualName??e.displayName}function ue(e,i){let m=e.state==="ready"||e.state==="stopped",s=ce(e),b=e.osVersion?` (${e.osVersion})`:"";return{id:e.id,label:`${de(e)}${b} \xB7 ${pe(e)}`,...i&&se(e,i)?{isActive:!0}:{},...m?{}:{disabled:!0},...!m&&s?{disabledHint:s}:{}}}function me(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function eo({targets:e,preselectedTarget:i,preselectedId:m,busyMessage:s,onSelect:b,onCancel:f,kind:l}){if(s)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsxs)(n,{marginTop:1,children:[(0,v.jsx)(C,{}),(0,v.jsxs)(r,{color:o.secondary,children:[" ",s]})]})]});if(e.length===0)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(r,{color:o.dim,children:me(l)})})]});let d=e.map(t=>ue(t,i)),p=i?d.find(t=>t.isActive)?.id??null:m?e.find(t=>t.id===m||t.virtualName===m)?.id??null:null,a=new Map(e.map(t=>[t.id,t]));return(0,v.jsx)(E,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:t=>{let S=a.get(t.id);S&&b(S)},onCancel:f})}export{he as a,Re as b,we as c,_e as d,eo as e};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{homedir as s}from"os";import{join as t}from"path";var g="0.10.5";var a=t(s(),".testmuai","kaneai"),h=t(a,"profiles"),u=t(a,"tui-config.json"),U=t(a,"media"),_="https://registry.npmjs.org/@testmuai/kane-cli",x="https://api.github.com/repos/LambdaTest/kane-cli/releases",i="@testmuai/kane-cli-skill",A=`https://registry.npmjs.org/${i}`,o="kane-cli",L=[{dir:t(s(),".claude","skills",o),agent:"Claude Code"},{dir:t(s(),".agents","skills",o),agent:"Codex CLI"},{dir:t(s(),".gemini","skills",o),agent:"Gemini CLI"}],E="https://dd-proxy.lambdatest.com/intake/kane-cli",R="https://v16-sumo.lambdatest.com/intake/v16-agent-telemetry",I="https://kaneai-playground.lambdatest.io",v=9222,C=9230,T=t(a,"chrome-profiles"),r=t(a,"hints"),f=t(r,"state.json");function B(e){return t(r,`catalog-${e}.json`)}var l=t(a,"evidence");function S(e){return t(l,`catalog-kane-cli-${e}.json`)}var c=t(a,"mobile");function N(e,n="android"){return t(c,n==="ios"?`device-catalog-ios-${e}.json`:`device-catalog-${e}.json`)}var m="127.0.0.1",k=18392,O=18400,p="/callback";function P(e){return`http://${m}:${e}${p}`}var D="KANE CLI",M="*",H={prod:{authBaseUrl:"https://auth.lambdatest.com",consentUrl:"https://accounts.lambdatest.com",controllerBaseUrl:"https://kaneai-api.lambdatest.com/v16-controller/v1",tmsBaseUrl:"https://test-manager-api.lambdatest.com/api",testGeneratorBaseUrl:"https://test-manager-api.lambdatest.com",secretsBaseUrl:"https://api-hyperexecute.lambdatest.com",testManagerUiUrl:"https://test-manager.lambdatest.com",shareApiBaseUrl:"https://api.lambdatest.com",v16ServerHost:"https://kaneai-api.lambdatest.com/v16-server",evidenceViewerUrl:"https://evidence.lambdatest.com",mediaArtefactsHost:"prod-mobile-artefacts.lambdatest.com",mobileAppBaseUrl:"https://api.lambdatest.com",mobileHubUrl:"https://mobile-hub.lambdatest.com/wd/hub",lrmaaBaseUrl:"https://mobile-api.lambdatest.com/mobile-automation/api/v1",latticeBaseUrl:"https://kaneai-api.lambdatest.com/v16-lattice",deviceStreamUrl:"https://stream-microfrontend.lambdatest.com"},stage:{authBaseUrl:"https://stage-auth.lambdatestinternal.com",consentUrl:"https://stage-accounts.lambdatestinternal.com",controllerBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-controller/v1",tmsBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com/api",testGeneratorBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com",secretsBaseUrl:"https://api-stage-hyperexecute.lambdatestinternal.com",testManagerUiUrl:"https://stage-test-manager.lambdatestinternal.com",shareApiBaseUrl:"https://stage-api.lambdatestinternal.com",v16ServerHost:"https://auteur-stage-automind.lambdatestinternal.com/v16-server",evidenceViewerUrl:"https://stage-evidence.lambdatestinternal.com",mediaArtefactsHost:"stage-mobile-artefacts.lambdatestinternal.com",mobileAppBaseUrl:"https://stage-api.lambdatestinternal.com",mobileHubUrl:"https://stage-mobile-hub.lambdatestinternal.com/wd/hub",lrmaaBaseUrl:"https://stage-mobile-api.lambdatestinternal.com/mobile-automation/api/v1",latticeBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-lattice",deviceStreamUrl:"https://stage-stream-microfrontend.lambdatestinternal.com"}},G={orange:"#ff9500",generateAccent:"#0d9488",assuranceAccent:"#b388ff",purple:"#b388ff",secondary:"#888888",dim:"#666666",muted:"#444444",green:"#4ade80",red:"#ef4444",amber:"#fbbf24"};export{g as a,a as b,u as c,U as d,_ as e,x as f,i as g,L as h,E as i,R as j,I as k,v as l,C as m,T as n,f as o,B as p,S as q,N as r,m as s,k as t,O as u,p as v,P as w,D as x,M as y,H as z,G as A};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-CQDCNP7V.js";import{a as Nt,b as Ft,c as St}from"./chunk-GMTHZUZ3.js";import{c as G,e as Rt}from"./chunk-UR6MHSHU.js";var Lt=G(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.CHAR=`
2
+ import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-5ORBAYTU.js";import{a as Nt,b as Ft,c as St}from"./chunk-GMTHZUZ3.js";import{c as G,e as Rt}from"./chunk-UR6MHSHU.js";var Lt=G(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.CHAR=`
3
3
  \r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`;x.S=` \r
4
4
  `;x.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";x.NAME_CHAR="-"+x.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";x.CHAR_RE=new RegExp("^["+x.CHAR+"]$","u");x.S_RE=new RegExp("^["+x.S+"]+$","u");x.NAME_START_CHAR_RE=new RegExp("^["+x.NAME_START_CHAR+"]$","u");x.NAME_CHAR_RE=new RegExp("^["+x.NAME_CHAR+"]$","u");x.NAME_RE=new RegExp("^["+x.NAME_START_CHAR+"]["+x.NAME_CHAR+"]*$","u");x.NMTOKEN_RE=new RegExp("^["+x.NAME_CHAR+"]+$","u");var tt=9,et=10,st=13,it=32;x.S_LIST=[it,et,st,tt];function Ne(e){return e>=it&&e<=55295||e===et||e===st||e===tt||e>=57344&&e<=65533||e>=65536&&e<=1114111}x.isChar=Ne;function Fe(e){return e===it||e===et||e===st||e===tt}x.isS=Fe;function Pt(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}x.isNameStartChar=Pt;function Se(e){return Pt(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}x.isNameChar=Se});var Ht=G(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}";f.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F";f.S=` \r
5
5
  `;f.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";f.NAME_CHAR="-"+f.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";f.CHAR_RE=new RegExp("^["+f.CHAR+"]$","u");f.RESTRICTED_CHAR_RE=new RegExp("^["+f.RESTRICTED_CHAR+"]$","u");f.S_RE=new RegExp("^["+f.S+"]+$","u");f.NAME_START_CHAR_RE=new RegExp("^["+f.NAME_START_CHAR+"]$","u");f.NAME_CHAR_RE=new RegExp("^["+f.NAME_CHAR+"]$","u");f.NAME_RE=new RegExp("^["+f.NAME_START_CHAR+"]["+f.NAME_CHAR+"]*$","u");f.NMTOKEN_RE=new RegExp("^["+f.NAME_CHAR+"]+$","u");var yt=9,It=10,Bt=13,Xt=32;f.S_LIST=[Xt,It,Bt,yt];function we(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isChar=we;function ke(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}f.isRestrictedChar=ke;function ve(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isCharAndNotRestricted=ve;function Oe(e){return e===Xt||e===It||e===Bt||e===yt}f.isS=Oe;function $t(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}f.isNameStartChar=$t;function Me(e){return $t(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}f.isNameChar=Me});var Ut=G(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";N.NC_NAME_CHAR="-"+N.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";N.NC_NAME_START_CHAR_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]$","u");N.NC_NAME_CHAR_RE=new RegExp("^["+N.NC_NAME_CHAR+"]$","u");N.NC_NAME_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]["+N.NC_NAME_CHAR+"]*$","u");function Wt(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}N.isNCNameStartChar=Wt;function Pe(e){return Wt(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}N.isNCNameChar=Pe});var Ct=G(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.SaxesParser=B.EVENTS=void 0;var X=Lt(),Le=Ht(),xt=Ut(),F=X.isS,ye=X.isChar,W=X.isNameStartChar,Vt=X.isNameChar,ne=X.S_LIST,Ie=X.NAME_RE,Be=Le.isChar,Xe=xt.isNCNameStartChar,$e=xt.isNCNameChar,He=xt.NC_NAME_RE,K="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",We={__proto__:null,xml:K,xmlns:I},Ue={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},C=-1,k=-2,Gt=0,Ve=1,nt=2,Ge=3,P=4,qe=5,je=6,ze=7,rt=8,Ye=9,Qe=10,Ke=11,Ze=12,A=13,q=14,at=15,Je=16,ot=17,ts=18,es=19,ht=20,ss=21,is=22,ns=23,qt=24,lt=25,j=26,jt=27,rs=28,as=29,zt=30,os=31,hs=32,O=33,ls=34,ct=35,U=36,ut=37,cs=38,Yt=39,Qt=40,us=41,Kt=42,ds=43,fs=44,dt=9,w=10,ft=13,Zt=32,Jt=33,re=34,V=38,ae=39,z=45,Y=47,ps=59,v=60,L=61,D=62,T=63,oe=91,y=93,te=133,ee=8232,Q=e=>e===re||e===ae,he=[re,ae],ms=[...he,oe,D],gs=[...he,v,y],xs=[L,T,...ne],Cs=[...ne,D,V,v];function mt(e,t,s){switch(t){case"xml":s!==K&&e.fail(`xml prefix must be bound to ${K}.`);break;case"xmlns":s!==I&&e.fail(`xmlns prefix must be bound to ${I}.`);break;default:}switch(s){case I:e.fail(t===""?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${I}.`);break;case K:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${s}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}break;default:}}function _s(e,t){for(let s of Object.keys(t))mt(e,s,t[s])}var Es=e=>He.test(e),Ds=e=>Ie.test(e),M=0,se=1,pt=2;B.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var ie={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"},gt=class{constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;let s=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,s){this.nameStartCheck=Xe,this.nameCheck=$e,this.isName=Es,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},We);let i=this.opt.additionalNamespaces;i!=null&&(_s(this,i),Object.assign(this.ns,i))}else this.nameStartCheck=W,this.nameCheck=Vt,this.isName=Ds,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=M,this.attribList=[];let{fragmentOpt:s}=this;this.state=s?A:Gt,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=s,this.xmlDeclPossible=!s,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:i}=this.opt;if(i===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");i="1.0"}this.setXMLVersion(i),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(Ue),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,s){this[ie[t]]=s}off(t){this[ie[t]]=void 0}makeError(t){var s;let i=(s=this.fileName)!==null&&s!==void 0?s:"";return this.trackPosition&&(i.length>0&&(i+=":"),i+=`${this.line}:${this.column}`),i.length>0&&(i+=": "),new Error(i+t)}fail(t){let s=this.makeError(t),i=this.errorHandler;if(i===void 0)throw s;return i(s),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let s=!1;t===null?(s=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let i=t.length,n=t.charCodeAt(i-1);!s&&(n===ft||n>=55296&&n<=56319)&&(this.carriedFromPrevious=t[i-1],i--,t=t.slice(0,i));let{stateTable:r}=this;for(this.chunk=t,this.i=0;this.i<i;)r[this.state].call(this);return this.chunkPosition+=i,s?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>=Zt||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:return t.charCodeAt(s+1)===w&&(this.i=s+2),this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>31&&i<127||i>159&&i!==ee||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:{let r=t.charCodeAt(s+1);(r===w||r===te)&&(this.i=s+2)}case te:case ee:return this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){let t=this.getCode();return t===k?w:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:s}=this,{chunk:i}=this;for(;;){let n=this.getCode(),r=n===k,a=r?w:n;if(a===C||t.includes(a))return this.text+=i.slice(s,this.prevI),a;r&&(this.text+=`${i.slice(s,this.prevI)}
@@ -0,0 +1,3 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as k}from"./chunk-QSCXXNC2.js";import{a as f}from"./chunk-UV7FPIBL.js";import{b as C,d as N}from"./chunk-CBEMXSWF.js";import{n as P}from"./chunk-G4K3TP2I.js";import{a as B,b as M}from"./chunk-6PIIUAZF.js";import{b as D}from"./chunk-XTQUCCJH.js";import{a as m}from"./chunk-BRWCWZE3.js";import{a as L,b,c as h,e as I,g as _}from"./chunk-WMXBRC4B.js";import{d as O,g}from"./chunk-ZCRZFAOT.js";import{a as T}from"./chunk-RZ4F3BHX.js";import{b as A,c as w}from"./chunk-U5V3L5QH.js";var q=/(_FAILED|_FAIL|_ERROR|_ABORT|_DEATH|_INVALID)$|^CRASH$/;function z(t,e){return t==="error"||q.test(e)}var Y=[["ASR_","assurance"],["PIPELINE_","upload"],["UPLOAD_","upload"],["DIRECT_UPLOAD_","upload"],["SCREENSHOT_","screenshot"],["EVIDENCE_","evidence"],["ARCHIVE_","evidence"],["BUNDLE_SYNC_","evidence"],["RUNNER_","runner"],["CHROME_","chrome"],["ATM_","tms"],["TMS_","tms"],["GATE_","tms"],["ENSURE_FOLDER_","tms"],["SECRET_","variables"],["VAR_","variables"],["AUTH_","auth"],["CRM_","crm"],["TESTRUN_","testrun"],["DEVICE_","device"],["SIM_","device"],["REAL_DEVICE_","device"],["CRASH","cli"]];function W(t){for(let[e,i]of Y)if(t.startsWith(e))return i;return"cli"}function a(t){if(t==null||t==="")return null;if(t instanceof Error)return`${t.name}: ${t.message}`;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function F(t,e,i,n){if(!z(t,e))return n;let r={...n};return a(r.error_code)===null&&(r.error_code=a(r.first_code)??a(r.save_blocker)??a(r.code)??a(r.reason_code)??e.toLowerCase()),a(r.error_domain)===null&&(r.error_domain=W(e)),a(r.error)===null?r.error=a(r.stderr_tail)??a(r.message)??(i&&i!==e?i:`${String(r.error_domain)}: ${String(r.error_code)}`):typeof r.error!="string"&&(r.error=a(r.error)),r}var x=-1,U=5e3,E=class{config;buffer=[];stepBuffer=new Map;heldDropped=new Map;sessionEscalated=!1;flushTimer=null;currentRunIndex=null;currentRunId=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e,i=e===null?null:`run-${e}`){this.currentRunIndex=e,this.currentRunId=i}log(e,i,n,r={}){let s=this.buildEntry(e,i,n,r);if(this.stopped){e!=="debug"&&h([s]);return}if(e==="debug"){if(this.currentRunIndex===null&&this.sessionEscalated){this.buffer.push(s);return}this.hold(this.currentRunIndex??x,s);return}e==="error"&&(this.currentRunIndex!==null&&this.promote(this.currentRunIndex),this.promote(x),this.sessionEscalated=!0),this.buffer.push(s)}logStep(e,i,n,r={}){let s=this.buildEntry("debug",i,n,r);s.run_index=e,s.run_id=`run-${e}`,!this.stopped&&this.hold(e,s)}hold(e,i){let n=this.stepBuffer.get(e);n||(n=[],this.stepBuffer.set(e,n)),n.push(i),n.length>U&&(n.shift(),this.heldDropped.set(e,(this.heldDropped.get(e)??0)+1))}promote(e){let i=this.stepBuffer.get(e),n=this.heldDropped.get(e)??0;n>0&&this.buffer.push(this.buildEntry("warn","DEBUG_LINES_DROPPED",`Dropped ${n} held debug lines`,{bucket:e,dropped:n,cap:U})),i&&i.length>0&&this.buffer.push(...i),this.stepBuffer.delete(e),this.heldDropped.delete(e)}escalate(e){this.promote(e),this.promote(x)}escalateAll(){for(let e of[...this.stepBuffer.keys()].sort((i,n)=>i-n))this.promote(e);this.sessionEscalated=!0}discardSteps(e){this.stepBuffer.delete(e),this.heldDropped.delete(e)}discardAll(){this.stepBuffer.clear(),this.heldDropped.clear()}amendUnsent(e,i){for(let n=this.buffer.length-1;n>=0;n--)if(this.buffer[n].event===e)return this.buffer[n].context={...this.buffer[n].context,...i},!0;return!1}async flush(){if(this.buffer.length===0)return;let e=this._flushBody();this._inFlightFlush=e;try{await e}finally{this._inFlightFlush===e&&(this._inFlightFlush=null)}}async _flushBody(){let e=this.buffer.splice(0),i=null;try{i=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};i&&(n.Authorization=`Bearer ${i}`);let r=JSON.stringify(e);for(let s=0;s<3;s++){try{let o=new AbortController,l=setTimeout(()=>o.abort(),1e4),c=await T(this.config.proxyUrl,{method:"POST",headers:n,body:r,signal:o.signal});if(clearTimeout(l),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}s<2&&await new Promise(o=>setTimeout(o,1e3*Math.pow(2,s)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let i=this.buffer.splice(0),n=Date.now()+e,r=!1,s,o=null;try{o=await Promise.race([this.config.getToken(),new Promise(u=>{s=setTimeout(()=>{r=!0,u(null)},e),s.unref&&s.unref()})])}catch{o=null}finally{s&&clearTimeout(s)}let l=n-Date.now();if(r||l<=0)return this.buffer.unshift(...i),"timeout";let c={"Content-Type":"application/json"};o&&(c.Authorization=`Bearer ${o}`);try{let u=new AbortController,p=setTimeout(()=>u.abort(),l);p.unref&&p.unref();let d=await T(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(i),signal:u.signal});return clearTimeout(p),d.ok?"sent":(this.buffer.unshift(...i),"failed")}catch{return this.buffer.unshift(...i),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let i=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let s;await Promise.race([n.catch(()=>{}),new Promise(o=>{s=setTimeout(o,e),s.unref&&s.unref()})]),s&&clearTimeout(s)}if(this.buffer.length===0)return"empty";let r=i-Date.now();if(r<=0)return"timeout";try{return await this.flushOnce(r)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}logDropStats(){this._droppedBatches>0&&(this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this._droppedBatches=0,this._droppedEntries=0)}async flushNow(){this.stopped||(this.logDropStats(),await this.flush())}async shutdown(){this.stopped||(this.logDropStats(),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush(),this.spoolBuffer())}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.spoolBuffer()}spoolBuffer(){let e=this.buffer.splice(0);e.length>0&&h(e)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}get runIndex(){return this.currentRunIndex}buildEntry(e,i,n,r){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:i,message:n,session_id:this.config.sessionId,run_index:i.startsWith("tcg_")?null:this.currentRunIndex,run_id:i.startsWith("tcg_")?null:this.currentRunId,identity:this.config.identity,device:this.config.device,context:F(e,i,n,r),timestamp:new Date().toISOString()}}};import{platform as Z,arch as ee}from"os";function v(t){let e=t?.trim();return e||void 0}function Q(t=process.env){let e=v(t.TEST_INSTANCE_ID),i=v(t.JOB_ID),n=v(t.TASK_ID),r=v(t.KANE_CLI_PARENT_EXECUTION_ID);return{...e?{testInstanceId:e}:{},...i?{jobId:i}:{},...n?{taskId:n}:{},...r?{parentExecutionId:r}:{}}}function j(t=process.env){if(t.KANE_CLI_MODE!=="hyperexecute")return{};let e=Q(t);return{remote:!0,...e.jobId?{hx_job_id:e.jobId}:{},...e.taskId?{hx_task_id:e.taskId}:{},...e.testInstanceId?{hx_test_instance_id:e.testInstanceId}:{},...e.parentExecutionId?{parent_execution_id:e.parentExecutionId}:{}}}function te(t=process.env){return!!t.VITEST||t.KANE_CLI_TEST==="1"}function V(t){return{cli_version:m,platform:Z(),arch:ee(),host_agent:k(),invocation_mode:t,...te()?{test:!0}:{},...j()}}import X from"fs";import $ from"fs";import ie from"path";var ne=1e3,S=0,re=new Set([130,3]),y=class t{ids;logger;opts;ended=!1;proposals=0;creditsSeen;runTotals={};createdAt=Date.now();errorState;constructor(e,i={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=i}get enabled(){return this.logger!==null}event(e,i={}){if(!this.logger)return;(e==="ASR_ERROR"||e==="EXPLORE_ERROR")&&(this.errorState.emitted=!0);let n=b(this.ids,e,i);this.logger.log(L[e],e,e,H(n))}error(e,i={}){this.logger&&(this.logger.escalate(S),this.event("ASR_ERROR",{...i,error_code:e}))}child(e,i){return new t({...this.opts,envelope:{...this.ids,operation_id:i,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:i}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:r}=i(e,g());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,r&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,i={}){this.logger&&(this.event("ASR_ERROR",{...i,error_code:e}),h(this.logger.drainBuffer()))}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let i=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...H(b(this.ids,"ASR_CMD_START",{})),trace_kind:i};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(S,`trace_${i}`,i,n)}}wireTrace(e,i,n){if(!this.logger)return;n&&this.agentSession(n);let r=i&&typeof i=="object"?i:{},s=o=>Array.isArray(o)?o.length:void 0;switch(e){case"agent_spawn":this.event("ASR_AGENT_SPAWN",{tier:r.tier,duration_ms:r.duration_ms});break;case"agent_exit":this.event("ASR_AGENT_EXIT",{exit_code:r.exit_code,signal:r.signal});break;case"session_paused":{let o=r.pending;if(!o){this.traceTee()({kind:e});break}this.event("ASR_SESSION_PAUSED",{pending_questions:s(o.questions)??0,pending_proposals:s(o.proposals)??0});break}case"proposal":{let o=r.proposal;this.event("ASR_PROPOSAL",{item_count:s(o?.use_cases),turn_index:++this.proposals});break}case"design":{let o=["acs","acceptance_criteria","scenarios","tests"].reduce((l,c)=>l+(s(r[c])??0),0);this.event("ASR_PROPOSAL",{item_count:o,turn_index:++this.proposals});break}case"validation_details":{let o=Array.isArray(r.errors)?r.errors:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0]?.code,count:o.length,turn_index:this.proposals});break}case"design_commit_failed":case"validate_failed":{let o=Array.isArray(r.codes)?r.codes:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0],count:o.length,turn_index:this.proposals});break}case"kane_validate":r.refused?this.event("ASR_VALIDATE_FAILED",{error_code:"validation_refused",count:1,turn_index:this.proposals}):this.traceTee()({kind:e});break;case"high_risk_ci":this.event("ASR_HIGH_RISK_CI",{count:r.count});break;case"resume_kind":this.event("ASR_SESSION_RESUMED",{});break;case"usage":typeof r.total_credits=="number"&&(this.creditsSeen=r.total_credits),this.traceTee()({kind:e});break;case"commit":this.event("ASR_COMMIT",r);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:r.phase,duration_ms:r.ms});break;default:this.traceTee()({kind:e,code:typeof r.code=="string"?r.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e,i={}){if(!this.ended){if(this.ended=!0,this.closeEvents(e,i),this.logger)if(this.opts.longSession)await this.logger.shutdown();else{let n=await this.logger.flushOnce(ne);(n==="failed"||n==="timeout")&&h(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),_(null)}}endSync(e,i={}){this.ended||(this.ended=!0,this.closeEvents(e,i),this.logger&&(this.logger.shutdownSync(),this.writeManifestLine(e.exit_code)),_(null))}startInterval(){this.logger?.start()}closeEvents(e,i){e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger&&(e.exit_code===0?this.logger.discardSteps(S):this.logger.escalate(S),e.exit_code>0&&!re.has(e.exit_code)&&!i.testFailed&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",{credits_total:this.creditsSeen,...this.runTotals,...e,...i.testFailed&&!this.errorState.emitted?{outcome:"test_failed"}:{}}))}setRunTotals(e){for(let[i,n]of Object.entries(e))typeof n=="number"&&Number.isFinite(n)&&(this.runTotals[i]=n)}writeManifestLine(e){try{let i=O(this.ids.context_instance_id??null);$.mkdirSync(ie.dirname(i),{recursive:!0});let n={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};$.appendFileSync(i,JSON.stringify(n)+`
3
+ `,{flag:"a",mode:384})}catch{}}};function H(t){let e={event:t.event,session_id:t.session_id,operation_id:t.operation_id,verb:t.verb,mode:t.mode,component:t.component,seq:t.seq,context_lineage_id:t.context_lineage_id,context_instance_id:t.context_instance_id};t.parent_operation_id&&(e.parent_operation_id=t.parent_operation_id),t.agent_session_id&&(e.agent_session_id=t.agent_session_id),t.lattice_session_id&&(e.lattice_session_id=t.lattice_session_id),t.project_id&&(e.project_id=t.project_id);for(let[i,n]of Object.entries(t.context))e[i]=n;return e}import{isMainThread as R}from"worker_threads";function se(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function J(){return!process.env.VITEST||process.env.KANE_TELEMETRY_TEST_FORCE==="1"}function Ve(){!J()||!R||I(f()).catch(()=>{})}function $e(t){let e=J(),i=t.env??se(),n=t.sessionId??null;if(!n&&t.resumeSid&&t.contextRoot)try{let d=P(t.contextRoot,t.resumeSid);d?.user_session_id&&(n=d.user_session_id)}catch{}if(!n&&t.applyPlanPath)try{let d=JSON.parse(X.readFileSync(t.applyPlanPath,"utf8"));d.telemetry?.user_session_id&&(n=d.telemetry.user_session_id)}catch{}let r=t.sessionId===void 0?n!==null:t.resumeSid!==void 0;n||(n=A());let s=null,o=null,l=!1;if(t.contextRoot&&X.existsSync(t.contextRoot))if(t.write&&e){let d=M(t.contextRoot,g());s=d.ids.context_lineage_id,o=d.ids.context_instance_id,l=d.cloned}else{let d=B(t.contextRoot);s=d?.context_lineage_id??null,o=d?.context_instance_id??null}let c={session_id:n,operation_id:w(),context_lineage_id:s,context_instance_id:o,...t.remote?{lattice_session_id:t.remote.sessionId,project_id:t.remote.projectId}:{},verb:(R&&!t.errorsOnly?C():null)??t.verb,mode:t.mode,component:"kane-cli"},u=null;if(e){let d=D(i),K={org_id:d.org_id??"",user_id:d.user_id??"",machine_id:d.machine_id,email:null,email_domain:"",user_type:d.user_id||d.org_id?d.user_type??"unknown":"anonymous",env:d.env,plan:d.plan??"unknown"},G=t.mode==="interactive"||t.mode==="cli"?"cli":"agent";u=new E({proxyUrl:f(),sessionId:n,identity:K,device:V(G),getToken:async()=>null}),t.longSession&&u.start()}let p=new y({envelope:c,logger:u,longSession:!!t.longSession,proxyUrl:f(),clientVersion:`kane-cli/${m}`,telemetryEnabled:e});return e&&!t.errorsOnly&&(_(c),R&&N(),p.event("ASR_CMD_START",{resumed:r,applied_plan:!!t.applyPlanPath}),l&&p.event("ASR_CONTEXT_CLONED"),R&&I(f()).catch(()=>{})),p}export{E as a,Q as b,V as c,ne as d,se as e,J as f,Ve as g,$e as h};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-CQDCNP7V.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-PI7OXS62.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
2
+ import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-5ORBAYTU.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-5EAJO372.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
3
3
  `).some(h=>h.length>Ae)&&v.push(`long line detected (> ${Ae} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let k=F(n),O=new Map,I=null,_=null,m=null,B=new Map,R=!1;for(let h=0;;h++){let c=$e(i),u=c.heads.get(s),U=u!=null?c.getNode(u)?.content:void 0,b=Xe(s,Ne(c,s,u),t?t.id:null,u===null);if(b)throw new Error(b);if(u!=null&&U?.blob===k)return{status:"unchanged",source_id:s,cid:u,blob:k};if(u==null){for(let[r,E]of c.heads.entries())if(!(r===s||E==null)&&c.getNode(E)?.content.blob===k){if(Ne(c,r,E)!==(t?t.id:null))continue;let f;if(O.has(r)?f=O.get(r):h===0&&d?(f=await d(r),O.set(r,f)):(f=!1,O.set(r,f),h>0&&v.push(`same bytes already ingested as '${r}' \u2014 minted under '${s}' anyway (the twin appeared mid-commit; not prompted)`)),f)return{status:"unchanged",source_id:r,cid:E,blob:k};break}}let V=t?ne("source",te(s,k)):void 0,W=V!==void 0&&c.nodeLabel.has(V)?c.mediaOf(V):void 0,l=W?.format==="plugin"&&W.plugin?W:void 0,X=null;if(l){let r=[];if(l.text_blob&&i.getBlob(l.text_blob)===null&&r.push(`its text (${l.text_blob.slice(0,19)})`),l.plugin.index&&(X=ie(i.getBlob(l.plugin.index)),X===null&&r.push(`its unit index (${l.plugin.index.slice(0,19)})`)),l.plugin.notes&&i.getBlob(l.plugin.notes)===null&&r.push(`its notes (${l.plugin.notes.slice(0,19)})`),l.plugin.coverage&&i.getBlob(l.plugin.coverage)===null&&r.push(`its coverage plan (${l.plugin.coverage.slice(0,19)})`),r.length>0)throw new Error(`VERSION_BLOB_MISSING: this store has held these bytes of '${s}' before, and ${r.join(" and ")} from that ingest ${r.length>1?"are":"is"} not in the blob store \u2014 a version keeps what its first ingest stored, so it cannot be read again; restore the blobs from a copy of this store (kane-cli context fsck names what is missing)`)}if(!l&&m===null){let r={},E,f=null,A=null,M;if(w){let $=p?.[w];if(!$)throw new Error(`${w.toUpperCase()}_CONVERTER_MISSING: ${w} ingestion requires the converter \u2014 the command layer wires it`);let x=await $(n),y=re(x.projection);y.replaced>0&&v.push(se(s,y.replaced)),f=Buffer.from(y.text,"utf8");let D=Ye(s,o.kind,f),ge=()=>new Error(`PROJECTION_TOO_LARGE: serialized source payload ${D} bytes > ${4e5} \u2014 split the document and re-ingest`);if(D>4e5){if(!t)throw ge();if(f.byteLength>L.textBytes)throw new Error(`PLUGIN_TEXT_TOO_LARGE: plugin ${t.id} rendered ${s} to ${f.byteLength} bytes of text; a plugin's source may be at most ${L.textBytes} \u2014 split the source and ingest the parts`)}if(r={text_blob:F(f),...x.inventory.length>0?{images:x.inventory}:{},converter:x.converter},A=x.blobs,E={kind:o.kind,...x.pages!==void 0?{pages:x.pages}:{},delivered:x.delivered.length,omitted:x.inventory.length-x.delivered.length},t){let T=be(x.units,y.text);if(!T.ok)M={fault:T.fault};else{let me=ye(t.id,t.rules,T.units,y.text),G=ve(me);M=G.ok?{index:me,bytes:G.bytes,fp:F(G.bytes),given:T.units}:{fault:G.fault}}if(D>4e5&&(!("index"in M)||M.given.length===0))throw ge()}}else if(o.cite==="verbatim"){let $=re(n.toString("utf8"));$.replaced>0&&(v.push(se(s,$.replaced)),f=Buffer.from($.text,"utf8"),r={text_blob:F(f)})}let P=[...r.text_blob?[r.text_blob]:[],...A?A.keys():[]];m={derived:r,composite:E,projBytes:f,derivedBlobs:A,derivedFps:P,...M?{units:M}:{}}}let a=l?{derived:{...l.text_blob?{text_blob:l.text_blob}:{},...l.converter?{converter:l.converter}:{}},composite:{kind:o.kind,delivered:0,omitted:0},projBytes:null,derivedBlobs:null,derivedFps:l.text_blob?[l.text_blob]:[]}:m;if(l)i.putBlob(n);else if(!R){if(i.putBlob(n),a.projBytes!==null&&i.putBlob(a.projBytes),a.derivedBlobs!==null)for(let[,r]of a.derivedBlobs)i.putBlob(r);R=!0}let Y=te(s,k),z=xe("source",Y);if(z.length>0)throw new Error(`source node fails ${z[0].code}: ${z[0].detail}`);let H=ne("source",Y),S,N,J,q=[],Q=[],Z=[];if(t){let r=null,E;l?(E=l.plugin.index,r=X,N=r?{indexed:r.units.length}:{fault:{code:"UNIT_LIST_INVALID",detail:"this version was first stored without a unit index, and a version keeps what its first ingest stored"}}):a.units&&"index"in a.units?(i.putBlob(a.units.bytes),r=a.units.index,E=a.units.fp,N={indexed:r.units.length}):a.units&&(N={fault:a.units.fault});let f=u!=null?c.mediaOf(u):void 0,A=r&&f?.format==="plugin"&&f.plugin?.index?ie(i.getBlob(f.plugin.index)):null,M=r&&A&&A.plugin===r.plugin&&A.rules===r.rules?A:null,P=r&&M&&u!=null?_e(M,r):null;if(P!==null&&P.changed.length>0&&e.explain&&!l&&u!=null&&a.projBytes!==null){let y=B.get(u);if(y===void 0){let D=f?.text_blob?i.getBlob(f.text_blob):null;y=D===null?{reasons:{},warnings:[]}:await Qe({call:e.explain,ms:e.explainMs??L.explainMs,plugin:t.id,sourceId:s,changed:P.changed,before:{index:M,text:D.toString("utf8")},after:{index:r,text:a.projBytes.toString("utf8")}}),B.set(u,y)}q=y.warnings,Object.keys(y.reasons).length>0&&(J=y.reasons)}let $;if(l)$=l.plugin.notes;else if(t.notes!==void 0)$=t.notes;else if(e.context&&a.projBytes!==null){if(I===null){let y=a.units&&"index"in a.units?a.units.given:[];I=await Je({call:e.context,ms:e.contextMs??L.hookMs,plugin:t.id,sourceId:s,text:a.projBytes.toString("utf8"),units:y})}I.notes!==null&&(i.putBlob(I.notes.bytes),$=I.notes.fp),Q=I.warnings}let x;l?x=l.plugin.coverage:t.coverage!==void 0?x=t.coverage:e.coverage&&a.units&&"index"in a.units&&(_===null&&(_=await qe({call:e.coverage,ms:e.coverageMs??L.hookMs,plugin:t.id,sourceId:s,units:a.units.given})),_.plan!==null&&(i.putBlob(_.plan.bytes),x=_.plan.fp),Z=_.warnings),S={id:l?l.plugin.id:t.id,rules:l?l.plugin.rules:t.rules,...E?{index:E}:{},...$?{notes:$}:{},...x?{coverage:x}:{},...(l?l.plugin.cites_deep:t.citesDeep)===!0?{cites_deep:!0}:{},...P!==null&&u!=null?{changes:{from:u,...P,...J?{reasons:J}:{}}}:{},...t.fetch!==void 0?{fetch:{ref:t.fetch.ref,...t.fetch.cursor!==void 0?{cursor:t.fetch.cursor}:{}}}:{}}}let ce=N&&"fault"in N?[...v,`${s} is stored without a unit index: ${N.fault.detail} [${N.fault.code}] \u2014 everything that cites an earlier version of it reads stale`]:v,pe=q.length>0||Q.length>0||Z.length>0?[...ce,...q,...Q,...Z]:ce,Re=[...a.derivedFps,...S?.index?[S.index]:[],...S?.notes?[S.notes]:[],...S?.coverage?[S.coverage]:[]],fe={format:o.kind,media_type:o.media_type,anchors_supported:t?["L-L"]:w?["L-L","img#ref"]:o.cite==="verbatim"?["L-L"]:[],...a.derived,...S?{plugin:S}:{}};try{Ee(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:H,label:ee.SOURCE,content:Y}],edges:[],review:[],supersessions:[],media:{[s]:fe},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[s]:H}},{graph:c,expectPrev:c.latestHash,intent:{v:1,verb:"ingest",args:we({source_id:s,blob:k,label:g,media:fe,derived_blobs:Re,eventIds:e.eventIds??null}),pins:{prior_head:u??null}},provenance:e.provenance})}catch(r){if(r instanceof Be&&h<3)continue;throw r}return{status:u!=null?"versioned":"created",source_id:s,cid:H,blob:k,...pe.length?{warnings:pe}:{},...a.composite?{composite:a.composite}:{},...C.gitignore?{gitignore:C.gitignore}:{},...N?{units:N}:{}}}}async function Je(e){let i="the version, its units and what changed are stored as they are; only the notes are missing",n;try{n=await e.call({text:e.text,units:e.units},e.ms)}catch(t){let s=j(t instanceof Error?t.message:String(t))??"it failed";return{notes:null,warnings:[`plugin ${e.plugin} gave no notes for ${e.sourceId}: ${s} \u2014 ${i} [PLUGIN_CONTEXT_FAILED]`]}}let o=Oe(e.plugin,n,new Set(e.units.map(t=>t.id))),d=[];if(o.invalid!==void 0&&d.push(`plugin ${e.plugin} answered context for ${e.sourceId} with ${o.invalid} \u2014 ${i} [PLUGIN_NOTES_INVALID]`),o.dropped.length>0){let t=o.dropped.reduce((s,g)=>s+g.count,0);d.push(`${t} ${t===1?"note":"notes"} of plugin ${e.plugin} for ${e.sourceId} ${t===1?"is":"are"} not kept: ${o.dropped.map(s=>`${s.count} ${s.why}`).join("; ")} \u2014 the version, its units and what changed are stored as they are, with the notes that are kept [PLUGIN_NOTES_DROPPED]`)}if(o.notes===null)return{notes:null,warnings:d};let p=ke(o.notes);return{notes:{bytes:p,fp:F(p)},warnings:d}}async function qe(e){let i="the version, its units and what changed are stored as they are, with no coverage plan: every unit of it is expected to have tests",n;try{n=await e.call({units:e.units},e.ms)}catch(p){let t=j(p instanceof Error?p.message:String(p))??"it failed";return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${t} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]}}let o=Le(e.plugin,n,e.units.map(p=>p.id));if(o.plan===null)return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${o.fault} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]};let d=Me(o.plan);return{plan:{bytes:d,fp:F(d)},warnings:[]}}async function Qe(e){let i=m=>{let B=he(m.text),R=new Map(m.index.units.map(h=>[h.id,h]));return h=>{let c=R.get(h);if(c===void 0||c.lines===void 0)return null;let{text:u,segments:U,...b}=c;return{unit:{...b,lines:[c.lines[0],c.lines[1]]},text:B.slice(c.lines[0]-1,c.lines[1]).join(`
4
4
  `)}}},n=i(e.before),o=i(e.after),d={},p=[],t=[],s=[],g="",C=0,v=[],w=[],k=Date.now();for(let m=0;m<e.changed.length;m++){let B=e.changed[m],R=n(B),h=o(B);if(R===null||h===null)continue;let c=e.ms-(Date.now()-k);if(c<=0){v=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}let u;try{u=await e.call({sourceId:e.sourceId,before:R,after:h},c)}catch(b){p.push(B),g===""&&(g=b instanceof Error?b.message:String(b));continue}if(u==null)continue;let U=j(u);if(U===null){s.push(B);continue}if(U.length>L.reasonChars){t.push(B);continue}if(C+Buffer.byteLength(U,"utf8")>L.reasonsBytes){w=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}C+=Buffer.byteLength(U,"utf8"),d[B]=U}let O=m=>`${m.length} changed ${m.length===1?"unit":"units"} of ${e.sourceId} (${m.slice(0,5).join(", ")}${m.length>5?`, and ${m.length-5} more`:""})`,I="the version, its units and what changed are stored as they are; only the wording is missing",_=[];return p.length>0&&_.push(`plugin ${e.plugin} gave no reason for ${O(p)}: ${j(g)??"it failed"} \u2014 ${I} [PLUGIN_EXPLAIN_FAILED]`),v.length>0&&_.push(`plugin ${e.plugin} was not asked for a reason for ${O(v)}: its answers took the ${Math.round(e.ms/1e3)} seconds a version's reasons may take \u2014 ${I} [PLUGIN_EXPLAIN_TIMEOUT]`),s.length>0&&_.push(`plugin ${e.plugin} answered with something that is not a line of text for ${O(s)} \u2014 ${I} [PLUGIN_REASON_INVALID]`),t.length>0&&_.push(`plugin ${e.plugin} gave a reason over ${L.reasonChars} characters for ${O(t)}; it is dropped \u2014 ${I} [PLUGIN_REASON_TOO_LONG]`),w.length>0&&_.push(`the reasons of plugin ${e.plugin} passed ${L.reasonsBytes} bytes for one version; none is kept for ${O(w)} \u2014 ${I} [PLUGIN_REASONS_OVER_LIMIT]`),{reasons:d,warnings:_}}export{Fe as a,De as b,je as c,Te as d,Ge as e,Ke as f,le as g,ae as h,en as i,Se as j,nn as k,Xe as l,Ye as m,ze as n,wn as o,In as p,He as q};
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as j}from"./chunk-X45RZIAJ.js";import{e as d}from"./chunk-SB26HQO7.js";import{r as a}from"./chunk-UJLULWSR.js";import{a as y}from"./chunk-ZCBOHWN3.js";import{a as h}from"./chunk-TM45NPWL.js";var $=10,u=200,C=1e4,N=1e6;function k(t,e,r="streaming"){let n=r==="full-fetch"?N:C,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function S(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function b(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
2
+ import{a as j}from"./chunk-SDIHDYWT.js";import{e as d}from"./chunk-SB26HQO7.js";import{a as y}from"./chunk-V24LUINK.js";import{a as h}from"./chunk-JYH7CTF7.js";import{q as a}from"./chunk-WMXBRC4B.js";var $=10,u=200,C=1e4,N=1e6;function k(t,e,r="streaming"){let n=r==="full-fetch"?N:C,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function S(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function b(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
3
3
  `)){for(let n of t)r(JSON.stringify(n));r(JSON.stringify({_meta:"page",limit:e.limit,offset:e.offset,returned:t.length,has_more:e.has_more}))}function T(t,e,r=n=>process.stdout.write(`${n}
4
- `)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:m}=await import("./token-refresh-E4FTJVHY.js"),w=await m({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(m){return{ok:!1,reason:"refresh_failed",detail:m instanceof Error?m.message:String(m)}}let c=y(e),f=await new j(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
4
+ `)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:m}=await import("./token-refresh-3SEDPIXO.js"),w=await m({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(m){return{ok:!1,reason:"refresh_failed",detail:m instanceof Error?m.message:String(m)}}let c=y(e),f=await new j(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
5
5
  `,exitCode:2};case"refresh_failed":return{message:`error: OAuth token refresh failed for profile "${t}" [${e}]${r.detail?`: ${r.detail}`:""}. Run \`kane-cli login\` to re-auth.
6
6
  `,exitCode:2};case"exchange_failed":return{message:`error: TMS credential exchange failed for profile "${t}" [${e}]. Token may be revoked \u2014 try \`kane-cli login\`; if the problem persists, TMS may be down.
7
7
  `,exitCode:2}}}function M(t){return{id:t.project_id,name:t.name}}function O(t){return{id:t.id,name:t.name}}async function P(t,e,r,n){let o=r+n+1,i=[],s=!0;for await(let c of t.listProjectsStream({name:e})){if(i.push(...c.projects),c.done){s=!0;break}if(i.length>=o){s=!1;break}}return{items:i,doneStreaming:s}}function g(t){return!!t.agent||!process.stdin.isTTY||!process.stdout.isTTY}function x(t,e=r=>process.stdout.write(`${r}
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as $e,b as we,g as Ee}from"./chunk-4KL3TSTT.js";import{a as te}from"./chunk-SMGRXKXX.js";import{a as G}from"./chunk-5Y2G4NC7.js";import{b as ye}from"./chunk-WN5VKKJ3.js";import{a as Be}from"./chunk-YVVFXBT5.js";import{a as Te}from"./chunk-ND6OP3O2.js";import{a as E}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as ve,k as ee}from"./chunk-33DWJV67.js";import{a as z}from"./chunk-6YGTRKDT.js";import{z as i}from"./chunk-J4FIESTB.js";import{e as R}from"./chunk-UR6MHSHU.js";var M=R(z(),1);var I=R(z(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function ke(e){let t=Ee(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,I.useState)(0),[a,u]=(0,I.useState)("idle"),c=(0,I.useRef)("idle"),B=(0,I.useRef)(0),S=(0,I.useRef)(!1),v=(0,I.useRef)(null),d=(0,I.useRef)(null),O=(0,I.useCallback)(m=>{c.current=m,u(m)},[]),P=(0,I.useCallback)(async m=>{e.reportVerdictOnComplete&&await t.shutdownRunner($e(e.runVerdict?.()??(m?"failed":"passed"))),e.onAllComplete?.()},[t,e]),T=(0,I.useCallback)(async m=>{let b=await e.getNextConfig(m);if(!b){O("done"),await P(!1);return}let C=m?B.current+1:0;B.current=C,l(C),e.onStepStart?.(b,C),v.current=null,d.current=null,O("running"),await t.startRun(b,e.spawnOpts)},[t,e,O]);(0,I.useEffect)(()=>{S.current||(S.current=!0,T(null))},[]),(0,I.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===v.current||c.current!=="running")return;v.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let m=t.lastRunEnd,b=de(t.steps),C=t.bifurcationInfo,A={status:m.status==="passed"?"passed":"failed",duration_s:m.duration??0,reason:m.reason,runEnd:m,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:C&&!C.isSingleFlow?C.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(A,B.current)??!0)){O("done"),P(A.status==="failed");return}T(A)},[t.lastRunEnd]),(0,I.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let m=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:m.passed,stepsFailed:m.failed,stepsTotal:m.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,B.current)??!0)){O("done"),P(!0);return}T(b)},[t.runError,t.lastRunEnd]);let k=(0,I.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:k}}var pe=R(z(),1);var ne=R(E(),1),Ce=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Le({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);G(()=>{l(B=>(B+1)%Ce.length)},80),G(()=>{u(B=>(B+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ce[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Oe(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var L=R(z(),1);var Pe=R(z(),1);var re=R(E(),1),Ue="#ffc580",We="#ffd9a8",Ie="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Pe.useState)(0),a=4;if(G(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Ie,children:e});let u=e.split("").map((c,B)=>{let S=n-a,v=Math.abs(B-S-a/2),d;return v<=a/2?d=Ue:v<=a?d=We:d=Ie,(0,re.jsx)(o,{color:d,children:c},B)});return(0,re.jsx)(o,{children:u})}var _=R(E(),1),ze={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=ze[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Xe={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function De(e){return Xe[e]??"\u25CF"}var q=R(E(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let B=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return B?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(v=>(0,q.jsx)(s,{marginLeft:2,children:l(v,`${S}-${v.childId??"p"}-${v.index}`)},`${S}-${v.childId??"p"}-${v.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var K=R(E(),1);function je({label:e,shimmer:t=!1}){return(0,K.jsxs)(s,{marginLeft:6,children:[(0,K.jsx)(te,{}),(0,K.jsx)(o,{children:" "}),t?(0,K.jsx)(oe,{text:e,active:!0}):(0,K.jsx)(o,{color:i.dim,children:e})]})}var Fe=R(z(),1);var me=R(E(),1);function Ye(e,t){let n=[];for(let l of e.split(`
2
+ import{a as $e,b as we,g as Ee}from"./chunk-5K7PCSTP.js";import{a as te}from"./chunk-Q4QCSO6Y.js";import{a as G}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-CQBLJTDU.js";import{a as Te}from"./chunk-V3IWCGZT.js";import{b as ye}from"./chunk-WN5VKKJ3.js";import{a as E}from"./chunk-HCBYKLMW.js";import{A as i}from"./chunk-BRWCWZE3.js";import{a as s,b as o,i as Se,j as ve,k as ee}from"./chunk-33DWJV67.js";import{a as z}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var M=R(z(),1);var I=R(z(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function ke(e){let t=Ee(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,I.useState)(0),[a,u]=(0,I.useState)("idle"),c=(0,I.useRef)("idle"),B=(0,I.useRef)(0),S=(0,I.useRef)(!1),v=(0,I.useRef)(null),d=(0,I.useRef)(null),O=(0,I.useCallback)(m=>{c.current=m,u(m)},[]),P=(0,I.useCallback)(async m=>{e.reportVerdictOnComplete&&await t.shutdownRunner($e(e.runVerdict?.()??(m?"failed":"passed"))),e.onAllComplete?.()},[t,e]),T=(0,I.useCallback)(async m=>{let b=await e.getNextConfig(m);if(!b){O("done"),await P(!1);return}let C=m?B.current+1:0;B.current=C,l(C),e.onStepStart?.(b,C),v.current=null,d.current=null,O("running"),await t.startRun(b,e.spawnOpts)},[t,e,O]);(0,I.useEffect)(()=>{S.current||(S.current=!0,T(null))},[]),(0,I.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===v.current||c.current!=="running")return;v.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let m=t.lastRunEnd,b=de(t.steps),C=t.bifurcationInfo,A={status:m.status==="passed"?"passed":"failed",duration_s:m.duration??0,reason:m.reason,runEnd:m,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:C&&!C.isSingleFlow?C.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(A,B.current)??!0)){O("done"),P(A.status==="failed");return}T(A)},[t.lastRunEnd]),(0,I.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let m=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:m.passed,stepsFailed:m.failed,stepsTotal:m.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,B.current)??!0)){O("done"),P(!0);return}T(b)},[t.runError,t.lastRunEnd]);let k=(0,I.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:k}}var pe=R(z(),1);var ne=R(E(),1),Ce=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Le({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);G(()=>{l(B=>(B+1)%Ce.length)},80),G(()=>{u(B=>(B+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ce[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Oe(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var L=R(z(),1);var Pe=R(z(),1);var re=R(E(),1),Ue="#ffc580",We="#ffd9a8",Ie="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Pe.useState)(0),a=4;if(G(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Ie,children:e});let u=e.split("").map((c,B)=>{let S=n-a,v=Math.abs(B-S-a/2),d;return v<=a/2?d=Ue:v<=a?d=We:d=Ie,(0,re.jsx)(o,{color:d,children:c},B)});return(0,re.jsx)(o,{children:u})}var _=R(E(),1),ze={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=ze[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Xe={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function De(e){return Xe[e]??"\u25CF"}var q=R(E(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let B=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return B?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(v=>(0,q.jsx)(s,{marginLeft:2,children:l(v,`${S}-${v.childId??"p"}-${v.index}`)},`${S}-${v.childId??"p"}-${v.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var K=R(E(),1);function je({label:e,shimmer:t=!1}){return(0,K.jsxs)(s,{marginLeft:6,children:[(0,K.jsx)(te,{}),(0,K.jsx)(o,{children:" "}),t?(0,K.jsx)(oe,{text:e,active:!0}):(0,K.jsx)(o,{color:i.dim,children:e})]})}var Fe=R(z(),1);var me=R(E(),1);function Ye(e,t){let n=[];for(let l of e.split(`
3
3
  `)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function _e({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,Fe.useState)(!0);G(()=>c(v=>!v),500);let B=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=Ye(B,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((v,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:v.length?v:" "},d))})}var H=R(E(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(je,{label:e.label,shimmer:e.shimmer}):null,n?(0,H.jsx)(_e,{text:t??""}):null]})}var r=R(E(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function X(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Ae(e){let t=[];for(let n of e)X(n)||(n.children&&n.children.length>0?t.push({...n,children:Ae(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function D({step:e,indent:t=2}){let n=e.actionType?De(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:B}=ee(),S=B?.columns??80,v=Math.max(20,S-t-21),d=e.objective??"",O=d.length>v?d.slice(0,v-1)+"\u2026":d,P=(e.duration??0)*1e3,T=e.duration!=null?P<1e3?`${Math.round(P)}ms`:`${(P/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:O,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:O}):c?(0,r.jsx)(o,{color:i.dim,children:O}):(0,r.jsx)(o,{color:i.dim,children:O})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:T})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((k,m)=>(0,r.jsx)(D,{step:k,indent:t+2},`child-${m}`))})]})}function Je(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(D,{step:e.step})})}function Me({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:B,describeVisible:S,describeRevealing:v}){let d=(0,L.useRef)(new Set),O=(0,L.useRef)(!1),P=(0,L.useRef)(new Set),T=(0,L.useRef)(!1),k=(0,L.useRef)(new Set),m=(0,L.useRef)(0);(0,L.useEffect)(()=>{e.length===0&&m.current>0&&(d.current.clear(),O.current=!1,P.current.clear(),T.current=!1,k.current.clear()),m.current=e.length},[e.length]);let b=e.flatMap(p=>[p,...p.children??[]]),C=b.some(p=>p.status==="running"),A=b.some(p=>p.status==="failed"),W=b.length===0||b.every(p=>p.status==="pending"),Y=b.filter(p=>p.status==="passed"||p.status==="failed").length,N;W?N="starting":C?N="running":A?N="failed":N="passed";let J=(0,L.useRef)(null),[ce,he]=(0,L.useState)(0);(0,L.useEffect)(()=>{b.length===0||W?(J.current=null,he(0)):C&&J.current==null&&(J.current=Date.now())},[C,W,b.length]),(0,L.useEffect)(()=>{if(!C)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[C]);let ae=(0,L.useRef)(new Set),[,xe]=(0,L.useState)(0),be=(0,L.useRef)(!1);(0,L.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let h of e)(h.status==="passed"||h.status==="failed")&&!ae.current.has(h.index)&&(ae.current.add(h.index),p.push({key:`step_${h.index}`,type:"step",step:{...h,children:h.children?[...h.children]:void 0}}));if(p.length>0){for(let h of p)c(Je(h));xe(h=>h+1)}},[e,t,l,u,c]),(0,L.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!T.current&&l&&l[0]!=null&&(T.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!O.current&&(O.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let h=e.flatMap((x,f)=>{let g=x.children??[];return!P.current.has(f)&&g.length>0&&(P.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!k.current.has(f)&&(k.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&P.current.has(f)&&!k.current.has(f)&&(k.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),g});for(let x of h){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...x,children:void 0}})})));for(let y of x.children??[]){let $=`child-${x.childId??"p"}-${x.index}-${y.childId??"p"}-${y.index}-${y.objective}`;d.current.has($)||(y.status==="passed"||y.status==="failed"||y.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(D,{step:y})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:x})})))}}else for(let h of e){let x=`${h.index}-${h.objective}`,f=!!h.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...h,children:void 0}})})));for(let g of h.children??[]){let y=`child-${h.index}-${g.childId??"p"}-${g.index}-${g.objective}`;d.current.has(y)||(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(y),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(D,{step:g})})))}!f&&!d.current.has(x)&&(h.status==="passed"||h.status==="failed"||h.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...h,children:void 0}})})))}d.current.size>p&&xe(h=>h+1)},[e,c,t,n,l]);let V=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||V.push(p);else if(c&&!u)if(t)for(let p of e){let h=p.children??[],x=[];for(let f of h){let g=`${f.childId??"p"}-${f.index}-${f.objective}`,y=d.current.has(g);if(f.branchObjective){let $=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!y||$.length>0)&&x.push({...f,children:$})}else y||x.push(f)}x.length>0&&V.push({...p,children:x})}else for(let p of e){let h=`${p.index}-${p.objective}`,x=d.current.has(h),f=(p.children??[]).filter(g=>{let y=`child-${p.index}-${g.childId??"p"}-${g.index}-${g.objective}`;return!d.current.has(y)});x?f.length>0&&V.push({...p,children:f}):V.push({...p,children:f})}if(!u){let p=c?V:e,h=le(p),x=ge(h,v);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((g,y)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:y>0?1:0,children:g.children&&g.children.length>0?g.children.map($=>{if(X($))return null;let Q=!!$.branchObjective,ue=`${$.childId??"p"}-${$.index}-${$.objective}`,He=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!He&&(0,r.jsx)(D,{step:{...$,children:void 0}}),($.children??[]).filter(Z=>!X(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:Z})},`f${y}-${$.index}-${Z.childId??"p"}-${Z.index}`))]},`f${y}-host-${$.childId??"p"}-${$.index}`):(0,r.jsx)(D,{step:$},`f${y}-${$.childId??"p"}-${$.index}`)}):g.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},y))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(g,y)=>X(g)?null:(0,r.jsx)(D,{step:g},y)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(g=>!(g.status==="running"&&(!g.children||g.children.length===0))).map(g=>{let y=`${g.index}-${g.objective}`;return c&&d.current.has(y)?(0,r.jsx)(s,{flexDirection:"column",children:(g.children??[]).filter($=>!X($)).map($=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:$})},`${$.childId??"p"}-${$.index}`))},`branch-children-${g.index}`):(0,r.jsx)(D,{step:g},g.index)})]}),(0,r.jsx)(se,{activity:x,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),h=ge(p,v);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>X(x)?null:(0,r.jsx)(D,{step:x},f)}),(0,r.jsx)(se,{activity:h,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ge=le(V),Ke=ge(Ge,v),Re=Ae(V);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(D,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ke,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var U=R(E(),1);function qe({runner:e,runKey:t,onStepCommit:n}){let l=Oe({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,U.jsxs)(U.Fragment,{children:[l&&(0,U.jsx)(Le,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,U.jsx)(Me,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var j=R(E(),1),Qe=64;function Ze(e){return e.split(`
4
4
  `).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function Ne({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:B}){let S=e==="passed",v=S?i.green:i.red,d=S?"\u2713":"\u2717",O=e.toUpperCase(),P=a??(S?l:Math.max(0,l-1)),T=u??(S?0:1),k=T>0?`${l} steps (${P} passed, ${T} failed)`:`${l} steps`,m=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,b=Ze(t);return(0,j.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,j.jsxs)(s,{borderStyle:"round",borderColor:v,flexDirection:"column",paddingX:2,paddingY:1,width:Qe+6,children:[(0,j.jsxs)(s,{flexDirection:"column",children:[(0,j.jsxs)(o,{bold:!0,color:v,children:[d," ",O]}),(0,j.jsxs)(o,{color:i.dim,wrap:"wrap",children:[k," \xB7 ",m,typeof B=="number"&&B>0?` \xB7 ${parseFloat(B.toFixed(4))} credits`:""]})]}),b.length>0&&(0,j.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:b.map((C,A)=>(0,j.jsxs)(s,{marginBottom:A<b.length-1?1:0,children:[(0,j.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,j.jsx)(s,{flexShrink:1,children:(0,j.jsx)(o,{wrap:"wrap",children:C})})]},A))}),c&&!S&&(0,j.jsx)(s,{marginTop:1,children:(0,j.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var F=R(E(),1);function Ve({message:e,code:t,remediation:n,docsUrl:l}){return(0,F.jsx)(Te,{title:"Error",variant:"error",children:(0,F.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,F.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,F.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,F.jsx)(o,{color:i.muted,children:"Code: "}),(0,F.jsx)(o,{color:i.dim,children:t})]}),n&&(0,F.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,F.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,F.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,F.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,F.jsx)(o,{color:i.muted,children:"Docs: "}),(0,F.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var w=R(E(),1),et=1e4;function gn(e){let{exit:t}=ve(),{append:n}=ye(),l=(0,M.useRef)(!1);(0,M.useEffect)(()=>{l.current||(l.current=!0,n((0,w.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,w.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,w.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,w.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,w.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,w.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,w.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,w.jsx)(tt,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,w.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,M.useRef)(null),u=(0,M.useCallback)(async T=>{let k=await e.getNextStep(T);return k?(a.current=k,k.config):(a.current=null,null)},[e]),c=(0,M.useCallback)((T,k)=>{let m=a.current;if(!m)return;let b=m.mode==="replay"?"cyan":"#dc4e08",C=m.modeReason?` (${m.modeReason})`:"",A=m.perStepOverrides?Object.entries(m.perStepOverrides):[];n((0,w.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,w.jsxs)(o,{children:[(0,w.jsxs)(o,{color:i.dim,children:[m.banner.stepLabel," "]}),(0,w.jsxs)(o,{color:b,children:["[",m.mode,"]"]}),(0,w.jsx)(o,{color:i.dim,children:C})]}),(0,w.jsx)(o,{color:i.dim,children:m.banner.objective}),A.length>0&&(0,w.jsxs)(o,{color:i.dim,children:["overrides: ",A.map(([W,Y])=>`${W}=${Y}`).join(", ")]})]}))},[n]),B=(0,M.useRef)(0),S=(0,M.useRef)(!1),v=(0,M.useCallback)((T,k)=>(T.hadError?n((0,w.jsx)(Ve,{message:T.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,w.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,w.jsx)(Ne,{status:T.status,summary:T.runEnd?.summary??"",duration:T.runEnd?.duration??0,steps:T.stepsTotal,stepsPassed:T.stepsPassed,stepsFailed:T.stepsFailed,reason:T.runEnd?.reason,creditsConsumed:T.runEnd?.credits_consumed})})),e.onStepEnd?.(T,k)??!0),[n,e]),d=ke({getNextConfig:u,onStepStart:c,onStepEnd:v,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts,...e.reportVerdictOnComplete?{reportVerdictOnComplete:!0}:{},...e.runVerdict?{runVerdict:e.runVerdict}:{}}),O=250,P=5e3;return Se((T,k)=>{if(k.ctrl&&T==="c"){let m=Date.now(),b=m-B.current;if(b<O)return;if(S.current&&b<P){d.cancel(),e.onCancel?.();let C=e.reportVerdictOnComplete?d.runner.shutdownRunner(we,{timeoutMs:et}):Promise.resolve();e.exitOnComplete!==!1&&C.then(()=>setImmediate(()=>t()))}else S.current=!0,n((0,w.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}));B.current=m}}),(0,w.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,w.jsx)(qe,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function tt({data:e}){return(0,w.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{Me as a,Le as b,Oe as c,de as d,Ne as e,Ve as f,gn as g};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var o=null,c=new Set(["run","testmd run","testrun run"]),m=(t,e,n)=>({testFailed:n??(e===1&&c.has(t.path))}),l=!1,a=null;function s(t){let e=[];for(let n=t;n!==null&&n.parent!==null;n=n.parent)e.unshift(n.name());return e.join(" ")}function g(){return o?.path??null}var i=null;function C(t){i=t}function h(){o&&(o.started=!0)}function b(t){a=t}function p(t,e){if(!o){o={path:t,mode:e,t0:Date.now(),started:!1,ended:!1,ctx:null};try{i?.()}catch{}l||(l=!0,process.once("exit",n=>x(typeof n=="number"?n:Number(process.exitCode??0))))}}function d(t){if(t.ctx)return t.ctx;if(t.started||!a)return null;try{return t.ctx=a(t.path,t.mode),t.ctx}catch{return null}}function f(){let t=o;if(!t||t.ended)return null;let e=!t.ctx,n=d(t);return n&&e&&n.startInterval(),n}function v(t,e={}){try{f()?.error(t,e)}catch{}}async function u(t,e={}){let n=o;if(!n||n.ended)return;n.ended=!0;let r=d(n);if(r)try{await r.end({exit_code:t,duration_ms:Date.now()-n.t0},m(n,t,e.testFailed))}catch{}}async function S(t){return await u(t),process.exit(t)}function x(t){let e=o;if(!e||e.ended)return;e.ended=!0;let n=d(e);if(n)try{n.endSync({exit_code:t},m(e,t))}catch{}}var y=t=>t.mode==="agent"||t.agent===!0?"agent":typeof t.mode=="string"&&t.mode?t.mode:"cli";function k(t,e){a=e,t.hook("preAction",(n,r)=>{p(s(r),y(r.opts()))}),t.hook("postAction",async()=>{await u(Number(process.exitCode??0))})}function w(){o=null,a=null,i=null}export{s as a,g as b,C as c,h as d,b as e,p as f,f as g,v as h,u as i,S as j,x as k,k as l,w as m};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{g as f}from"./chunk-47WQBG5I.js";import{a as l}from"./chunk-KM3YCIDV.js";import{i as u}from"./chunk-X52YIWGG.js";import{a as c}from"./chunk-YNDELIXL.js";import{f as s}from"./chunk-CB344EDO.js";import{c as p}from"./chunk-GBQ4K25P.js";import{b as i}from"./chunk-EBJW6POT.js";async function E(n,o,e,t){let m=async()=>{let r=t.auth??{...await s(i),...t.telemetry?.spawnEnv()??{}};return u(e.sid!==void 0&&n.resume===void 0?{...n,sessionId:e.sid}:n,{store:o.store,pendingReconcilePlan:a=>o.dir===null?null:f(o.dir,a),agent:t.agent,tracePath:c,credentials:i,onIngestRefusal:l,preflightTurn:t.preflightTurn??(()=>p(r)),ask:async()=>[],review:async a=>new Map(a.map(d=>[d.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:e.out,...e.note?{note:e.note}:{},emit:e.emit,progress:e.progress,isTTY:!1,auth:r,...t.telemetry?{telemetry:t.telemetry}:{},...t.probe?{probe:t.probe}:{},...t.matchUnreviewed?{matchUnreviewed:!0}:{},...e.onSummary?{onSummary:e.onSummary}:{}})};if(!e.channel)return m();let{runWithChannel:g}=await import("./run-channel-IIIYXOIW.js");return g({event:r=>e.emit(r)},m)}export{E as a};
2
+ import{g as f}from"./chunk-47WQBG5I.js";import{a as l}from"./chunk-KM3YCIDV.js";import{i as u}from"./chunk-YIBLZIXF.js";import{a as c}from"./chunk-JZ7GFPKZ.js";import{f as s}from"./chunk-CB344EDO.js";import{c as p}from"./chunk-GBQ4K25P.js";import{b as i}from"./chunk-XRJH4UF3.js";async function E(n,o,e,t){let m=async()=>{let r=t.auth??{...await s(i),...t.telemetry?.spawnEnv()??{}};return u(e.sid!==void 0&&n.resume===void 0?{...n,sessionId:e.sid}:n,{store:o.store,pendingReconcilePlan:a=>o.dir===null?null:f(o.dir,a),agent:t.agent,tracePath:c,credentials:i,onIngestRefusal:l,preflightTurn:t.preflightTurn??(()=>p(r)),ask:async()=>[],review:async a=>new Map(a.map(d=>[d.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:e.out,...e.note?{note:e.note}:{},emit:e.emit,progress:e.progress,isTTY:!1,auth:r,...t.telemetry?{telemetry:t.telemetry}:{},...t.probe?{probe:t.probe}:{},...t.matchUnreviewed?{matchUnreviewed:!0}:{},...e.onSummary?{onSummary:e.onSummary}:{}})};if(!e.channel)return m();let{runWithChannel:g}=await import("./run-channel-IIIYXOIW.js");return g({event:r=>e.emit(r)},m)}export{E as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as g}from"./chunk-TZXXJWHA.js";import{a as C}from"./chunk-YCVEI7BT.js";import{d as b,j as x,k as T,n as S}from"./chunk-A7RJQJNT.js";import{a as v}from"./chunk-HCBYKLMW.js";import{a,b as l,i as f}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{z as s}from"./chunk-J4FIESTB.js";import{e as h}from"./chunk-UR6MHSHU.js";var y=h(B(),1);var o=h(v(),1);function k(i,d=g()){let n=S(d);return(i==="all"?n:i==="devices"?n.filter(e=>b(e)):["emulator","simulator"].filter(e=>n.includes(e))).map(e=>({value:e,label:x(e),hint:T(e)}))}function H({mode:i="all",hostSupportsMobile:d=g(),onSelect:n,onCancel:c}){let e=k(i,d),[m,u]=(0,y.useState)(0);return f((p,t)=>{if(t.escape&&c){c();return}t.upArrow&&u(r=>Math.max(0,r-1)),t.downArrow&&u(r=>Math.min(e.length-1,r+1)),t.return&&n(e[m].value)}),(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:s.orange,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:s.orange,bold:!0,children:i==="all"?"Where should tests run?":"Which kind of device?"}),(0,o.jsx)(a,{marginTop:1,flexDirection:"column",children:e.map((p,t)=>{let r=t===m;return(0,o.jsxs)(a,{children:[(0,o.jsxs)(l,{color:r?s.orange:void 0,children:[r?"\u276F ":" ",p.label]}),(0,o.jsxs)(l,{color:s.dim,children:[" ",p.hint]})]},p.value)})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:s.dim,children:"You can change this any time with /desktop or /mobile."})}),(0,o.jsx)(C,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],suppressEscBack:!c,escBackLabel:"skip"})]})}export{H as a};
2
+ import{b as g}from"./chunk-TZXXJWHA.js";import{a as C}from"./chunk-NIBNVPAE.js";import{a as v}from"./chunk-HCBYKLMW.js";import{A as s}from"./chunk-BRWCWZE3.js";import{a,b as l,i as f}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{d as b,j as x,k as T,n as S}from"./chunk-A7RJQJNT.js";import{e as h}from"./chunk-UR6MHSHU.js";var y=h(B(),1);var o=h(v(),1);function k(i,d=g()){let n=S(d);return(i==="all"?n:i==="devices"?n.filter(e=>b(e)):["emulator","simulator"].filter(e=>n.includes(e))).map(e=>({value:e,label:x(e),hint:T(e)}))}function H({mode:i="all",hostSupportsMobile:d=g(),onSelect:n,onCancel:c}){let e=k(i,d),[m,u]=(0,y.useState)(0);return f((p,t)=>{if(t.escape&&c){c();return}t.upArrow&&u(r=>Math.max(0,r-1)),t.downArrow&&u(r=>Math.min(e.length-1,r+1)),t.return&&n(e[m].value)}),(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:s.orange,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:s.orange,bold:!0,children:i==="all"?"Where should tests run?":"Which kind of device?"}),(0,o.jsx)(a,{marginTop:1,flexDirection:"column",children:e.map((p,t)=>{let r=t===m;return(0,o.jsxs)(a,{children:[(0,o.jsxs)(l,{color:r?s.orange:void 0,children:[r?"\u276F ":" ",p.label]}),(0,o.jsxs)(l,{color:s.dim,children:[" ",p.hint]})]},p.value)})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:s.dim,children:"You can change this any time with /desktop or /mobile."})}),(0,o.jsx)(C,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],suppressEscBack:!c,escBackLabel:"skip"})]})}export{H as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as u,b as x}from"./chunk-ND6OP3O2.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as r,b as m}from"./chunk-33DWJV67.js";import{z as i}from"./chunk-J4FIESTB.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(m,{color:i.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
2
+ import{a as u,b as x}from"./chunk-V3IWCGZT.js";import{a as f}from"./chunk-HCBYKLMW.js";import{A as i}from"./chunk-BRWCWZE3.js";import{a as r,b as m}from"./chunk-33DWJV67.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(m,{color:i.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as E}from"./chunk-LRNUGKYH.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-L3BUPFAQ.js";import{Fa as f,ka as c}from"./chunk-WE7HRAGO.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
2
+ import{b as E}from"./chunk-77BZTEHJ.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-3CFAE36M.js";import{Fa as f,ka as c}from"./chunk-RHQLDNZL.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
3
3
  ${m}`);case"PAGE_NOT_FOUND":return a(`${s} couldn't be found, so nothing was added`,"check that the address is right and the page still exists, then run the command again");case"PAGE_BLOCKED":return a(`${s} refused automated access, so nothing was added`,`use a version of the page anyone can open, or save it as a file and add the file:
4
4
  ${m}`);case"PAGE_PAYWALLED":return a(`${s} is behind a paywall or a sign-in, so nothing was added`,`use a copy anyone can open, or save it as a file and add the file:
5
5
  ${m}`);case"NOT_A_PAGE":return a(`${$(n)} isn't a web page, so nothing was added`,`download the document, then add the file:
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{M as r,vb as e}from"./chunk-PI7OXS62.js";function p(t,o){return{store:o,dir:t,graph:()=>e(t)}}function a(t){return{store:t,dir:null,graph:()=>r(t)}}export{p as a,a as b};
2
+ import{M as r,vb as e}from"./chunk-5EAJO372.js";function p(t,o){return{store:o,dir:t,graph:()=>e(t)}}function a(t){return{store:t,dir:null,graph:()=>r(t)}}export{p as a,a as b};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-NPAUSUNM.js";import{mkdirSync as Be,writeFileSync as Ae}from"fs";import{join as X}from"path";var ve="start LT with --env ht-stage|ht-prod --tunnelName <name>; see kane-cli explore run --help";function me(t){if(/either tunnel is not running or disconnected/i.test(t))return`remote browser: no running LT tunnel found for this run (HPS: either tunnel is not running or disconnected)
2
+ import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-MBNSCXVK.js";import{mkdirSync as Be,writeFileSync as Ae}from"fs";import{join as X}from"path";var ve="start LT with --env ht-stage|ht-prod --tunnelName <name>; see kane-cli explore run --help";function me(t){if(/either tunnel is not running or disconnected/i.test(t))return`remote browser: no running LT tunnel found for this run (HPS: either tunnel is not running or disconnected)
3
3
  next: ${ve}`;let e=/WebSocket error: \S*\/kane-cli\S* (5\d\d)\b/.exec(t)?.[1];if(e){let r=Ee(t);return`remote browser: HPS answered HTTP ${e} to the connect${r?` (HPS: ${r})`:""} (on a tunnel run: the tunnel service failed); run again, and report it to the platform team if it persists`}return null}function Ee(t){let e=t.split(`
4
4
  `).slice(1).find(i=>i.trim()&&!/^Call log:/.test(i.trim())&&!/^\s*-\s*</.test(i));if(!e)return null;let r=e.trim();try{let i=JSON.parse(r),s=i?.value?.message??i?.message;typeof s=="string"&&s.trim()&&(r=s.trim())}catch{}return r=r.replace(/\b(?:wss?|https?):\/\/\S+/g,"<url>"),r.length>300?r.slice(0,300)+"\u2026":r}var Se={baseMs:500,maxMs:3e4},W=class{o;backoff;sleep;nextSeq;draining=null;stopDeadline=null;wake=null;_state="open";_refusal=null;_fatal=null;_committedThisRun=0;constructor(e){this.o=e,this.backoff=e.backoff??Se,this.sleep=e.sleep??(r=>new Promise(i=>setTimeout(i,r))),this.nextSeq=Math.max(e.firstSeq,e.queue.lastParked+1)}get state(){return this._state}get refusal(){return this._refusal}get fatal(){return this._fatal}get pendingCount(){return this.o.queue.pendingCount}get committedThisRun(){return this._committedThisRun}get lastCommitted(){return this.o.queue.lastCommitted}enqueue(e){return e.run_id!==this.o.runId?{ok:!1,code:"RUN_MISMATCH",reason:`delta ${e.seq} names run ${e.run_id}, this run is ${this.o.runId}`}:!Number.isInteger(e.seq)||e.seq!==this.nextSeq?{ok:!1,code:"SEQUENCE_LOCAL",reason:`expected seq ${this.nextSeq} for run ${this.o.runId}, received ${String(e.seq)}`}:(this.o.queue.append(e),this.nextSeq=e.seq+1,this.kick(),{ok:!0})}kick(){this._state==="open"&&(this.draining||(this.draining=this.drainLoop().catch(e=>(this.markFatal(this.o.queue.pending()[0]?.seq??-1,"LOCAL_IO",e instanceof Error?e.message:String(e)),"stopped")).then(e=>{this.draining=null,e==="empty"&&this._state==="open"&&this.o.queue.pendingCount>0&&this.kick()})))}async flush(e){if(this.stopDeadline=Date.now()+e,this.kick(),this.wake){let r=this.wake;this.wake=null,r()}for(;this.draining;)await this.draining;return this.o.queue.pendingCount}async drainLoop(){let e=0;for(;this._state==="open";){let r=this.o.queue.pending()[0];if(!r)return"empty";let i=this.o.queue.refused(r.seq);if(i)return this.refuse(r.seq,i.code,`previously refused: ${i.reason}`,!1),"stopped";let s=await this.o.client.commitDelta(this.o.explorationId,this.o.runId,r);switch(s.kind){case"committed":e=0,this.o.queue.markCommitted(r.seq),this._committedThisRun++,this.o.onAck?.(r.seq);break;case"refused":return this.refuse(r.seq,s.code,s.reason,!0),"stopped";case"fatal":return this.markFatal(r.seq,s.code,s.reason),"stopped";case"transient":{e++;let a=Math.min(this.backoff.maxMs,this.backoff.baseMs*2**(e-1));if(this.stopDeadline!==null&&Date.now()+a>this.stopDeadline)return"deadline";this.o.onRetry?.(r.seq,e,s.reason,a),await this.interruptibleSleep(a);break}}}return"stopped"}markFatal(e,r,i){this._state="fatal",this._fatal={seq:e,code:r,reason:i},this.o.onFatal?.(e,r,i)}refuse(e,r,i,s){s&&this.o.queue.markRefused(e,r,i,{controller_wire:this.o.controllerWire,client_wire:ue}),this._state="refused",this._refusal={seq:e,code:r,reason:i},this.o.onRefused?.(e,r,i)}async interruptibleSleep(e){await Promise.race([this.sleep(e),new Promise(r=>{this.wake=r})]),this.wake=null}};import{appendFileSync as Ce,closeSync as $e,existsSync as Pe,fsyncSync as Te,mkdirSync as Ie,openSync as De,readFileSync as Me}from"fs";import{dirname as Oe,join as Le}from"path";var Fe="pending-deltas.ndjson",Q=class{path;deltas=new Map;committed=new Set;refusedBySeq=new Map;tornTail=!1;constructor(e){this.path=Le(e,Fe),this.load()}append(e){let r=this.deltas.get(e.seq);if(r){if(JSON.stringify(r)===JSON.stringify(e))return;throw new Error(`pending queue already holds a different delta for seq ${e.seq}`)}this.write({op:"delta",seq:e.seq,delta:e}),this.deltas.set(e.seq,e)}markCommitted(e){this.committed.has(e)||(this.write({op:"committed",seq:e}),this.committed.add(e))}markRefused(e,r,i,s={}){let a={...s.controller_wire?{controller_wire:s.controller_wire}:{},...s.client_wire?{client_wire:s.client_wire}:{}};this.write({op:"refused",seq:e,code:r,reason:i,...a}),this.refusedBySeq.set(e,{seq:e,code:r,reason:i,...a})}pending(){return[...this.deltas.entries()].filter(([e])=>!this.committed.has(e)).sort(([e],[r])=>e-r).map(([,e])=>e)}get pendingCount(){return this.pending().length}get lastCommitted(){let e=0;for(let r of this.committed)e=Math.max(e,r);return e}get lastParked(){let e=0;for(let r of this.deltas.keys())e=Math.max(e,r);return e}refused(e){return this.refusedBySeq.get(e)}load(){if(!Pe(this.path))return;let e=Me(this.path,"utf8");this.tornTail=e.length>0&&!e.endsWith(`
5
5
  `);let r=e.split(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-HCBYKLMW.js";import{a as m,b as r,i as d}from"./chunk-33DWJV67.js";import{a as u}from"./chunk-6YGTRKDT.js";import{z as o}from"./chunk-J4FIESTB.js";import{e as s}from"./chunk-UR6MHSHU.js";var l=s(u(),1);var e=s(a(),1);function T({message:t,confirmLabel:c,choice:n}){return(0,e.jsxs)(m,{flexDirection:"column",borderStyle:"round",borderColor:o.dim,paddingX:1,children:[(0,e.jsx)(r,{bold:!0,children:t}),(0,e.jsxs)(m,{marginTop:1,children:[(0,e.jsx)(r,{color:n==="yes"?o.red:o.dim,children:`\u276F ${c}`}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:n==="no"?o.green:o.dim,children:"\u276F No"})]}),(0,e.jsx)(r,{color:o.dim,children:"\u2190 \u2192 choose \xB7 \u21B5 confirm \xB7 esc cancel"})]})}function y({message:t,onConfirm:c,onCancel:n,confirmLabel:p="Yes, end"}){let[f,g]=(0,l.useState)("no");return d((b,i)=>{(i.leftArrow||i.rightArrow)&&g(x=>x==="yes"?"no":"yes"),i.return&&(f==="yes"?c:n)(),i.escape&&n()}),(0,e.jsx)(T,{message:t,confirmLabel:p,choice:f})}export{y as a};
2
+ import{a}from"./chunk-HCBYKLMW.js";import{A as o}from"./chunk-BRWCWZE3.js";import{a as m,b as r,i as d}from"./chunk-33DWJV67.js";import{a as u}from"./chunk-6YGTRKDT.js";import{e as s}from"./chunk-UR6MHSHU.js";var l=s(u(),1);var e=s(a(),1);function T({message:t,confirmLabel:c,choice:n}){return(0,e.jsxs)(m,{flexDirection:"column",borderStyle:"round",borderColor:o.dim,paddingX:1,children:[(0,e.jsx)(r,{bold:!0,children:t}),(0,e.jsxs)(m,{marginTop:1,children:[(0,e.jsx)(r,{color:n==="yes"?o.red:o.dim,children:`\u276F ${c}`}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:n==="no"?o.green:o.dim,children:"\u276F No"})]}),(0,e.jsx)(r,{color:o.dim,children:"\u2190 \u2192 choose \xB7 \u21B5 confirm \xB7 esc cancel"})]})}function y({message:t,onConfirm:c,onCancel:n,confirmLabel:p="Yes, end"}){let[f,g]=(0,l.useState)("no");return d((b,i)=>{(i.leftArrow||i.rightArrow)&&g(x=>x==="yes"?"no":"yes"),i.return&&(f==="yes"?c:n)(),i.escape&&n()}),(0,e.jsx)(T,{message:t,confirmLabel:p,choice:f})}export{y as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as k,b as y}from"./chunk-U2VYTVKV.js";import{b as N,d as h,e as S,f as w}from"./chunk-32MFECUA.js";import{b as f,c as p,f as m}from"./chunk-EHB55V23.js";import{a as b}from"./chunk-B7ZX5HEN.js";import{existsSync as R,readFileSync as T}from"fs";var x=`kane-cli couldn't tell if this is a secret, so it's marked as one; set "secret": false if it isn't`;function O(e){let t=k(e.cwd),i=p(f(e.cwd)),n=j(t),o=[],c=new Set,u=[];for(let r of e.tests){let s=q(r);if(s===null)continue;let l=new Set;s.forEach((d,v)=>{let P=d===null?[]:N(d).filter(a=>!l.has(a));if(v===0&&d!==null)for(let a of h(d))c.add(a);for(let a of P)o.includes(a)||o.push(a);if(d!==null)for(let a of w(d))l.add(a)}),S({surfaceRequired:r.surfaceRequired===!0,firstStep:s[0],...r.target!==void 0?{target:r.target}:{}})&&u.push({test:r.test,title:r.title,...r.file?{file:r.file}:{}})}let g=o.filter(r=>i.get(r)?.has_value!==!0),_=[...g.filter(r=>c.has(r)),...g.filter(r=>!c.has(r))];return{file:t,variables:_.map(r=>{let s=E(n[r]),l=s!==void 0&&typeof s.secret=="boolean";return{name:r,...l?{secret:s.secret}:{secret:!0},...l?s.description!==void 0?{description:s.description}:{}:{description:s?.description?`${s.description}; ${x}`:x},...c.has(r)?{start_page:!0}:{}}}),noStartPage:u}}function J(e){let t=[];for(let i of e.ids){let n=e.graph.resolve(i),o=n?e.graph.getNode(n.tip):null;o?.label==="test"&&t.push(V(i,o.content))}return O({tests:t,cwd:e.cwd})}function V(e,t,i){let{title:n,test_md_blob:o,target:c}=t,u=t.check;return{test:e,title:typeof n=="string"?n:e,blob:typeof o=="string"?o:"",...i?{file:i}:{},...t.surface_required===!0||u?.surface_required===!0?{surfaceRequired:!0}:{},...typeof c=="string"?{target:c}:{}}}function D(e,t){let i=e.variables.filter(n=>m(n.name)===null);i.length!==0&&y({file:e.file,declarations:i.map(n=>({name:n.name,description:n.description??"",secret:n.secret===!0})),known:p(f(t))})}function q(e){try{return b(`${e.test}_test.md`,e.blob).steps.map(t=>t.body.kind==="objective"?t.body.text:null)}catch{return null}}function I(e){return e instanceof SyntaxError?"a variables file here isn't valid JSON":e instanceof Error?e.message:String(e)}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function j(e){if(!R(e))return{};try{let t=JSON.parse(T(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}export{O as a,J as b,V as c,D as d,I as e};
2
+ import{a as k,b as y}from"./chunk-U2VYTVKV.js";import{b as N,d as h,e as S,f as w}from"./chunk-32MFECUA.js";import{b as f,c as p,f as m}from"./chunk-EHB55V23.js";import{a as b}from"./chunk-XDAFRUAJ.js";import{existsSync as R,readFileSync as T}from"fs";var x=`kane-cli couldn't tell if this is a secret, so it's marked as one; set "secret": false if it isn't`;function O(e){let t=k(e.cwd),i=p(f(e.cwd)),n=j(t),o=[],c=new Set,u=[];for(let r of e.tests){let s=q(r);if(s===null)continue;let l=new Set;s.forEach((d,v)=>{let P=d===null?[]:N(d).filter(a=>!l.has(a));if(v===0&&d!==null)for(let a of h(d))c.add(a);for(let a of P)o.includes(a)||o.push(a);if(d!==null)for(let a of w(d))l.add(a)}),S({surfaceRequired:r.surfaceRequired===!0,firstStep:s[0],...r.target!==void 0?{target:r.target}:{}})&&u.push({test:r.test,title:r.title,...r.file?{file:r.file}:{}})}let g=o.filter(r=>i.get(r)?.has_value!==!0),_=[...g.filter(r=>c.has(r)),...g.filter(r=>!c.has(r))];return{file:t,variables:_.map(r=>{let s=E(n[r]),l=s!==void 0&&typeof s.secret=="boolean";return{name:r,...l?{secret:s.secret}:{secret:!0},...l?s.description!==void 0?{description:s.description}:{}:{description:s?.description?`${s.description}; ${x}`:x},...c.has(r)?{start_page:!0}:{}}}),noStartPage:u}}function J(e){let t=[];for(let i of e.ids){let n=e.graph.resolve(i),o=n?e.graph.getNode(n.tip):null;o?.label==="test"&&t.push(V(i,o.content))}return O({tests:t,cwd:e.cwd})}function V(e,t,i){let{title:n,test_md_blob:o,target:c}=t,u=t.check;return{test:e,title:typeof n=="string"?n:e,blob:typeof o=="string"?o:"",...i?{file:i}:{},...t.surface_required===!0||u?.surface_required===!0?{surfaceRequired:!0}:{},...typeof c=="string"?{target:c}:{}}}function D(e,t){let i=e.variables.filter(n=>m(n.name)===null);i.length!==0&&y({file:e.file,declarations:i.map(n=>({name:n.name,description:n.description??"",secret:n.secret===!0})),known:p(f(t))})}function q(e){try{return b(`${e.test}_test.md`,e.blob).steps.map(t=>t.body.kind==="objective"?t.body.text:null)}catch{return null}}function I(e){return e instanceof SyntaxError?"a variables file here isn't valid JSON":e instanceof Error?e.message:String(e)}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function j(e){if(!R(e))return{};try{let t=JSON.parse(T(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}export{O as a,J as b,V as c,D as d,I as e};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{a as m}from"./chunk-RQKMSNEU.js";import{d,f as c}from"./chunk-7YV2FCN4.js";import{Ia as a}from"./chunk-PI7OXS62.js";import{resolve as l}from"path";async function g(s,w,t={}){let r=c({verb:s,mode:"cli",contextRoot:l(process.cwd(),".context"),env:d(),write:t.write,sessionId:m()}),n=()=>{o(t.mode??"")!=="ndjson"&&process.stderr.write(r.supportFooter()+`
2
+ import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{Ia as a}from"./chunk-5EAJO372.js";import{e as d,h as c}from"./chunk-BZEW7CSM.js";import{a as m}from"./chunk-WTMCDYR3.js";import{resolve as l}from"path";async function g(s,w,t={}){let r=c({verb:s,mode:"cli",contextRoot:l(process.cwd(),".context"),env:d(),write:t.write,sessionId:m()}),n=()=>{o(t.mode??"")!=="ndjson"&&process.stderr.write(r.supportFooter()+`
3
3
  `)};try{let e=await w(r);return t.write&&e===0&&await r.lateBindContext(l(process.cwd(),".context")),e===1&&n(),await r.end({exit_code:e}),e}catch(e){if(e instanceof a){if(o(t.mode??"")==="ndjson"){let i=p("ndjson",t.streamVerb??s,{stdout:y=>process.stdout.write(y),stderr:()=>{}});i.event({type:"sync_error",code:e.code,detail:e.message,remedy:e.remedy}),i.done(2,"refused")}else process.stderr.write(`error: ${e.message}
4
4
  next: ${e.remedy}
5
5
  `);return r.error("rebase_open"),await r.end({exit_code:2}),2}throw r.error("cli_crash"),n(),await r.end({exit_code:1}),e}}export{g as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{H as T,L as F,Qa as B,r as x}from"./chunk-PI7OXS62.js";function q(h){let{store:j,graph:f,seq:r,by:i}=h,c=j.recordsSince(null),v=c.map(B);if(!Number.isInteger(r)||r<1||r>c.length)return{record:null,warnings:[],errors:[{code:"UNKNOWN_SEQ",detail:`no record ${r} (chain has ${c.length})`}]};let d=c[r-1],p=c.slice(0,r-1),a=h.reason??`revert of record ${r}`,n=[],l=[],g=[],m=[],w={},C=new Set(d.nodes.map(e=>e.cid)),k=new Map;for(let e of c)for(let t of e.edges)k.has(t.ecid)||k.set(t.ecid,t);let N=e=>c.slice(r).some(t=>t.supersessions.some(s=>s.kind==="edge"&&s.ecid===e)),$=new Set,y=new Set;for(let e of d.nodes){if(f.superseded.has(e.cid)){$.add(e.cid),n.push(`${e.cid} was already superseded after record ${r} \u2014 left as is`);continue}y.add(e.cid),l.push({kind:"node",old:e.cid,new:null,reason:a,by:i})}let _=new Set;for(let e of d.edges){if(f.superseded.has(e.ecid)){n.push(`edge ${e.ecid} was already retracted after record ${r} \u2014 left as is`);continue}if(($.has(e.src)||$.has(e.dst))&&!y.has(e.src)&&!y.has(e.dst)){n.push(`edge ${e.ecid} was minted with a kept node \u2014 left as is`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let R=new Set;for(let e of d.supersessions){if(e.kind!=="node")continue;if(c.slice(r).some(s=>s.supersessions.some(o=>o.kind==="node"&&o.old===e.old))){n.push(`supersession of ${e.old.slice(0,19)} was changed again after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.supersessions)o.kind==="node"&&o.old===e.old&&(t=o.new===o.old?void 0:o.new);t===void 0?(l.push({kind:"node",old:e.old,new:e.old,reason:a,by:i}),R.add(e.old)):l.push({kind:"node",old:e.old,new:t,reason:a,by:i})}for(let e of d.supersessions)if(!(e.kind!=="edge"||!e.revoke)){if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let E=[];for(let e of d.supersessions){if(e.kind!=="edge"||e.revoke)continue;if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}let t=!1;for(let H of p)for(let b of H.supersessions)b.kind==="edge"&&b.ecid===e.ecid&&(t=!b.revoke);if(t){n.push(`edge ${e.ecid} was already retracted before record ${r} \u2014 left retracted`);continue}let s=k.get(e.ecid);if(!s){n.push(`edge ${e.ecid} is unknown to the chain \u2014 left retracted`);continue}if(f.superseded.has(s.src)&&!R.has(s.src)){n.push(`edge ${e.ecid} would revive from a superseded source \u2014 left retracted`);continue}let o=f.tipOf(s.dst);if(f.superseded.has(o)&&!R.has(o)){n.push(`edge ${e.ecid} would point at a retired destination \u2014 left retracted`);continue}let u=T(f,{type:s.type,src:s.src,dst:s.dst},{pending:E,retracted:_},`revert revive ${s.type}`);if(u){n.push(`edge ${e.ecid} left retracted \u2014 reviving it would double an occupied slot (${u.detail})`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i,revoke:!0}),E.push({src:s.src,dst:s.dst,type:s.type})}let S=c.slice(r);for(let e of Object.keys(d.source_head_moves)){if(S.some(s=>e in s.source_head_moves)){n.push(`head of ${e} was moved again after record ${r} \u2014 later state kept`);continue}let t=null;for(let s of p)e in s.source_head_moves&&(t=s.source_head_moves[e]);w[e]=t}let O=new Set;for(let e of d.review){if(O.has(e.id)||C.has(e.id))continue;if(O.add(e.id),S.some(o=>o.review.some(u=>u.id===e.id))){n.push(`trust of ${e.id.slice(0,19)} was reviewed again after record ${r} \u2014 later state kept`);continue}let t=null,s=null;for(let o of p)for(let u of o.review)u.id===e.id&&(t=u.resolution==="reset"?null:u.resolution,s=u.reason);t==="approved"||t==="edited"?g.push({id:e.id,kind:"review-item",resolution:"approved",edit:null,reason:a,by:i}):t==="rejected"?g.push({id:e.id,kind:"review-item",resolution:"rejected",edit:null,reason:s??a,by:i}):g.push({id:e.id,kind:"review-item",resolution:"reset",edit:null,reason:a,by:i})}for(let e of d.names??[]){if(S.some(s=>(s.names??[]).some(o=>o.slug===e.slug))){n.push(`slug "${e.slug}" was reassigned after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.names??[])o.slug===e.slug&&(t=o.cid);t!==void 0?m.push({cid:t,slug:e.slug,by:i}):n.push(`slug "${e.slug}" was first assigned by record ${r} \u2014 unassignment unsupported, reassign manually`)}return l.length===0&&g.length===0&&m.length===0&&Object.keys(w).length===0?{record:null,warnings:n,errors:[{code:"NOTHING_TO_REVERT",detail:`record ${r} left no compensable facts`}]}:(d.extraction_of&&n.push(`extraction cache for ${d.extraction_of.slice(0,19)} stays \u2014 re-extract with --force`),{record:F(j,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:g,supersessions:l,...m.length>0?{names:m}:{},source_head_moves:w},{graph:f,expectPrev:v[v.length-1]??null,intent:{v:1,verb:"revert",args:x({seq:r,reason:h.reason??null,by:i}),pins:{target:{seq:r,hash:v[r-1]}}},provenance:h.provenance}).record,warnings:n,errors:null})}export{q as a};
2
+ import{H as T,L as F,Qa as B,r as x}from"./chunk-5EAJO372.js";function q(h){let{store:j,graph:f,seq:r,by:i}=h,c=j.recordsSince(null),v=c.map(B);if(!Number.isInteger(r)||r<1||r>c.length)return{record:null,warnings:[],errors:[{code:"UNKNOWN_SEQ",detail:`no record ${r} (chain has ${c.length})`}]};let d=c[r-1],p=c.slice(0,r-1),a=h.reason??`revert of record ${r}`,n=[],l=[],g=[],m=[],w={},C=new Set(d.nodes.map(e=>e.cid)),k=new Map;for(let e of c)for(let t of e.edges)k.has(t.ecid)||k.set(t.ecid,t);let N=e=>c.slice(r).some(t=>t.supersessions.some(s=>s.kind==="edge"&&s.ecid===e)),$=new Set,y=new Set;for(let e of d.nodes){if(f.superseded.has(e.cid)){$.add(e.cid),n.push(`${e.cid} was already superseded after record ${r} \u2014 left as is`);continue}y.add(e.cid),l.push({kind:"node",old:e.cid,new:null,reason:a,by:i})}let _=new Set;for(let e of d.edges){if(f.superseded.has(e.ecid)){n.push(`edge ${e.ecid} was already retracted after record ${r} \u2014 left as is`);continue}if(($.has(e.src)||$.has(e.dst))&&!y.has(e.src)&&!y.has(e.dst)){n.push(`edge ${e.ecid} was minted with a kept node \u2014 left as is`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let R=new Set;for(let e of d.supersessions){if(e.kind!=="node")continue;if(c.slice(r).some(s=>s.supersessions.some(o=>o.kind==="node"&&o.old===e.old))){n.push(`supersession of ${e.old.slice(0,19)} was changed again after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.supersessions)o.kind==="node"&&o.old===e.old&&(t=o.new===o.old?void 0:o.new);t===void 0?(l.push({kind:"node",old:e.old,new:e.old,reason:a,by:i}),R.add(e.old)):l.push({kind:"node",old:e.old,new:t,reason:a,by:i})}for(let e of d.supersessions)if(!(e.kind!=="edge"||!e.revoke)){if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let E=[];for(let e of d.supersessions){if(e.kind!=="edge"||e.revoke)continue;if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}let t=!1;for(let H of p)for(let b of H.supersessions)b.kind==="edge"&&b.ecid===e.ecid&&(t=!b.revoke);if(t){n.push(`edge ${e.ecid} was already retracted before record ${r} \u2014 left retracted`);continue}let s=k.get(e.ecid);if(!s){n.push(`edge ${e.ecid} is unknown to the chain \u2014 left retracted`);continue}if(f.superseded.has(s.src)&&!R.has(s.src)){n.push(`edge ${e.ecid} would revive from a superseded source \u2014 left retracted`);continue}let o=f.tipOf(s.dst);if(f.superseded.has(o)&&!R.has(o)){n.push(`edge ${e.ecid} would point at a retired destination \u2014 left retracted`);continue}let u=T(f,{type:s.type,src:s.src,dst:s.dst},{pending:E,retracted:_},`revert revive ${s.type}`);if(u){n.push(`edge ${e.ecid} left retracted \u2014 reviving it would double an occupied slot (${u.detail})`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i,revoke:!0}),E.push({src:s.src,dst:s.dst,type:s.type})}let S=c.slice(r);for(let e of Object.keys(d.source_head_moves)){if(S.some(s=>e in s.source_head_moves)){n.push(`head of ${e} was moved again after record ${r} \u2014 later state kept`);continue}let t=null;for(let s of p)e in s.source_head_moves&&(t=s.source_head_moves[e]);w[e]=t}let O=new Set;for(let e of d.review){if(O.has(e.id)||C.has(e.id))continue;if(O.add(e.id),S.some(o=>o.review.some(u=>u.id===e.id))){n.push(`trust of ${e.id.slice(0,19)} was reviewed again after record ${r} \u2014 later state kept`);continue}let t=null,s=null;for(let o of p)for(let u of o.review)u.id===e.id&&(t=u.resolution==="reset"?null:u.resolution,s=u.reason);t==="approved"||t==="edited"?g.push({id:e.id,kind:"review-item",resolution:"approved",edit:null,reason:a,by:i}):t==="rejected"?g.push({id:e.id,kind:"review-item",resolution:"rejected",edit:null,reason:s??a,by:i}):g.push({id:e.id,kind:"review-item",resolution:"reset",edit:null,reason:a,by:i})}for(let e of d.names??[]){if(S.some(s=>(s.names??[]).some(o=>o.slug===e.slug))){n.push(`slug "${e.slug}" was reassigned after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.names??[])o.slug===e.slug&&(t=o.cid);t!==void 0?m.push({cid:t,slug:e.slug,by:i}):n.push(`slug "${e.slug}" was first assigned by record ${r} \u2014 unassignment unsupported, reassign manually`)}return l.length===0&&g.length===0&&m.length===0&&Object.keys(w).length===0?{record:null,warnings:n,errors:[{code:"NOTHING_TO_REVERT",detail:`record ${r} left no compensable facts`}]}:(d.extraction_of&&n.push(`extraction cache for ${d.extraction_of.slice(0,19)} stays \u2014 re-extract with --force`),{record:F(j,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:g,supersessions:l,...m.length>0?{names:m}:{},source_head_moves:w},{graph:f,expectPrev:v[v.length-1]??null,intent:{v:1,verb:"revert",args:x({seq:r,reason:h.reason??null,by:i}),pins:{target:{seq:r,hash:v[r-1]}}},provenance:h.provenance}).record,warnings:n,errors:null})}export{q as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as c,b as l,c as _}from"./chunk-VZ7KXRXB.js";import{a as y}from"./chunk-ZCBOHWN3.js";import{a as v}from"./chunk-RZ4F3BHX.js";import{a as i,p as f}from"./chunk-J4FIESTB.js";import{createHash as x}from"crypto";import{promises as o,readFileSync as A,writeFileSync as S,renameSync as N,mkdirSync as F}from"fs";import{dirname as T,join as u}from"path";var w=`# kane-cli metric catalog, version 1.
2
+ import{a as c,b as l,c as _}from"./chunk-VZ7KXRXB.js";import{a as y}from"./chunk-V24LUINK.js";import{a as i,q as f}from"./chunk-BRWCWZE3.js";import{a as v}from"./chunk-RZ4F3BHX.js";import{createHash as x}from"crypto";import{promises as o,readFileSync as A,writeFileSync as S,renameSync as N,mkdirSync as F}from"fs";import{dirname as T,join as u}from"path";var w=`# kane-cli metric catalog, version 1.
3
3
  #
4
4
  # Policies reference these as metrics.<name>. \`where\` and \`value\` expressions
5
5
  # are CEL over \`test\` (one tests/*/result.yaml, parsed), \`file\` and \`run\`