@testmuai/kane-cli 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/{ChatSurface-FIYDTZSI.js → ChatSurface-Z26BOE5U.js} +1 -1
  2. package/dist/{ChromeProfilePicker-Q6FIGVYU.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-2NV2G65E.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
  4. package/dist/{CliUploadProgress-JZ5FXODE.js → CliUploadProgress-XFRRFRL4.js} +1 -1
  5. package/dist/{ConfigView-TZ4YINOE.js → ConfigView-6JF4DOJN.js} +1 -1
  6. package/dist/{EvidenceViewOffer-LKPN5BHX.js → EvidenceViewOffer-6344EX74.js} +1 -1
  7. package/dist/FolderPicker-4PCYHE75.js +2 -0
  8. package/dist/InfoBox-NJ2DL7YC.js +2 -0
  9. package/dist/{LinksBox-32TZOANP.js → LinksBox-HNDNFVUT.js} +1 -1
  10. package/dist/{ProfilesView-UC4MPM54.js → ProfilesView-DEJKJOHY.js} +1 -1
  11. package/dist/ProjectPicker-DTWMWOH7.js +2 -0
  12. package/dist/SaveSessionPrompt-3GCLB3ZT.js +2 -0
  13. package/dist/SingleShotApp-HMOXO5DW.js +2 -0
  14. package/dist/{SummaryBox-XGFO5X76.js → SummaryBox-7PPDMSSM.js} +1 -1
  15. package/dist/TestMdRunView-QLKRUU4V.js +2 -0
  16. package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
  17. package/dist/{WhoamiView-4XIJXMTU.js → WhoamiView-H7JNLLCY.js} +1 -1
  18. package/dist/{app-download-XEDO3EMV.js → app-download-GKRF2EIM.js} +1 -1
  19. package/dist/{assurance-job-MD65GQLC.js → assurance-job-F4L3T4VJ.js} +1 -1
  20. package/dist/{binary-NVYLR36K.js → binary-K3XMILST.js} +1 -1
  21. package/dist/{bind-H3ALI2NG.js → bind-SSHAZAB3.js} +1 -1
  22. package/dist/{bootstrap-JEVSVPQ2.js → bootstrap-XGKU4WXB.js} +1 -1
  23. package/dist/{catalog-5UYBWA4W.js → catalog-YCU6OHNV.js} +1 -1
  24. package/dist/{catalog-client-VVKV4JKW.js → catalog-client-MVEEHTG2.js} +1 -1
  25. package/dist/{changelog-FPWJXERY.js → changelog-5UB3AQT6.js} +1 -1
  26. package/dist/{chunk-GJ7MO2FW.js → chunk-2JFRN62I.js} +2 -2
  27. package/dist/chunk-2RBMQTYS.js +26 -0
  28. package/dist/{chunk-44SIFDNY.js → chunk-2TK4MDF2.js} +1 -1
  29. package/dist/{chunk-P4VFC6HO.js → chunk-35WUYKGO.js} +1 -1
  30. package/dist/{chunk-XCUF5AVM.js → chunk-3MD2XLE7.js} +2 -2
  31. package/dist/{chunk-TMH4TPMB.js → chunk-3NWUXRSI.js} +1 -1
  32. package/dist/{chunk-NVD2MXHQ.js → chunk-3RO2YGKH.js} +1 -1
  33. package/dist/{chunk-QUNIY6NN.js → chunk-3ZC7GSMM.js} +1 -1
  34. package/dist/{chunk-LXCTV75T.js → chunk-4CJQ7XZP.js} +1 -1
  35. package/dist/{chunk-LWCP4GLY.js → chunk-4KL3TSTT.js} +5 -5
  36. package/dist/{chunk-2ULYGALF.js → chunk-4UX5N7YI.js} +1 -1
  37. package/dist/{chunk-5KJU4MG4.js → chunk-5YYCCM6K.js} +1 -1
  38. package/dist/{chunk-IT5JVCZN.js → chunk-6FFX4S7N.js} +1 -1
  39. package/dist/{chunk-HM6LZ2KM.js → chunk-6HRNG4CK.js} +1 -1
  40. package/dist/{chunk-OK6NLITG.js → chunk-6QCCTZO3.js} +1 -1
  41. package/dist/{chunk-ZZZGTDYE.js → chunk-6QH75BPJ.js} +1 -1
  42. package/dist/{chunk-6SWHEBPR.js → chunk-7RELCXRW.js} +1 -1
  43. package/dist/{chunk-S7XCOBYD.js → chunk-7SU53QGU.js} +1 -1
  44. package/dist/{chunk-6JUS2ULI.js → chunk-7Y55CO42.js} +1 -1
  45. package/dist/{chunk-B57ZRHEQ.js → chunk-7YV2FCN4.js} +1 -1
  46. package/dist/{chunk-PC22QRIY.js → chunk-A2DODRHG.js} +1 -1
  47. package/dist/{chunk-ABMM37L2.js → chunk-AHT2ORJT.js} +1 -1
  48. package/dist/{chunk-A7IMHUFY.js → chunk-AT7AT3AR.js} +2 -2
  49. package/dist/{chunk-5WLXAQ4H.js → chunk-AVLYSNEG.js} +1 -1
  50. package/dist/{chunk-ZO3ZAMUU.js → chunk-BBJAKSA7.js} +1 -1
  51. package/dist/{chunk-DLP5S3TO.js → chunk-BJO6J5X2.js} +1 -1
  52. package/dist/{chunk-EEOAU43D.js → chunk-BLVDV3QQ.js} +1 -1
  53. package/dist/{chunk-I52NWH4U.js → chunk-C4KAPGBS.js} +1 -1
  54. package/dist/{chunk-7O2FIZB7.js → chunk-CB2BWDHG.js} +2 -2
  55. package/dist/{chunk-HWPWCCEV.js → chunk-CNHKZE4F.js} +1 -1
  56. package/dist/{chunk-5F44KH3R.js → chunk-CTHUX7O4.js} +1 -1
  57. package/dist/{chunk-FYPIF3BE.js → chunk-DC5F2ADJ.js} +1 -1
  58. package/dist/chunk-DIOK3SER.js +34 -0
  59. package/dist/{chunk-NCP54AIQ.js → chunk-DQXQJJOP.js} +2 -2
  60. package/dist/{chunk-W2HRX3DR.js → chunk-EBJW6POT.js} +1 -1
  61. package/dist/{chunk-GZQAETB2.js → chunk-EJGCIGQY.js} +1 -1
  62. package/dist/{chunk-7ZR5CQY3.js → chunk-ERRIDBE7.js} +1 -1
  63. package/dist/chunk-F2F257PU.js +6 -0
  64. package/dist/{chunk-EAWU2TOG.js → chunk-GQAWZEA4.js} +1 -1
  65. package/dist/{chunk-2QKBXRLI.js → chunk-GXQYFOBD.js} +1 -1
  66. package/dist/{chunk-RRKYHUOD.js → chunk-HBLHKQR7.js} +1 -1
  67. package/dist/chunk-HC6VLPUB.js +5 -0
  68. package/dist/{chunk-JUVY6PHY.js → chunk-HRIDAK6Y.js} +1 -1
  69. package/dist/{chunk-5MFPQYW3.js → chunk-HV2CDY4K.js} +1 -1
  70. package/dist/{chunk-YO6SNXBJ.js → chunk-IEHJG6J4.js} +1 -1
  71. package/dist/{chunk-FAMQ4DHU.js → chunk-J4FIESTB.js} +1 -1
  72. package/dist/{chunk-UICJ2KLJ.js → chunk-JBKHX5ES.js} +1 -1
  73. package/dist/{chunk-6CS23F3E.js → chunk-KBGMQYMD.js} +1 -1
  74. package/dist/{chunk-ZDQYGLCZ.js → chunk-KCXLRR3Q.js} +1 -1
  75. package/dist/{chunk-KN7GZWKK.js → chunk-KL7XFNSD.js} +1 -1
  76. package/dist/{chunk-V3OZJO7Y.js → chunk-KQ4XKTIZ.js} +1 -1
  77. package/dist/{chunk-PR5EGLEI.js → chunk-LHJSIHLC.js} +1 -1
  78. package/dist/{chunk-75FF7J5R.js → chunk-LPJKNX6D.js} +1 -1
  79. package/dist/{chunk-3V4J65GN.js → chunk-LRNUGKYH.js} +1 -1
  80. package/dist/{chunk-POA336CU.js → chunk-LUA25RYS.js} +1 -1
  81. package/dist/{chunk-BHQIH2FE.js → chunk-LV7224DG.js} +1 -1
  82. package/dist/{chunk-73HMW2WA.js → chunk-LXK4B2FE.js} +1 -1
  83. package/dist/{chunk-PWNYTIVA.js → chunk-M2E5CPPV.js} +1 -1
  84. package/dist/{chunk-OVNTCBNS.js → chunk-M7A66MSK.js} +1 -1
  85. package/dist/{chunk-MP6NCJFE.js → chunk-MD3RABID.js} +1 -1
  86. package/dist/{chunk-AUSLHNXQ.js → chunk-MEBEVHGP.js} +1 -1
  87. package/dist/{chunk-C6P6YUCR.js → chunk-N7IWR45S.js} +1 -1
  88. package/dist/{chunk-M3TFOFUQ.js → chunk-ND6OP3O2.js} +1 -1
  89. package/dist/{chunk-226AGYHB.js → chunk-NHGPMYM3.js} +1 -1
  90. package/dist/{chunk-VE4HLIGA.js → chunk-NI3TIAD7.js} +1 -1
  91. package/dist/{chunk-GQARXS6F.js → chunk-NPAUSUNM.js} +1 -1
  92. package/dist/{chunk-HX5OLRKU.js → chunk-NRAPCFI2.js} +2 -2
  93. package/dist/{chunk-RAVAJZV2.js → chunk-NZJSGINB.js} +16 -16
  94. package/dist/{chunk-X3A4QPA3.js → chunk-OBNVGD5H.js} +1 -1
  95. package/dist/{chunk-Q5AKIQIE.js → chunk-OCMPWCKQ.js} +1 -1
  96. package/dist/{chunk-BJT6PZXL.js → chunk-OCVDMZWB.js} +1 -1
  97. package/dist/{chunk-XZ6J3Y2W.js → chunk-OHGL4GEJ.js} +1 -1
  98. package/dist/{chunk-54NJJVG5.js → chunk-OOGKX4Y6.js} +1 -1
  99. package/dist/{chunk-UMNCM4RJ.js → chunk-OTMHCHH6.js} +2 -2
  100. package/dist/{chunk-45NM23EQ.js → chunk-OZNYQONA.js} +1 -1
  101. package/dist/{chunk-D4QXYAYA.js → chunk-PB6RXDWQ.js} +2 -2
  102. package/dist/{chunk-2GEAKFAV.js → chunk-PCQK62MP.js} +1 -1
  103. package/dist/{chunk-HHOVANJ7.js → chunk-PTLOOVV4.js} +1 -1
  104. package/dist/{chunk-QB77LRF4.js → chunk-Q4ALB7SH.js} +1 -1
  105. package/dist/{chunk-A474TUCE.js → chunk-Q4SMITTV.js} +1 -1
  106. package/dist/{chunk-HNF3PWF3.js → chunk-QE4AWNOV.js} +3 -3
  107. package/dist/{chunk-6YBH3WUW.js → chunk-QEM5ZRDN.js} +1 -1
  108. package/dist/{chunk-MSYRAPDK.js → chunk-QHH42RH5.js} +1 -1
  109. package/dist/{chunk-IB5WG5YY.js → chunk-RNHSULQM.js} +1 -1
  110. package/dist/chunk-SB26HQO7.js +2 -0
  111. package/dist/{chunk-QVMXL675.js → chunk-SJQTTEXQ.js} +1 -1
  112. package/dist/{chunk-UCVP7ZY4.js → chunk-SMGRXKXX.js} +1 -1
  113. package/dist/{chunk-RDAIOJCR.js → chunk-SXBPUUQ5.js} +1 -1
  114. package/dist/{chunk-K75WIRI5.js → chunk-TM45NPWL.js} +1 -1
  115. package/dist/{chunk-7DLDADQR.js → chunk-TUSG7DIL.js} +1 -1
  116. package/dist/{chunk-K4K2BGQC.js → chunk-UJ37XGSP.js} +3 -3
  117. package/dist/{chunk-DXLZCJH5.js → chunk-ULIIYKZB.js} +1 -1
  118. package/dist/{chunk-7PCLHURF.js → chunk-UXGMKRS4.js} +61 -60
  119. package/dist/{chunk-IH73ZCBB.js → chunk-VCVEZEVS.js} +1 -1
  120. package/dist/{chunk-XNXJXGVB.js → chunk-VKVYT6KZ.js} +2 -2
  121. package/dist/{chunk-PEUIHME2.js → chunk-VO2NNXKR.js} +1 -1
  122. package/dist/{chunk-H4TIVILC.js → chunk-WE7HRAGO.js} +1 -1
  123. package/dist/{chunk-O5KTMDTH.js → chunk-WIVKLNIO.js} +1 -1
  124. package/dist/chunk-WLEWXE6L.js +2 -0
  125. package/dist/{chunk-3YIA3DSL.js → chunk-X2MDL6S4.js} +1 -1
  126. package/dist/{chunk-M7Y5GGVJ.js → chunk-X45RZIAJ.js} +1 -1
  127. package/dist/{chunk-4LGQHTXM.js → chunk-XKOVEMVZ.js} +1 -1
  128. package/dist/{chunk-4HARMERK.js → chunk-Y2HQMJGS.js} +1 -1
  129. package/dist/{chunk-B226SFOV.js → chunk-Y3RJHWNK.js} +1 -1
  130. package/dist/{chunk-4HYPMGDF.js → chunk-YCVEI7BT.js} +1 -1
  131. package/dist/{chunk-HG2ILWCE.js → chunk-YILRYMMG.js} +1 -1
  132. package/dist/{chunk-2COXO5LQ.js → chunk-YNDELIXL.js} +1 -1
  133. package/dist/{chunk-4NEPHIAO.js → chunk-YPGZ5E4I.js} +1 -1
  134. package/dist/{chunk-GT3JDX5H.js → chunk-YQZ736IQ.js} +1 -1
  135. package/dist/{chunk-XHFU5TGS.js → chunk-YVVFXBT5.js} +1 -1
  136. package/dist/{chunk-ET5EK2CM.js → chunk-YWWVF5OU.js} +1 -1
  137. package/dist/{chunk-OKA6FPJM.js → chunk-Z47ZEFH7.js} +1 -1
  138. package/dist/{chunk-FI2DVNRT.js → chunk-ZCBOHWN3.js} +1 -1
  139. package/dist/{chunk-7XJNYLQW.js → chunk-ZIHQ5JGB.js} +4 -4
  140. package/dist/{chunk-Z6SI7YNV.js → chunk-ZMIKNNO6.js} +1 -1
  141. package/dist/{chunk-O3TXAMFW.js → chunk-ZPU3WAC4.js} +1 -1
  142. package/dist/{commands-R5AYK6XM.js → commands-JBFLLT7A.js} +1 -1
  143. package/dist/{config-YMHI3H3Y.js → config-7WTZPMAH.js} +1 -1
  144. package/dist/{cover-cmd-DVQIGFDY.js → cover-cmd-DU6ZYJFL.js} +1 -1
  145. package/dist/{credentials-BCR73VGS.js → credentials-5WIFF5DG.js} +1 -1
  146. package/dist/{deps-bundle-6WLX44OA.js → deps-bundle-BLLJ2BQ4.js} +1 -1
  147. package/dist/{deps-resolve-DSAKPZ3T.js → deps-resolve-WQ6J6RLI.js} +1 -1
  148. package/dist/{design-chat-YUI2JPO6.js → design-chat-ZICGVYIH.js} +1 -1
  149. package/dist/{design-headless-KIP6R7UV.js → design-headless-HYWZIIDS.js} +1 -1
  150. package/dist/{design-remote-XMSHDDUX.js → design-remote-HPX4VZ63.js} +2 -2
  151. package/dist/device-env-4P4GUVBW.js +2 -0
  152. package/dist/{doctor-PGTNOMSP.js → doctor-Z2YQ2DBX.js} +1 -1
  153. package/dist/{evidence-RO3RDZXO.js → evidence-BJIID6VT.js} +1 -1
  154. package/dist/{evolve-cmd-U2ALVGMT.js → evolve-cmd-GZCUSCEK.js} +1 -1
  155. package/dist/{evolve-remote-K2MCCVMM.js → evolve-remote-LILOAHYH.js} +1 -1
  156. package/dist/{explain-cmd-UWK5YVXG.js → explain-cmd-LXIVHGN7.js} +1 -1
  157. package/dist/explore-SA2P3SGX.js +2 -0
  158. package/dist/{explore-context-tty-WJHUSP3A.js → explore-context-tty-PERKIWXD.js} +1 -1
  159. package/dist/{explore-entry-3EX2T3NS.js → explore-entry-E6EY3VV3.js} +4 -4
  160. package/dist/{explore-live-TRY5A2ME.js → explore-live-XIWWUV52.js} +1 -1
  161. package/dist/{explore-run-tty-ZV5XFKZA.js → explore-run-tty-M56I23IF.js} +2 -2
  162. package/dist/{extract-bind-TXUBMK3T.js → extract-bind-LZ22VFKB.js} +3 -3
  163. package/dist/{extract-chat-VPYDGQKO.js → extract-chat-Z64LEAJ5.js} +1 -1
  164. package/dist/{extract-cmd-YUOYMVF5.js → extract-cmd-46E2XDWZ.js} +2 -2
  165. package/dist/{extract-headless-UWTAPOET.js → extract-headless-XLS56LMN.js} +1 -1
  166. package/dist/{folder-flags-WV7UV3JG.js → folder-flags-ZIDJVDKX.js} +1 -1
  167. package/dist/{gaps-cmd-PFV3FZCM.js → gaps-cmd-XYOBJVTO.js} +1 -1
  168. package/dist/{gate-7ALXLCNB.js → gate-AK44VDHC.js} +1 -1
  169. package/dist/{generate-headless-KMBBZTLS.js → generate-headless-HXAVEAEZ.js} +2 -2
  170. package/dist/{impact-cmd-PW33L5RF.js → impact-cmd-TJTUFAFO.js} +2 -2
  171. package/dist/index.js +162 -157
  172. package/dist/{ingest-cmd-MXYILQLV.js → ingest-cmd-OJSKTSQK.js} +3 -3
  173. package/dist/{ingest-remote-2EEJP6ML.js → ingest-remote-2WM6PYUW.js} +1 -1
  174. package/dist/install-JBWBF3WX.js +2 -0
  175. package/dist/{interactive-bind-FDWJUTI6.js → interactive-bind-SOD7VTAY.js} +2 -2
  176. package/dist/{interactive-remote-O2Q2FNOH.js → interactive-remote-7ZSTI66T.js} +1 -1
  177. package/dist/{lattice-auth-TXNDLHM6.js → lattice-auth-UQPFQSG7.js} +1 -1
  178. package/dist/{lifecycle-cmd-GFHDBRXX.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
  179. package/dist/{list-cmd-RR75PMPE.js → list-cmd-HQIN3HX4.js} +1 -1
  180. package/dist/{list-commands-3QGZWJ5P.js → list-commands-OFRRBU3D.js} +1 -1
  181. package/dist/{list-remote-AA3VSWOI.js → list-remote-EFCET42K.js} +1 -1
  182. package/dist/login-flow-SYKXXDLH.js +2 -0
  183. package/dist/{maintenance-cmd-OHGVARQ2.js → maintenance-cmd-X5247RSJ.js} +1 -1
  184. package/dist/{mobile-prompts-FZRKLLTN.js → mobile-prompts-I66ENBDW.js} +1 -1
  185. package/dist/{onboarding-NXGMV3VG.js → onboarding-6HIP3KW6.js} +1 -1
  186. package/dist/{persist-recorded-session-INFN4JZT.js → persist-recorded-session-RSSMTVF3.js} +1 -1
  187. package/dist/pipeline-NTJDH5TC.js +2 -0
  188. package/dist/{policy-commands-3YJ6YCDN.js → policy-commands-4PUGESCW.js} +1 -1
  189. package/dist/{prepare-target-DII5WZCX.js → prepare-target-AI3GGZF6.js} +1 -1
  190. package/dist/{pull-cmd-XZN53XFZ.js → pull-cmd-NRVB5ZN7.js} +1 -1
  191. package/dist/{pull-route-R33BVADE.js → pull-route-FWCZW76M.js} +1 -1
  192. package/dist/real-device-run-NQ7RNH7C.js +2 -0
  193. package/dist/{reconcile-cmd-KFPRCCJB.js → reconcile-cmd-7B7THAFJ.js} +4 -4
  194. package/dist/{reconcile-remote-6WISFGRG.js → reconcile-remote-3W6ZTO3G.js} +2 -2
  195. package/dist/{recording-banner-XOX2CDCF.js → recording-banner-WVDTWTSE.js} +1 -1
  196. package/dist/registry-PFOSXOIH.js +2 -0
  197. package/dist/remote-entry-BZU4NFNS.js +2 -0
  198. package/dist/{remote-mode-4HN27MD4.js → remote-mode-NXUKDUXG.js} +1 -1
  199. package/dist/{remote-words-LFDYKIZ7.js → remote-words-JRDDNOZ6.js} +1 -1
  200. package/dist/{require-project-folder-ZK4JJCDB.js → require-project-folder-3DTI2CVB.js} +1 -1
  201. package/dist/{resolve-run-intent-LYLVNNDZ.js → resolve-run-intent-QCL7QXIB.js} +1 -1
  202. package/dist/{resolver-RMHGGYRP.js → resolver-CDF7QKVD.js} +1 -1
  203. package/dist/{review-cmd-UGF2FC5Y.js → review-cmd-XBK3TGRE.js} +1 -1
  204. package/dist/{run-remote-BGKQDAOA.js → run-remote-SFR3F2T5.js} +1 -1
  205. package/dist/{run-startup-gate-4XE73OON.js → run-startup-gate-QSFJRYUY.js} +1 -1
  206. package/dist/run-test-md-ZSREINDQ.js +20 -0
  207. package/dist/session-worker.js +2 -2
  208. package/dist/{sessions-cmd-CABAX7BO.js → sessions-cmd-TLUITRG5.js} +1 -1
  209. package/dist/{sessions-remote-Y4FTZL7Y.js → sessions-remote-INO7AWKB.js} +1 -1
  210. package/dist/{skill-installer-FS2AV7GX.js → skill-installer-7JH5QCJF.js} +1 -1
  211. package/dist/{store-PLKJZTGC.js → store-X4UK4AP7.js} +1 -1
  212. package/dist/{store-choice-UAB6Z4AL.js → store-choice-27HDIFTU.js} +1 -1
  213. package/dist/{store-guard-DUN2X3SR.js → store-guard-ZXKB5DQH.js} +1 -1
  214. package/dist/{sync-cmd-AGTOGPYM.js → sync-cmd-2PCO7LZA.js} +1 -1
  215. package/dist/{sync-setup-4KIY3PDO.js → sync-setup-5WQO73Y5.js} +1 -1
  216. package/dist/tcg-generate-DGJD5KSM.js +2 -0
  217. package/dist/{testmd-actions-UD6PAWUX.js → testmd-actions-XE2JPQHB.js} +1 -1
  218. package/dist/{testmd-sync-EEJ7GPLR.js → testmd-sync-LYHEXWCT.js} +1 -1
  219. package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
  220. package/dist/token-refresh-E4FTJVHY.js +2 -0
  221. package/dist/{validate-basic-3JZRZL45.js → validate-basic-66XDPA3S.js} +1 -1
  222. package/dist/{version-check-IY3YSQIP.js → version-check-SHNVYTMU.js} +1 -1
  223. package/dist/{view-cmd-WUIGTRFX.js → view-cmd-QOB3O6YW.js} +1 -1
  224. package/dist/{walk-session-EH7227WR.js → walk-session-WIEROYOT.js} +1 -1
  225. package/dist/{with-telemetry-7JMZUBUZ.js → with-telemetry-T2PWI5CY.js} +1 -1
  226. package/package.json +11 -11
  227. package/dist/FolderPicker-H5K74PCH.js +0 -2
  228. package/dist/InfoBox-DNSOAK5L.js +0 -2
  229. package/dist/ProjectPicker-ZJ5RW6XL.js +0 -2
  230. package/dist/SaveSessionPrompt-F327WC7A.js +0 -2
  231. package/dist/SingleShotApp-OMLRYOSI.js +0 -2
  232. package/dist/TestMdRunView-ZZ77QTAQ.js +0 -2
  233. package/dist/TestrunEvidenceTable-G7MPF55X.js +0 -2
  234. package/dist/chunk-6K5BEEAJ.js +0 -2
  235. package/dist/chunk-6LEHGRRG.js +0 -34
  236. package/dist/chunk-A4ZV2SHL.js +0 -5
  237. package/dist/chunk-O2Y46A3G.js +0 -26
  238. package/dist/chunk-Y6Y6RAY4.js +0 -2
  239. package/dist/device-env-K7J5NN66.js +0 -2
  240. package/dist/explore-S2BGQUIF.js +0 -2
  241. package/dist/install-7J34AYB6.js +0 -2
  242. package/dist/login-flow-ZQ6UFTS2.js +0 -2
  243. package/dist/pipeline-MVZRI6YZ.js +0 -2
  244. package/dist/real-device-run-DGENHGUV.js +0 -2
  245. package/dist/registry-NV3EMDMK.js +0 -2
  246. package/dist/remote-entry-BCTFT643.js +0 -2
  247. package/dist/run-test-md-G6U3RU2Q.js +0 -19
  248. package/dist/tcg-generate-CUY4AZ2V.js +0 -2
  249. package/dist/token-refresh-K6PVBBFE.js +0 -2
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-FAMQ4DHU.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(o,{color:t.orange,children:e?i[p]:"\u25CF"})}export{b as a};
2
+ import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-J4FIESTB.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(o,{color:t.orange,children:e?i[p]:"\u25CF"})}export{b as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as K}from"./chunk-UICJ2KLJ.js";import{b as U}from"./chunk-TAY7J5VS.js";import{b as W}from"./chunk-3V4J65GN.js";import{a as S}from"./chunk-LZPYIFHZ.js";import{$,Aa as v,I as C,K as _,L as b,N as E,O as P,Q as p,U as h,Y as f,Z as F,a as j,aa as O,ba as N,ca as A,da as M,ka as y,ma as D,pa as c,qa as I,sa as L,wa as T}from"./chunk-H4TIVILC.js";import{oa as R}from"./chunk-PI7OXS62.js";import{a as g}from"./chunk-FOJHSG5M.js";var G={history:"project",search:"project_ready",session:"project_ready"},B={useCases:"use_cases",criteria:"acceptance_criteria",scenarios:"scenarios",tests:"tests",openQuestions:"open_questions",sources:"sources",styleNotes:"style_notes"},V=(e,t)=>t===null||t<=0?null:Math.min(100,Math.floor(e*100/t)),Y=e=>e.startsWith("design-")||e.startsWith("evolve-")?"design":"extract",q=e=>({cmd:`kane-cli context sessions save ${e} --yes --mode agent`,why:"save it to the project"});function de(e,t=Date.now(),s={}){switch(e.kind){case"connect":return e.step==="service"?{type:"remote_connect",step:"connect"}:{type:"remote_connect",step:"open_session",...e.sid!==void 0?{sid:e.sid}:{},...e.project!==void 0?{project:e.project}:{}};case"load":return{type:"remote_load",part:G[e.part],percent:V(e.done,e.total)};case"write":return null;case"retry":return{type:"remote_retry",attempt:e.attempt,next_in_s:e.nextInS,give_up_in_s:Math.max(0,Math.round((Date.parse(e.giveUpAt)-t)/1e3)),cause:e.cause};case"upload":return{type:"remote_upload",file:e.file,percent:V(e.sentBytes,e.totalBytes)};case"reading":return null;case"fetching":return{type:"remote_fetch",ref:e.ref,provider:e.provider};case"paused":{if(e.reason==="ctrl_c")return null;let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"session_paused",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},...s.mode?{mode:s.mode}:{},reason:e.reason,resume:n,expires_at:null,pending_questions:[],...(e.reason==="connection_lost"||e.reason==="not_accepted")&&n!==null?{next:[{cmd:n,why:"resume"}]}:{}}}case"save":{let n=a=>Object.fromEntries(Object.entries(a).flatMap(([l,d])=>l in B&&typeof d=="number"?[[B[l],d]]:[])),r=e.counts?n(e.counts):void 0,o=e.heldChanges??(e.counts?F(e.counts):0),i=Object.fromEntries(f.flatMap(a=>{let l=e[a]??e.counts?.[a],d=l?n(l):{};return Object.values(d).some(x=>x>0)?[[a,d]]:[]}));return{type:"session_save",phase:e.phase,sid:e.sid,...e.project!==void 0?{project:e.project}:{},...r!==void 0?{adds:r}:{},...e.notUpdated!==void 0&&e.notUpdated.length>0?{not_updated:e.notUpdated}:{},...i,...o>0?{held_changes:o}:{},...e.replaces?{replaces:n(e.replaces)}:{},...e.keeps?{marks_up_to_date:{tests:e.keeps}}:{},...(e.uncounted??e.counts?.uncounted??0)>0?{other_work:!0}:{},...e.landed!==void 0?{saved:e.landed}:{},...(()=>{let a=L(e.testManager,e.sid,e.sessionUseCases?new Set(e.sessionUseCases):void 0,I(e.testFiles));return a?{test_manager:a}:{}})(),...e.testFiles!==void 0?{test_files:T(e.testFiles,e.sid,{testManager:e.testManager})}:{},...e.reason!==void 0?{reason:e.reason}:{},...e.code!==void 0?{code:e.code}:{},...e.stillStale?{next:[{cmd:"kane-cli maintain evolve --from-stale --mode agent",why:"update the use-cases still out of date"}]}:{}}}case"overlap":return{type:"remote_overlap",sessions:e.sessions.map(n=>({sid:n.sid,owner:n.owner,state:n.state,added:n.added,...n.owner!=="someone_else"&&n.state==="paused"?{next:[{cmd:c(n.verb==="design"||n.verb==="evolve"?"design":"extract",n.sid,!0),why:"goes on with that session where it stopped"}]}:{}}))};case"ended":return{type:"session_ended",sid:e.sid,reason:e.reason};case"not_ended":{let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"error",code:"SESSION_NOT_ENDED",message:`${v(e.project)} didn't take this session's last step; the work is safe in the session`,...n!==null?{next:[{cmd:n,why:"ends the session, so it can be saved"}]}:{}}}case"finished_before":return{type:"session_complete",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},next:[q(e.sid)]}}}function ce(e,t,s={}){return{type:"session_complete",sid:e,...s.sourceId?{source_id:s.sourceId}:{},...s.noStartPage?.length?{no_start_page:s.noStartPage}:{},...t?{next:[q(e),{cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away what this session added"}]}:{}}}var J=e=>e.notUpdated?[`not updated: ${e.notUpdated}`]:[],k={connection_lost:"lost connection",computer_slept:"this computer slept for over 2 minutes",resumed_elsewhere:"resumed in another terminal",not_accepted:"something couldn't be added to this session",ctrl_c:"ctrl+c",model_unavailable:"the model service did not answer",unexpected:"stopped unexpectedly"},w=e=>e.added===0?[]:[e.verb==="extract"?`${e.added} use-case${e.added===1?"":"s"} added, not saved yet`:`${e.added} added, not saved yet`],u=e=>e.credits?[e.credits]:[],m=e=>e.tracePath?{tracePath:e.tracePath}:{};function pe(e){let t=c(e.verb,e.sid,!1),s=e.reason==="resumed_elsewhere"?["this session goes on in the other terminal; your work is safe",...w(e),"to bring it back here, resume it (the other terminal then stops)",...u(e)]:["your work is safe \u2014 resume it from any machine",...w(e),...u(e)];return{state:"paused",reason:k[e.reason],facts:s,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function he(e,t){if(e)return{kind:"ingest",refs:e};let s=[...new Set((t?.uploads??[]).filter(r=>r.outcome==="created"&&!r.filename).map(r=>r.sourceId))],n=t?D(t):[];return n.length+s.length>0?{kind:"resumed",files:n,unnamed:s}:{kind:"extract"}}var H=e=>`discard: kane-cli context sessions discard ${e}`;function fe(e){let t=e.again,s=t.kind==="extract"?[H(e.sid),"then start again: kane-cli context extract"]:["start again with the same sources:",...t.kind==="ingest"?[` ${y(t.refs)}`]:t.files.length>0?[` ${y(t.files)}`]:[],...t.kind==="resumed"?t.unnamed.map(n=>` ${g.dim(`${t.files.length>0?"and ":""}the source "${n}", added again by its address`)}`):[],H(e.sid)];return{state:"paused",reason:e.reason==="held_back"?"the duplicate check couldn't run fully":k[e.reason],facts:[`this session read ${e.sources} sources, so it can't be resumed or saved`,...e.added>0?[`its ${e.added} use-case${e.added===1?"":"s"} won't reach the project`]:[],...s,...u(e)],...m(e)}}function ye(e,t){let s={cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away this session"};if(t.kind==="extract")return{next:[s,{cmd:"kane-cli context extract --mode agent",why:"start again"}]};let n=t.kind==="ingest"?t.refs:t.files;return{next:[...n.length>0?[{cmd:`${y(n)} --mode agent`,why:"start again"}]:[],s],...t.kind==="resumed"&&t.unnamed.length>0?{not_named:[...t.unnamed]}:{}}}var ve=e=>e.filter(t=>t.kind==="header"&&t.source!==void 0).length;function xe(e){let t=c(e.verb,e.sid,!1);return{state:"paused",reason:"the duplicate check couldn't run fully",facts:[e.added>0?"what was added is safe \u2014 resume it from any machine":"nothing was added yet \u2014 resume it from any machine",...w(e),`${e.held} use-case${e.held===1?"":"s"} held back, not added`,...u(e)],resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}var X=e=>e.verb==="evolve"&&e.replaces?`designing its ${e.replaces===1?"test":`${e.replaces} tests`} again didn't finish`:"designing its tests didn't finish";function Se(e){let t=c("extract",e.sid,!1),s=a=>a===1?"1 change":`${a} changes`,n=[...(e.replaced?.scenarios??0)>0?[e.replaced.scenarios===1?"1 scenario":`${e.replaced.scenarios} scenarios`]:[],...(e.replaced?.tests??0)>0?[e.replaced.tests===1?"1 test":`${e.replaced.tests} tests`]:[]],r=n.length>0?`, ${n.join(" and ")} replaced`:"",o=[e.decided>0?"what you decided is safe \u2014 resume it from any machine":"nothing was decided yet \u2014 resume it from any machine",...e.approved>0?[`${s(e.approved)} approved${r}, not saved yet`]:[],...e.unfinished?[X(e.unfinished)]:[],...e.left>0?[`${s(e.left)} not reviewed yet`]:[],...u(e)];return{state:"paused",reason:e.unfinished||e.left===0?k[e.why??"ctrl_c"]:`${s(e.left)} from ${W(e.source)} ${e.left===1?"isn't":"aren't"} reviewed yet`,facts:o,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function _e(e){let[t,...s]=e.how==="saved"?["saved from another terminal",`saved to "${e.projectName}" from another terminal`]:e.how==="discarded"?["discarded from another terminal",`discarded from another terminal \u2014 nothing was saved to "${e.projectName}"`]:["ended in another terminal","this session ended in another terminal, so it stops here","to see your sessions, run: kane-cli context sessions"];return{state:"complete",reason:t,facts:[...s,...u(e)],...m(e)}}function Q(e){let t=[e.adds,e.heldChanges?A(e.heldChanges):""].filter(Boolean);return t.length>0?C(t):$({...e,adds:e.adds})?h:p}function be(e,t){let n=`${e===h||e===p||e.startsWith("1 ")&&!e.includes(", ")&&!e.includes(" and ")?"it's":"they're"} thrown away`;return t===void 0?`${n}, and this can't be undone`:`${n}; nothing reaches "${t}", and this can't be undone`}function $e(e){let{heldChanges:t,chatTurns:s,uncounted:n}=e;return{heldChanges:t,chatTurns:s,uncounted:n,...Object.fromEntries(f.map(r=>[r,e[r]])),...e.replaces?{replaces:e.replaces}:{},...e.keeps?{keeps:e.keeps}:{}}}function we(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${e.changed??Q(e)}`,...e.changed?[]:b(e),...J(e),...e.needed??[],"kept as it is until you save or discard it",`save: kane-cli context sessions save ${e.sid}`,`discard: kane-cli context sessions discard ${e.sid}`,...u(e)],...m(e)}}function ke(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${Q(e)}`,...b(e),`${v(e.projectName)} didn't take this session's last step; your work is safe`,`save: ${c(e.verb,e.sid,!1)}`,...u(e)],...m(e)}}var z=(e,t)=>e||($({...t,adds:e})?h:O({...t,adds:e})?p:"");function Re(e){let t=z(e.adds,e);return{state:"complete",reason:"saved",facts:[`saved to "${e.projectName}"${t?`: ${t}`:""}`,..._(e),...e.heldChanges?[M(e.heldChanges)]:[],...J(e),...e.testManager?[e.testManager]:[],...e.testManagerNextRun?[e.testManagerNextRun]:[],...e.testFiles?[e.testFiles]:[],...e.testFilesKept?[e.testFilesKept]:[],...e.testFilesReplaced?[e.testFilesReplaced]:[],...e.testFilesNeeded??[],...u(e)],...m(e)}}var je=e=>_(e);function Ce(e,t,s={}){let n=z(t,s);return`\u2714 saved to "${e}"${n?` \u2014 ${n}`:""}`}function Ee(e,t){return e?.facts.find(s=>s.startsWith("credits used:"))??(t?`credits used: ${t.total.toFixed(1)}`:null)}var Z=4;function ee(e,t){let s=e.map(r=>({sid:r.sessionId,verb:r.verb,subject:r.useCase??r.sourceId,title:(r.useCase?r.useCaseTitle:r.sourceTitle)??null,state:j(r),added:null,last_activity_at:r.lastActivityAt??r.createdAt,owner:K(r,t)})),n=r=>Date.parse(r.last_activity_at??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||n(o)-n(r))}var te={reconcile:"review"},se={ready_to_save:"ready to save",paused:"paused",running:"running",saved:"saved",discarded:"discarded",failed:"ended with an error"};function ne(e,t){let s=Date.parse(e??"");if(Number.isNaN(s))return"";let n=Math.floor((t-s)/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let r=new Date(s),o=a=>a.toDateString(),i=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return o(r)===o(new Date(t))?`${Math.floor(n/60)} h ago`:o(r)===o(new Date(t-864e5))?`yesterday ${i}`:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")} ${i}`}function re(e,t){return e.length===0?["no open sessions"]:e.flatMap(s=>{let n=s.title?`"${s.title}"`:s.subject&&R(s.subject),r=[...s.added?[`${s.added} added`]:[],...s.updated?[`${s.updated} updated`]:[]],o=[te[s.verb]??s.verb,...n?[n]:[],se[s.state],...r,ne(s.last_activity_at,t),...s.owner==="someone_else"?["someone else"]:[]],i=`${s.sid} ${o.filter(Boolean).join(" \xB7 ")}`;return s.owner==="someone_else"?[i]:s.state==="ready_to_save"?[i,g.dim(` save: kane-cli context sessions save ${s.sid}`)]:s.state==="paused"?[i,g.dim(` resume: ${c(s.verb==="design"||s.verb==="evolve"?"design":"extract",s.sid,!1)}`)]:[i]})}async function Ie(e){let t=await e.person.listSessions(e.projectId),s=await ae(e.person,e.projectId,ee(t,e.me).filter(n=>n.state!=="saved"&&n.state!=="discarded"),e.log??(()=>{}));return e.out(e.json?JSON.stringify(s)+`
2
+ import{c as K}from"./chunk-JBKHX5ES.js";import{b as U}from"./chunk-TAY7J5VS.js";import{b as W}from"./chunk-LRNUGKYH.js";import{a as S}from"./chunk-LZPYIFHZ.js";import{$,Aa as v,I as C,K as _,L as b,N as E,O as P,Q as p,U as h,Y as f,Z as F,a as j,aa as O,ba as N,ca as A,da as M,ka as y,ma as D,pa as c,qa as I,sa as L,wa as T}from"./chunk-WE7HRAGO.js";import{oa as R}from"./chunk-PI7OXS62.js";import{a as g}from"./chunk-FOJHSG5M.js";var G={history:"project",search:"project_ready",session:"project_ready"},B={useCases:"use_cases",criteria:"acceptance_criteria",scenarios:"scenarios",tests:"tests",openQuestions:"open_questions",sources:"sources",styleNotes:"style_notes"},V=(e,t)=>t===null||t<=0?null:Math.min(100,Math.floor(e*100/t)),Y=e=>e.startsWith("design-")||e.startsWith("evolve-")?"design":"extract",q=e=>({cmd:`kane-cli context sessions save ${e} --yes --mode agent`,why:"save it to the project"});function de(e,t=Date.now(),s={}){switch(e.kind){case"connect":return e.step==="service"?{type:"remote_connect",step:"connect"}:{type:"remote_connect",step:"open_session",...e.sid!==void 0?{sid:e.sid}:{},...e.project!==void 0?{project:e.project}:{}};case"load":return{type:"remote_load",part:G[e.part],percent:V(e.done,e.total)};case"write":return null;case"retry":return{type:"remote_retry",attempt:e.attempt,next_in_s:e.nextInS,give_up_in_s:Math.max(0,Math.round((Date.parse(e.giveUpAt)-t)/1e3)),cause:e.cause};case"upload":return{type:"remote_upload",file:e.file,percent:V(e.sentBytes,e.totalBytes)};case"reading":return null;case"fetching":return{type:"remote_fetch",ref:e.ref,provider:e.provider};case"paused":{if(e.reason==="ctrl_c")return null;let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"session_paused",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},...s.mode?{mode:s.mode}:{},reason:e.reason,resume:n,expires_at:null,pending_questions:[],...(e.reason==="connection_lost"||e.reason==="not_accepted")&&n!==null?{next:[{cmd:n,why:"resume"}]}:{}}}case"save":{let n=a=>Object.fromEntries(Object.entries(a).flatMap(([l,d])=>l in B&&typeof d=="number"?[[B[l],d]]:[])),r=e.counts?n(e.counts):void 0,o=e.heldChanges??(e.counts?F(e.counts):0),i=Object.fromEntries(f.flatMap(a=>{let l=e[a]??e.counts?.[a],d=l?n(l):{};return Object.values(d).some(x=>x>0)?[[a,d]]:[]}));return{type:"session_save",phase:e.phase,sid:e.sid,...e.project!==void 0?{project:e.project}:{},...r!==void 0?{adds:r}:{},...e.notUpdated!==void 0&&e.notUpdated.length>0?{not_updated:e.notUpdated}:{},...i,...o>0?{held_changes:o}:{},...e.replaces?{replaces:n(e.replaces)}:{},...e.keeps?{marks_up_to_date:{tests:e.keeps}}:{},...(e.uncounted??e.counts?.uncounted??0)>0?{other_work:!0}:{},...e.landed!==void 0?{saved:e.landed}:{},...(()=>{let a=L(e.testManager,e.sid,e.sessionUseCases?new Set(e.sessionUseCases):void 0,I(e.testFiles));return a?{test_manager:a}:{}})(),...e.testFiles!==void 0?{test_files:T(e.testFiles,e.sid,{testManager:e.testManager})}:{},...e.reason!==void 0?{reason:e.reason}:{},...e.code!==void 0?{code:e.code}:{},...e.stillStale?{next:[{cmd:"kane-cli maintain evolve --from-stale --mode agent",why:"update the use-cases still out of date"}]}:{}}}case"overlap":return{type:"remote_overlap",sessions:e.sessions.map(n=>({sid:n.sid,owner:n.owner,state:n.state,added:n.added,...n.owner!=="someone_else"&&n.state==="paused"?{next:[{cmd:c(n.verb==="design"||n.verb==="evolve"?"design":"extract",n.sid,!0),why:"goes on with that session where it stopped"}]}:{}}))};case"ended":return{type:"session_ended",sid:e.sid,reason:e.reason};case"not_ended":{let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"error",code:"SESSION_NOT_ENDED",message:`${v(e.project)} didn't take this session's last step; the work is safe in the session`,...n!==null?{next:[{cmd:n,why:"ends the session, so it can be saved"}]}:{}}}case"finished_before":return{type:"session_complete",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},next:[q(e.sid)]}}}function ce(e,t,s={}){return{type:"session_complete",sid:e,...s.sourceId?{source_id:s.sourceId}:{},...s.noStartPage?.length?{no_start_page:s.noStartPage}:{},...t?{next:[q(e),{cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away what this session added"}]}:{}}}var J=e=>e.notUpdated?[`not updated: ${e.notUpdated}`]:[],k={connection_lost:"lost connection",computer_slept:"this computer slept for over 2 minutes",resumed_elsewhere:"resumed in another terminal",not_accepted:"something couldn't be added to this session",ctrl_c:"ctrl+c",model_unavailable:"the model service did not answer",unexpected:"stopped unexpectedly"},w=e=>e.added===0?[]:[e.verb==="extract"?`${e.added} use-case${e.added===1?"":"s"} added, not saved yet`:`${e.added} added, not saved yet`],u=e=>e.credits?[e.credits]:[],m=e=>e.tracePath?{tracePath:e.tracePath}:{};function pe(e){let t=c(e.verb,e.sid,!1),s=e.reason==="resumed_elsewhere"?["this session goes on in the other terminal; your work is safe",...w(e),"to bring it back here, resume it (the other terminal then stops)",...u(e)]:["your work is safe \u2014 resume it from any machine",...w(e),...u(e)];return{state:"paused",reason:k[e.reason],facts:s,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function he(e,t){if(e)return{kind:"ingest",refs:e};let s=[...new Set((t?.uploads??[]).filter(r=>r.outcome==="created"&&!r.filename).map(r=>r.sourceId))],n=t?D(t):[];return n.length+s.length>0?{kind:"resumed",files:n,unnamed:s}:{kind:"extract"}}var H=e=>`discard: kane-cli context sessions discard ${e}`;function fe(e){let t=e.again,s=t.kind==="extract"?[H(e.sid),"then start again: kane-cli context extract"]:["start again with the same sources:",...t.kind==="ingest"?[` ${y(t.refs)}`]:t.files.length>0?[` ${y(t.files)}`]:[],...t.kind==="resumed"?t.unnamed.map(n=>` ${g.dim(`${t.files.length>0?"and ":""}the source "${n}", added again by its address`)}`):[],H(e.sid)];return{state:"paused",reason:e.reason==="held_back"?"the duplicate check couldn't run fully":k[e.reason],facts:[`this session read ${e.sources} sources, so it can't be resumed or saved`,...e.added>0?[`its ${e.added} use-case${e.added===1?"":"s"} won't reach the project`]:[],...s,...u(e)],...m(e)}}function ye(e,t){let s={cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away this session"};if(t.kind==="extract")return{next:[s,{cmd:"kane-cli context extract --mode agent",why:"start again"}]};let n=t.kind==="ingest"?t.refs:t.files;return{next:[...n.length>0?[{cmd:`${y(n)} --mode agent`,why:"start again"}]:[],s],...t.kind==="resumed"&&t.unnamed.length>0?{not_named:[...t.unnamed]}:{}}}var ve=e=>e.filter(t=>t.kind==="header"&&t.source!==void 0).length;function xe(e){let t=c(e.verb,e.sid,!1);return{state:"paused",reason:"the duplicate check couldn't run fully",facts:[e.added>0?"what was added is safe \u2014 resume it from any machine":"nothing was added yet \u2014 resume it from any machine",...w(e),`${e.held} use-case${e.held===1?"":"s"} held back, not added`,...u(e)],resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}var X=e=>e.verb==="evolve"&&e.replaces?`designing its ${e.replaces===1?"test":`${e.replaces} tests`} again didn't finish`:"designing its tests didn't finish";function Se(e){let t=c("extract",e.sid,!1),s=a=>a===1?"1 change":`${a} changes`,n=[...(e.replaced?.scenarios??0)>0?[e.replaced.scenarios===1?"1 scenario":`${e.replaced.scenarios} scenarios`]:[],...(e.replaced?.tests??0)>0?[e.replaced.tests===1?"1 test":`${e.replaced.tests} tests`]:[]],r=n.length>0?`, ${n.join(" and ")} replaced`:"",o=[e.decided>0?"what you decided is safe \u2014 resume it from any machine":"nothing was decided yet \u2014 resume it from any machine",...e.approved>0?[`${s(e.approved)} approved${r}, not saved yet`]:[],...e.unfinished?[X(e.unfinished)]:[],...e.left>0?[`${s(e.left)} not reviewed yet`]:[],...u(e)];return{state:"paused",reason:e.unfinished||e.left===0?k[e.why??"ctrl_c"]:`${s(e.left)} from ${W(e.source)} ${e.left===1?"isn't":"aren't"} reviewed yet`,facts:o,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function _e(e){let[t,...s]=e.how==="saved"?["saved from another terminal",`saved to "${e.projectName}" from another terminal`]:e.how==="discarded"?["discarded from another terminal",`discarded from another terminal \u2014 nothing was saved to "${e.projectName}"`]:["ended in another terminal","this session ended in another terminal, so it stops here","to see your sessions, run: kane-cli context sessions"];return{state:"complete",reason:t,facts:[...s,...u(e)],...m(e)}}function Q(e){let t=[e.adds,e.heldChanges?A(e.heldChanges):""].filter(Boolean);return t.length>0?C(t):$({...e,adds:e.adds})?h:p}function be(e,t){let n=`${e===h||e===p||e.startsWith("1 ")&&!e.includes(", ")&&!e.includes(" and ")?"it's":"they're"} thrown away`;return t===void 0?`${n}, and this can't be undone`:`${n}; nothing reaches "${t}", and this can't be undone`}function $e(e){let{heldChanges:t,chatTurns:s,uncounted:n}=e;return{heldChanges:t,chatTurns:s,uncounted:n,...Object.fromEntries(f.map(r=>[r,e[r]])),...e.replaces?{replaces:e.replaces}:{},...e.keeps?{keeps:e.keeps}:{}}}function we(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${e.changed??Q(e)}`,...e.changed?[]:b(e),...J(e),...e.needed??[],"kept as it is until you save or discard it",`save: kane-cli context sessions save ${e.sid}`,`discard: kane-cli context sessions discard ${e.sid}`,...u(e)],...m(e)}}function ke(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${Q(e)}`,...b(e),`${v(e.projectName)} didn't take this session's last step; your work is safe`,`save: ${c(e.verb,e.sid,!1)}`,...u(e)],...m(e)}}var z=(e,t)=>e||($({...t,adds:e})?h:O({...t,adds:e})?p:"");function Re(e){let t=z(e.adds,e);return{state:"complete",reason:"saved",facts:[`saved to "${e.projectName}"${t?`: ${t}`:""}`,..._(e),...e.heldChanges?[M(e.heldChanges)]:[],...J(e),...e.testManager?[e.testManager]:[],...e.testManagerNextRun?[e.testManagerNextRun]:[],...e.testFiles?[e.testFiles]:[],...e.testFilesKept?[e.testFilesKept]:[],...e.testFilesReplaced?[e.testFilesReplaced]:[],...e.testFilesNeeded??[],...u(e)],...m(e)}}var je=e=>_(e);function Ce(e,t,s={}){let n=z(t,s);return`\u2714 saved to "${e}"${n?` \u2014 ${n}`:""}`}function Ee(e,t){return e?.facts.find(s=>s.startsWith("credits used:"))??(t?`credits used: ${t.total.toFixed(1)}`:null)}var Z=4;function ee(e,t){let s=e.map(r=>({sid:r.sessionId,verb:r.verb,subject:r.useCase??r.sourceId,title:(r.useCase?r.useCaseTitle:r.sourceTitle)??null,state:j(r),added:null,last_activity_at:r.lastActivityAt??r.createdAt,owner:K(r,t)})),n=r=>Date.parse(r.last_activity_at??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||n(o)-n(r))}var te={reconcile:"review"},se={ready_to_save:"ready to save",paused:"paused",running:"running",saved:"saved",discarded:"discarded",failed:"ended with an error"};function ne(e,t){let s=Date.parse(e??"");if(Number.isNaN(s))return"";let n=Math.floor((t-s)/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let r=new Date(s),o=a=>a.toDateString(),i=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return o(r)===o(new Date(t))?`${Math.floor(n/60)} h ago`:o(r)===o(new Date(t-864e5))?`yesterday ${i}`:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")} ${i}`}function re(e,t){return e.length===0?["no open sessions"]:e.flatMap(s=>{let n=s.title?`"${s.title}"`:s.subject&&R(s.subject),r=[...s.added?[`${s.added} added`]:[],...s.updated?[`${s.updated} updated`]:[]],o=[te[s.verb]??s.verb,...n?[n]:[],se[s.state],...r,ne(s.last_activity_at,t),...s.owner==="someone_else"?["someone else"]:[]],i=`${s.sid} ${o.filter(Boolean).join(" \xB7 ")}`;return s.owner==="someone_else"?[i]:s.state==="ready_to_save"?[i,g.dim(` save: kane-cli context sessions save ${s.sid}`)]:s.state==="paused"?[i,g.dim(` resume: ${c(s.verb==="design"||s.verb==="evolve"?"design":"extract",s.sid,!1)}`)]:[i]})}async function Ie(e){let t=await e.person.listSessions(e.projectId),s=await ae(e.person,e.projectId,ee(t,e.me).filter(n=>n.state!=="saved"&&n.state!=="discarded"),e.log??(()=>{}));return e.out(e.json?JSON.stringify(s)+`
3
3
  `:re(s,Date.now()).join(`
4
4
  `)+`
5
5
  `),0}async function ae(e,t,s,n){let r=s.map(a=>({...a})),o=0,i=async()=>{for(let a=o++;a<r.length;a=o++){let l=r[a].sid,d=await N(e,t,l).catch(x=>(n(`${l}'s count couldn't be read: ${U(x)}`),null));r[a].added=d?P(d):null,d&&(r[a].updated=E(d))}};return await Promise.all(Array.from({length:Math.min(Z,r.length)},i)),r}export{de as a,ce as b,pe as c,he as d,fe as e,ye as f,ve as g,xe as h,Se as i,_e as j,Q as k,be as l,$e as m,we as n,ke as o,Re as p,je as q,Ce as r,Ee as s,se as t,ne as u,Ie as v};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as g}from"./chunk-FAMQ4DHU.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
2
+ import{b as g}from"./chunk-J4FIESTB.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
3
3
  `),f(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let i=this.readConfig();i.active_profile=t,this.writeConfig(i)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let i=this.readConfig();i.default_env=t,this.writeConfig(i)}credentialsPath(t,i){return n(this.profilesDir,t,i,"credentials")}clientPath(t,i){return n(this.profilesDir,t,i,"client.json")}basicAuthPath(t,i){return n(this.profilesDir,t,i,"basic-auth")}profileConfigPath(t,i){return n(this.profilesDir,t,i,"profile-config.json")}saveProfileConfig(t,i,r){let e=this.loadProfileConfig(t,i)??{};this.writeSecure(this.profileConfigPath(t,i),{...e,...r})}loadProfileConfig(t,i){try{return JSON.parse(o(this.profileConfigPath(t,i),"utf-8"))}catch{return null}}writeSecure(t,i){try{u(P(t),{recursive:!0,mode:448}),h(t,JSON.stringify(i,null,2)+`
4
4
  `),f(t,384)}catch(r){let e=r instanceof Error?r.message:String(r);process.stderr.write(`[auth] Failed to save credentials: ${e}
5
5
  `)}}saveCredentials(t,i,r){this.writeSecure(this.credentialsPath(t,i),r)}loadCredentials(t,i){try{return JSON.parse(o(this.credentialsPath(t,i),"utf-8"))}catch{return null}}saveClient(t,i,r){this.writeSecure(this.clientPath(t,i),r)}loadClient(t,i){try{return JSON.parse(o(this.clientPath(t,i),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let i=this.getDefaultEnv();return{credentials:this.loadCredentials(t,i),profile:t,env:i}}saveBasicAuth(t,i,r){this.writeSecure(this.basicAuthPath(t,i),r)}loadBasicAuth(t,i){try{return JSON.parse(o(this.basicAuthPath(t,i),"utf-8"))}catch{return null}}deleteBasicAuth(t,i){try{s(this.basicAuthPath(t,i))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let i=this.getDefaultEnv(),r=this.loadBasicAuth(t,i);return r?{method:"basic",...r,profile:t,env:i}:this.loadCredentials(t,i)?{method:"oauth",profile:t,env:i}:null}listProfiles(){let t=[];try{for(let i of a(this.profilesDir)){let r=n(this.profilesDir,i);try{for(let e of a(r)){let c=n(r,e),v=l(n(c,"credentials")),p=l(n(c,"client.json")),y=l(n(c,"basic-auth"));(v||p||y)&&t.push({profile:i,env:e})}}catch{}}}catch{}return t}deleteProfile(t,i){try{s(this.credentialsPath(t,i))}catch{}if(this.getActiveProfile()===t){let r=this.readConfig();delete r.active_profile,this.writeConfig(r)}}deleteProfileFull(t,i){if(i){try{s(this.credentialsPath(t,i))}catch{}try{s(this.clientPath(t,i))}catch{}try{s(this.basicAuthPath(t,i))}catch{}try{s(this.profileConfigPath(t,i))}catch{}}else try{let r=n(this.profilesDir,t);for(let e of a(r)){try{s(n(r,e,"credentials"))}catch{}try{s(n(r,e,"client.json"))}catch{}try{s(n(r,e,"basic-auth"))}catch{}try{s(n(r,e,"profile-config.json"))}catch{}}}catch{}}};export{d as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as l}from"./chunk-OKA6FPJM.js";import{a as m}from"./chunk-FI2DVNRT.js";import{a as p}from"./chunk-RZ4F3BHX.js";import{a as f}from"./chunk-K75WIRI5.js";import{a as c,b as s,h as a,y as u}from"./chunk-FAMQ4DHU.js";var v="/public/skills/kane-cli";function C(){try{let n=new f().getDefaultEnv();if(n in u)return n}catch{}return"prod"}function k(){return`${m(C()).controllerBaseUrl}${v}`}import{readFileSync as S,writeFileSync as E,mkdirSync as g}from"fs";import{join as d}from"path";var h=d(s,"skill-check.json"),y=3600*1e3;function V(){try{let n=JSON.parse(S(h,"utf-8"));if(Date.now()-n.checkedAt<y)return n}catch{}return null}function A(n){try{g(s,{recursive:!0}),E(h,JSON.stringify({map:n,checkedAt:Date.now()}))}catch{}}function I(){for(let{dir:n}of a)try{let t=S(d(n,"VERSION"),"utf-8").trim();if(t)return t}catch{}return null}function M(n,t){let i=Object.keys(n.versions??{});if(i.length===0)return null;let o=i.slice().sort((r,e)=>l(r,e));for(let r of o){let e=n.versions[r]?.kaneCliMinVersion;if(!e||l(t,e)<=0)return r}return null}async function U(){try{let n=V()?.map;if(!n){let o=new AbortController,r=setTimeout(()=>o.abort(),5e3),e=await p(k(),{headers:{Accept:"application/json"},signal:o.signal});if(clearTimeout(r),!e.ok)return null;n=await e.json(),A(n)}let t=M(n,c);if(!t)return null;let i=I();return i===null?{current:null,latestCompatible:t}:l(i,t)>0?{current:i,latestCompatible:t}:null}catch{return null}}export{k as a,M as b,U as c};
2
+ import{b as l}from"./chunk-Z47ZEFH7.js";import{a as m}from"./chunk-ZCBOHWN3.js";import{a as p}from"./chunk-RZ4F3BHX.js";import{a as f}from"./chunk-TM45NPWL.js";import{a as c,b as s,h as a,y as u}from"./chunk-J4FIESTB.js";var v="/public/skills/kane-cli";function C(){try{let n=new f().getDefaultEnv();if(n in u)return n}catch{}return"prod"}function k(){return`${m(C()).controllerBaseUrl}${v}`}import{readFileSync as S,writeFileSync as E,mkdirSync as g}from"fs";import{join as d}from"path";var h=d(s,"skill-check.json"),y=3600*1e3;function V(){try{let n=JSON.parse(S(h,"utf-8"));if(Date.now()-n.checkedAt<y)return n}catch{}return null}function A(n){try{g(s,{recursive:!0}),E(h,JSON.stringify({map:n,checkedAt:Date.now()}))}catch{}}function I(){for(let{dir:n}of a)try{let t=S(d(n,"VERSION"),"utf-8").trim();if(t)return t}catch{}return null}function M(n,t){let i=Object.keys(n.versions??{});if(i.length===0)return null;let o=i.slice().sort((r,e)=>l(r,e));for(let r of o){let e=n.versions[r]?.kaneCliMinVersion;if(!e||l(t,e)<=0)return r}return null}async function U(){try{let n=V()?.map;if(!n){let o=new AbortController,r=setTimeout(()=>o.abort(),5e3),e=await p(k(),{headers:{Accept:"application/json"},signal:o.signal});if(clearTimeout(r),!e.ok)return null;n=await e.json(),A(n)}let t=M(n,c);if(!t)return null;let i=I();return i===null?{current:null,latestCompatible:t}:l(i,t)>0?{current:i,latestCompatible:t}:null}catch{return null}}export{k as a,M as b,U as c};
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as V,e as P,f as Ve,k as He}from"./chunk-S7XCOBYD.js";import{b as Pe}from"./chunk-HM6LZ2KM.js";import{j as Oe,k as X}from"./chunk-LXCTV75T.js";import{h as Y}from"./chunk-NVD2MXHQ.js";import{e as Re}from"./chunk-VE4HLIGA.js";import{e as ge,i as he}from"./chunk-XMPTFXPW.js";import{a as ee,b as Se,c as _e}from"./chunk-32HED7X2.js";import{a as Me,b as Ue,c as De,d as te,g as Ce,m as ne,n as G,o as Ae,p as se,q as Be,r as je,s as re,t as Fe,u as Ge}from"./chunk-3YIA3DSL.js";import{e as Te}from"./chunk-3V4J65GN.js";import{c as Ne,h as Ee}from"./chunk-ZDCXWEQG.js";import{j as Le,k as $e}from"./chunk-L3BUPFAQ.js";import{f as xe,g as q,j as Z,n as ve}from"./chunk-Z24SD2EJ.js";import{j as ke}from"./chunk-REKHAN53.js";import{b as F}from"./chunk-CQDCNP7V.js";import{b as Q}from"./chunk-W2HRX3DR.js";import{B as we,Ha as m,f as pe,p as Ie,w as be}from"./chunk-H4TIVILC.js";import{a as E,e as ye}from"./chunk-4C7WVQOD.js";import{j as J}from"./chunk-PI7OXS62.js";import{d as j}from"./chunk-DBMW3VUN.js";import{a as me}from"./chunk-FOJHSG5M.js";import{existsSync as oe,readFileSync as ae,statSync as H}from"fs";import{basename as de,extname as K}from"path";var ie=1024*1024,qe=1e3,Ze=e=>12e4+Math.ceil(e/ie)*1e3,v=e=>e>=ie?`${(e/ie).toFixed(1).replace(/\.0$/,"")} MB`:`${Math.max(1,Math.round(e/1024))} KB`,et=e=>new Promise(i=>setTimeout(i,e)),tt=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)&&!oe(e);async function Ke(e,i,s,l){let o=new Map(l.map(a=>[a.sourceId,a.head])),d=[];for(let a of s){let r=o.get(a.sourceId);(r?await e.mainNode(i,r).then(f=>f.content.blob,()=>null):null)!==F(a.bytes)&&d.push(a)}return d}var nt=new Set(["KIND_MISMATCH","SITE_MOVED","UUID_MOVED","WEB_URL_CHANGED"]);function T(e){let i=e.code==="PLUGIN_HOOK_FAILED"||e.code==="PLUGIN_HOOK_TIMEOUT";return{refusal:{code:e.code,message:e.message,remedy:e.remedy??"check the source, then run the command again",...i?{support:!0}:{}},exit:i?1:2}}async function st(e,i,s){let l=i.plugin.manifest.id,o=ee(e),d;try{d=await _e(i.plugin,"claim",j.hookMs,()=>i.plugin.claim({ref:i.ref,named:i.named,isFile:o}))}catch(t){if(t instanceof Ne)return T(t.refusal);throw t}if(d==null)return T({code:"PLUGIN_NOT_CLAIMED",message:`plugin ${l} does not read ${i.ref}`,remedy:i.named?`drop the ${l}: prefix, or name the plugin that reads it`:"ingest it as a file of a built-in kind"});let a=d.sourceId;if(typeof a!="string")return T({code:"PLUGIN_HOOK_FAILED",message:`plugin ${l} answered claim with something that is not a claim`});let r=s??a;if(!Se(r))return T({code:"PLUGIN_SOURCE_ID_INVALID",message:`${JSON.stringify(r)} is not an id a source may have: it starts with a letter or digit and holds letters, digits and . _ -, at most 128 characters`,remedy:s===void 0?"give the source an id with --as <id>":"give another id with --as <id>"});let y={id:l,ref:i.ref,named:i.named,isFile:o},f=v(j.contentBytes);if(!o)return{item:{kind:"file",path:e,node:`ref:${e}`,file:e,bytes:Buffer.alloc(0),sourceId:r,limit:f,plugin:y}};let I=de(e),c;try{c=ae(e)}catch{return{refusal:m.ingestCantOpen(I),exit:2}}if(c.byteLength>j.contentBytes)return{refusal:m.ingestTooLarge(I,v(c.byteLength),f),exit:2};let{dev:u,ino:p}=H(e);return{item:{kind:"file",path:e,node:`${u}:${p}`,file:I,bytes:c,sourceId:r,limit:f,plugin:y}}}var S=e=>e.kind==="file"?e.path:e.address;function We(e){if(e.provider.name==="web")return`web|${e.sourceId}`;let i=new URL(e.address),s=e.provider.name.startsWith("linear")?`${i.host}/${i.pathname.split("/")[1]??""}`:i.host;return`${e.provider.name}|${s.toLowerCase()}|${e.sourceId}`}var rt=(e,i)=>e.kind==="file"?i.kind==="file"&&e.node===i.node:i.kind==="link"&&We(e)===We(i);async function it(e,i,s){let l=new Map;for(let t of e)l.set(t.sourceId,[...l.get(t.sourceId)??[],t]);let o=[...l.values()].filter(t=>t.length>1);if(o.length===0)return null;let d=i?.map(t=>t.sourceId)??null,a=new Set(o.flatMap(t=>t.slice(1))),r=new Set([...l.keys(),...d??[]]),y=t=>{if(d===null)return null;let R=2;for(;r.has(`${t}-${R}`);)R++;return r.add(`${t}-${R}`),`${t}-${R}`},f=t=>t.kind==="file"?t.path:te(t.provider.name,t.address),I=new Set(i?.filter(t=>t.head!==null).map(t=>t.sourceId)),c=e.filter(t=>!a.has(t)&&I.has(t.sourceId)),u=await s(c.flatMap(t=>t.kind==="file"?[t]:[])),p=e.filter(t=>!a.has(t)&&!u.includes(t));return je(o.map(t=>({names:t.map(f),id:t[0].sourceId})),p.map(S),e.filter(t=>a.has(t)).map(t=>({ref:S(t),as:y(t.sourceId),place:l.get(t.sourceId).indexOf(t)+1})),{reviews:u.flatMap(t=>t.kind==="file"?[{name:t.file,ref:t.path,id:t.sourceId}]:[]),link:c.some(t=>t.kind==="link"),firstTwin:p.some(t=>l.get(t.sourceId).length>1)})}async function Ft(e){try{return await ot(e)}finally{await be()}}async function ot(e){let i=e.mode==="agent",s=n=>i?ke(ge("ndjson",n,e.testing?.agentLines?{stdout:e.testing.agentLines,stderr:()=>{}}:void 0),{atQuestionsOnly:!0}):null,l=s("extract");l&&e.choice.onboarded&&l.event({type:"folder_linked",project_id:e.choice.projectId,project:e.choice.projectName});let o=(n,h,g=!1,O=l)=>O?(O.event({type:"error",code:n.code,message:n.message,...we(n),...n.notAdded?{not_added:n.notAdded}:{}}),O.done(h,"refused")):(g&&e.choice.onboarded?process.stdout.write(`${Oe(e.choice.projectName)}
2
+ import{d as V,e as P,f as Ve,k as He}from"./chunk-7SU53QGU.js";import{b as Pe}from"./chunk-6HRNG4CK.js";import{j as Oe,k as X}from"./chunk-4CJQ7XZP.js";import{h as Y}from"./chunk-3RO2YGKH.js";import{e as Re}from"./chunk-NI3TIAD7.js";import{e as ge,i as he}from"./chunk-XMPTFXPW.js";import{a as ee,b as Se,c as _e}from"./chunk-32HED7X2.js";import{a as Me,b as Ue,c as De,d as te,g as Ce,m as ne,n as G,o as Ae,p as se,q as Be,r as je,s as re,t as Fe,u as Ge}from"./chunk-X2MDL6S4.js";import{e as Te}from"./chunk-LRNUGKYH.js";import{c as Ne,h as Ee}from"./chunk-ZDCXWEQG.js";import{j as Le,k as $e}from"./chunk-L3BUPFAQ.js";import{f as xe,g as q,j as Z,n as ve}from"./chunk-Z24SD2EJ.js";import{j as ke}from"./chunk-REKHAN53.js";import{b as F}from"./chunk-CQDCNP7V.js";import{b as Q}from"./chunk-EBJW6POT.js";import{B as we,Ha as m,f as pe,p as Ie,w as be}from"./chunk-WE7HRAGO.js";import{a as E,e as ye}from"./chunk-4C7WVQOD.js";import{j as J}from"./chunk-PI7OXS62.js";import{d as j}from"./chunk-DBMW3VUN.js";import{a as me}from"./chunk-FOJHSG5M.js";import{existsSync as oe,readFileSync as ae,statSync as H}from"fs";import{basename as de,extname as K}from"path";var ie=1024*1024,qe=1e3,Ze=e=>12e4+Math.ceil(e/ie)*1e3,v=e=>e>=ie?`${(e/ie).toFixed(1).replace(/\.0$/,"")} MB`:`${Math.max(1,Math.round(e/1024))} KB`,et=e=>new Promise(i=>setTimeout(i,e)),tt=e=>/^[a-z][a-z0-9+.-]*:/i.test(e)&&!oe(e);async function Ke(e,i,s,l){let o=new Map(l.map(a=>[a.sourceId,a.head])),d=[];for(let a of s){let r=o.get(a.sourceId);(r?await e.mainNode(i,r).then(f=>f.content.blob,()=>null):null)!==F(a.bytes)&&d.push(a)}return d}var nt=new Set(["KIND_MISMATCH","SITE_MOVED","UUID_MOVED","WEB_URL_CHANGED"]);function T(e){let i=e.code==="PLUGIN_HOOK_FAILED"||e.code==="PLUGIN_HOOK_TIMEOUT";return{refusal:{code:e.code,message:e.message,remedy:e.remedy??"check the source, then run the command again",...i?{support:!0}:{}},exit:i?1:2}}async function st(e,i,s){let l=i.plugin.manifest.id,o=ee(e),d;try{d=await _e(i.plugin,"claim",j.hookMs,()=>i.plugin.claim({ref:i.ref,named:i.named,isFile:o}))}catch(t){if(t instanceof Ne)return T(t.refusal);throw t}if(d==null)return T({code:"PLUGIN_NOT_CLAIMED",message:`plugin ${l} does not read ${i.ref}`,remedy:i.named?`drop the ${l}: prefix, or name the plugin that reads it`:"ingest it as a file of a built-in kind"});let a=d.sourceId;if(typeof a!="string")return T({code:"PLUGIN_HOOK_FAILED",message:`plugin ${l} answered claim with something that is not a claim`});let r=s??a;if(!Se(r))return T({code:"PLUGIN_SOURCE_ID_INVALID",message:`${JSON.stringify(r)} is not an id a source may have: it starts with a letter or digit and holds letters, digits and . _ -, at most 128 characters`,remedy:s===void 0?"give the source an id with --as <id>":"give another id with --as <id>"});let y={id:l,ref:i.ref,named:i.named,isFile:o},f=v(j.contentBytes);if(!o)return{item:{kind:"file",path:e,node:`ref:${e}`,file:e,bytes:Buffer.alloc(0),sourceId:r,limit:f,plugin:y}};let I=de(e),c;try{c=ae(e)}catch{return{refusal:m.ingestCantOpen(I),exit:2}}if(c.byteLength>j.contentBytes)return{refusal:m.ingestTooLarge(I,v(c.byteLength),f),exit:2};let{dev:u,ino:p}=H(e);return{item:{kind:"file",path:e,node:`${u}:${p}`,file:I,bytes:c,sourceId:r,limit:f,plugin:y}}}var S=e=>e.kind==="file"?e.path:e.address;function We(e){if(e.provider.name==="web")return`web|${e.sourceId}`;let i=new URL(e.address),s=e.provider.name.startsWith("linear")?`${i.host}/${i.pathname.split("/")[1]??""}`:i.host;return`${e.provider.name}|${s.toLowerCase()}|${e.sourceId}`}var rt=(e,i)=>e.kind==="file"?i.kind==="file"&&e.node===i.node:i.kind==="link"&&We(e)===We(i);async function it(e,i,s){let l=new Map;for(let t of e)l.set(t.sourceId,[...l.get(t.sourceId)??[],t]);let o=[...l.values()].filter(t=>t.length>1);if(o.length===0)return null;let d=i?.map(t=>t.sourceId)??null,a=new Set(o.flatMap(t=>t.slice(1))),r=new Set([...l.keys(),...d??[]]),y=t=>{if(d===null)return null;let R=2;for(;r.has(`${t}-${R}`);)R++;return r.add(`${t}-${R}`),`${t}-${R}`},f=t=>t.kind==="file"?t.path:te(t.provider.name,t.address),I=new Set(i?.filter(t=>t.head!==null).map(t=>t.sourceId)),c=e.filter(t=>!a.has(t)&&I.has(t.sourceId)),u=await s(c.flatMap(t=>t.kind==="file"?[t]:[])),p=e.filter(t=>!a.has(t)&&!u.includes(t));return je(o.map(t=>({names:t.map(f),id:t[0].sourceId})),p.map(S),e.filter(t=>a.has(t)).map(t=>({ref:S(t),as:y(t.sourceId),place:l.get(t.sourceId).indexOf(t)+1})),{reviews:u.flatMap(t=>t.kind==="file"?[{name:t.file,ref:t.path,id:t.sourceId}]:[]),link:c.some(t=>t.kind==="link"),firstTwin:p.some(t=>l.get(t.sourceId).length>1)})}async function Ft(e){try{return await ot(e)}finally{await be()}}async function ot(e){let i=e.mode==="agent",s=n=>i?ke(ge("ndjson",n,e.testing?.agentLines?{stdout:e.testing.agentLines,stderr:()=>{}}:void 0),{atQuestionsOnly:!0}):null,l=s("extract");l&&e.choice.onboarded&&l.event({type:"folder_linked",project_id:e.choice.projectId,project:e.choice.projectName});let o=(n,h,g=!1,O=l)=>O?(O.event({type:"error",code:n.code,message:n.message,...we(n),...n.notAdded?{not_added:n.notAdded}:{}}),O.done(h,"refused")):(g&&e.choice.onboarded?process.stdout.write(`${Oe(e.choice.projectName)}
3
3
  `):e.mode==="interactive"&&process.stdout.write(`
4
4
  `),X(n),process.stdout.write(`
5
- `),h),d=(n,h)=>o(n,h,!0),a=(n,h)=>h.length>0?{...n,detail:Fe(h.map(g=>g.name)),notAdded:h.map(g=>g.ref)}:n;if(e.opts.plan)return d(m.notYet("context ingest --plan"),2);if(e.opts.as!==void 0&&e.paths.length>1)return d(Be(e.paths),2);let r=[],y=n=>{r.some(h=>rt(h,n))||r.push(n)},f=q.flatMap(n=>n.extensions).join(" ");for(let n of e.paths){let h=r.map(k=>({name:k.kind==="file"?k.file:te(k.provider.name,k.address),ref:S(k)})),g=(k,Ye)=>d(a(k,h),Ye),O=Ee().route(n,ee);if(O!==null){let k=await st(n,O,e.opts.as);if("refusal"in k)return g(k.refusal,k.exit);y(k.item);continue}if(Le(n)){let k=$e(n);if(!k?.fetch)return g(se(n),2);if(e.opts.as!==void 0&&!J(e.opts.as))return g(m.ingestBadSourceId(e.opts.as),2);y({kind:"link",address:n,provider:k,sourceId:e.opts.as??k.sourceIdFor(n)??n});continue}if(tt(n))return g(se(n),2);let w=de(n),L=Z(n);if(!L.ok)return g(m.ingestUnsupported(`${w} is a file type kane can't ingest (${K(n)||"no extension"}) \u2014 supported: ${f}`),2);if(!oe(n)||!H(n).isFile())return g(m.ingestNoFile(n),2);let D;try{D=ae(n)}catch{return g(m.ingestCantOpen(w),2)}if(D.byteLength>L.media.maxBytes)return g(m.ingestTooLarge(w,v(D.byteLength),v(L.media.maxBytes)),2);if(L.media.sniff&&!L.media.sniff(D))return g(m.ingestNotItsType(w,K(n).slice(1)),2);if(e.opts.as!==void 0&&!J(e.opts.as))return g(m.ingestBadSourceId(e.opts.as),2);let fe;try{fe=e.opts.as??ve(n)}catch{return g(m.ingestNoSourceId(w),2)}let{dev:Je,ino:Qe}=H(n);y({kind:"file",path:n,node:`${Je}:${Qe}`,file:w,bytes:D,sourceId:fe,limit:v(L.media.maxBytes)})}let I=r[0],c;try{c=e.testing?.basicAuth??await Re()}catch(n){if(!(n instanceof he))throw n;return d({code:n.code,message:n.message,...n.remedy?{remedy:n.remedy}:{}},2)}let u=pe({url:e.choice.latticeUrl,basicAuth:c,...e.testing?.run?.fetch?{fetch:e.testing.run.fetch}:{}}),p=e.choice.projectId,t=null,R=null;try{t=await u.sources(p)}catch(n){n instanceof E&&(n.code==="NO_CONTEXT"||n.code==="NOT_FOUND")?t=[]:R=n}let b=await it(r,t,n=>Ke(u,p,n,t??[]));if(b)return d(b,2);if(t===null){let{exit:n,...h}=Pe(R,e.choice,null);return d(h,n)}let x=new Set(t.filter(n=>n.head!==null).map(n=>n.sourceId)),$=r.filter(n=>x.has(n.sourceId)),N=$.flatMap(n=>n.kind==="file"?[n]:[]);if(r.length>1&&N.length>0&&N.length===$.length){let n=await Ke(u,p,N,t);if(n.length>0){let h=n.map(g=>({name:g.file,ref:S(g),id:g.sourceId}));return d(re(h,r.filter(g=>!n.includes(g)).map(S),e.choice.projectName),2)}}let M=r.length===1?$[0]:void 0;if(M){let{reviewNewVersion:n}=await import("./reconcile-remote-6WISFGRG.js"),h=e.mode==="interactive";h&&!e.choice.onboarded&&process.stdout.write(`using project "${e.choice.projectName}", shared with your team
6
- `);let g=s("reconcile");return n({choice:e.choice,person:u,basicAuth:c,item:M,...e.opts.as!==void 0?{as:e.opts.as}:{},supported:f,mode:e.mode==="agent"?"agent":h?"interactive":"ci",io:g,refuse:(O,w=2)=>o(O,w,!1,g),projectLine:h,nothing:(O,w)=>`${h?` ${me.green("\u2714")} `:""}${O} is already in "${w}", unchanged`,...e.testing?{testing:e.testing}:{}})}let C=e.testing?.run?.retryDeadlineMs??12e4,ze=dt(e.testing?.remoteDeps),le=[],_=r.map((n,h)=>{let g=at({person:u,choice:e.choice,item:n,first:h===0,then:e.mode==="ci"?"pause":"extract",...e.opts.as!==void 0?{as:e.opts.as}:{},supported:f,retryMs:C,remoteDeps:ze,refusal:O=>a(O,_.slice(0,h).map(w=>({name:w.name??w.file,ref:w.path??w.file}))),alone:O=>re(O.map(w=>{let L=_[w].remote;return{name:_[w].name??_[w].file,ref:S(r[w]),id:r[w].sourceId,...L?{shown:Te({source:r[w].sourceId,page:Ce({...L,address:L.origin.url})})}:{}}}),r.filter((w,L)=>!O.includes(L)).map(S),e.choice.projectName),...e.testing?{testing:e.testing}:{}});return le.push(g.ended),g.step}),ce={verb:"extract",choice:e.choice,start:{kind:"new",body:{projectId:p,verb:"extract",mode:e.mode==="interactive"?"interactive":"agent",sourceId:I.sourceId}},run:{source:I.sourceId,...e.opts.force?{force:!0}:{},...e.opts.trust!==void 0?{trust:e.opts.trust}:{}}},A=e.testing?.remoteDeps?{...e.testing.run,remoteDeps:e.testing.remoteDeps}:e.testing?.run,U;if(e.mode==="interactive"){let{runInteractiveRemote:n}=await import("./interactive-remote-O2Q2FNOH.js");U=await n({...ce,subject:I.kind==="link"?De(I.provider.name,I.address):I.sourceId,ingest:_,testing:{basicAuth:c,...e.testing?.check?{check:e.testing.check}:{},...A?{run:A}:{},...e.testing?.mount?{mount:e.testing.mount}:{},...e.testing?.onController?{onController:e.testing.onController}:{}}})}else U=await He({...ce,mode:"agent",basicAuth:c,io:l,check:e.testing?.check??Ve,onProgress:()=>{},ingest:_,signals:!0,onRefusal:n=>{X(n),process.stdout.write(`
5
+ `),h),d=(n,h)=>o(n,h,!0),a=(n,h)=>h.length>0?{...n,detail:Fe(h.map(g=>g.name)),notAdded:h.map(g=>g.ref)}:n;if(e.opts.plan)return d(m.notYet("context ingest --plan"),2);if(e.opts.as!==void 0&&e.paths.length>1)return d(Be(e.paths),2);let r=[],y=n=>{r.some(h=>rt(h,n))||r.push(n)},f=q.flatMap(n=>n.extensions).join(" ");for(let n of e.paths){let h=r.map(k=>({name:k.kind==="file"?k.file:te(k.provider.name,k.address),ref:S(k)})),g=(k,Ye)=>d(a(k,h),Ye),O=Ee().route(n,ee);if(O!==null){let k=await st(n,O,e.opts.as);if("refusal"in k)return g(k.refusal,k.exit);y(k.item);continue}if(Le(n)){let k=$e(n);if(!k?.fetch)return g(se(n),2);if(e.opts.as!==void 0&&!J(e.opts.as))return g(m.ingestBadSourceId(e.opts.as),2);y({kind:"link",address:n,provider:k,sourceId:e.opts.as??k.sourceIdFor(n)??n});continue}if(tt(n))return g(se(n),2);let w=de(n),L=Z(n);if(!L.ok)return g(m.ingestUnsupported(`${w} is a file type kane can't ingest (${K(n)||"no extension"}) \u2014 supported: ${f}`),2);if(!oe(n)||!H(n).isFile())return g(m.ingestNoFile(n),2);let D;try{D=ae(n)}catch{return g(m.ingestCantOpen(w),2)}if(D.byteLength>L.media.maxBytes)return g(m.ingestTooLarge(w,v(D.byteLength),v(L.media.maxBytes)),2);if(L.media.sniff&&!L.media.sniff(D))return g(m.ingestNotItsType(w,K(n).slice(1)),2);if(e.opts.as!==void 0&&!J(e.opts.as))return g(m.ingestBadSourceId(e.opts.as),2);let fe;try{fe=e.opts.as??ve(n)}catch{return g(m.ingestNoSourceId(w),2)}let{dev:Je,ino:Qe}=H(n);y({kind:"file",path:n,node:`${Je}:${Qe}`,file:w,bytes:D,sourceId:fe,limit:v(L.media.maxBytes)})}let I=r[0],c;try{c=e.testing?.basicAuth??await Re()}catch(n){if(!(n instanceof he))throw n;return d({code:n.code,message:n.message,...n.remedy?{remedy:n.remedy}:{}},2)}let u=pe({url:e.choice.latticeUrl,basicAuth:c,...e.testing?.run?.fetch?{fetch:e.testing.run.fetch}:{}}),p=e.choice.projectId,t=null,R=null;try{t=await u.sources(p)}catch(n){n instanceof E&&(n.code==="NO_CONTEXT"||n.code==="NOT_FOUND")?t=[]:R=n}let b=await it(r,t,n=>Ke(u,p,n,t??[]));if(b)return d(b,2);if(t===null){let{exit:n,...h}=Pe(R,e.choice,null);return d(h,n)}let x=new Set(t.filter(n=>n.head!==null).map(n=>n.sourceId)),$=r.filter(n=>x.has(n.sourceId)),N=$.flatMap(n=>n.kind==="file"?[n]:[]);if(r.length>1&&N.length>0&&N.length===$.length){let n=await Ke(u,p,N,t);if(n.length>0){let h=n.map(g=>({name:g.file,ref:S(g),id:g.sourceId}));return d(re(h,r.filter(g=>!n.includes(g)).map(S),e.choice.projectName),2)}}let M=r.length===1?$[0]:void 0;if(M){let{reviewNewVersion:n}=await import("./reconcile-remote-3W6ZTO3G.js"),h=e.mode==="interactive";h&&!e.choice.onboarded&&process.stdout.write(`using project "${e.choice.projectName}", shared with your team
6
+ `);let g=s("reconcile");return n({choice:e.choice,person:u,basicAuth:c,item:M,...e.opts.as!==void 0?{as:e.opts.as}:{},supported:f,mode:e.mode==="agent"?"agent":h?"interactive":"ci",io:g,refuse:(O,w=2)=>o(O,w,!1,g),projectLine:h,nothing:(O,w)=>`${h?` ${me.green("\u2714")} `:""}${O} is already in "${w}", unchanged`,...e.testing?{testing:e.testing}:{}})}let C=e.testing?.run?.retryDeadlineMs??12e4,ze=dt(e.testing?.remoteDeps),le=[],_=r.map((n,h)=>{let g=at({person:u,choice:e.choice,item:n,first:h===0,then:e.mode==="ci"?"pause":"extract",...e.opts.as!==void 0?{as:e.opts.as}:{},supported:f,retryMs:C,remoteDeps:ze,refusal:O=>a(O,_.slice(0,h).map(w=>({name:w.name??w.file,ref:w.path??w.file}))),alone:O=>re(O.map(w=>{let L=_[w].remote;return{name:_[w].name??_[w].file,ref:S(r[w]),id:r[w].sourceId,...L?{shown:Te({source:r[w].sourceId,page:Ce({...L,address:L.origin.url})})}:{}}}),r.filter((w,L)=>!O.includes(L)).map(S),e.choice.projectName),...e.testing?{testing:e.testing}:{}});return le.push(g.ended),g.step}),ce={verb:"extract",choice:e.choice,start:{kind:"new",body:{projectId:p,verb:"extract",mode:e.mode==="interactive"?"interactive":"agent",sourceId:I.sourceId}},run:{source:I.sourceId,...e.opts.force?{force:!0}:{},...e.opts.trust!==void 0?{trust:e.opts.trust}:{}}},A=e.testing?.remoteDeps?{...e.testing.run,remoteDeps:e.testing.remoteDeps}:e.testing?.run,U;if(e.mode==="interactive"){let{runInteractiveRemote:n}=await import("./interactive-remote-7ZSTI66T.js");U=await n({...ce,subject:I.kind==="link"?De(I.provider.name,I.address):I.sourceId,ingest:_,testing:{basicAuth:c,...e.testing?.check?{check:e.testing.check}:{},...A?{run:A}:{},...e.testing?.mount?{mount:e.testing.mount}:{},...e.testing?.onController?{onController:e.testing.onController}:{}}})}else U=await He({...ce,mode:"agent",basicAuth:c,io:l,check:e.testing?.check??Ve,onProgress:()=>{},ingest:_,signals:!0,onRefusal:n=>{X(n),process.stdout.write(`
7
7
  `)},...A?{testing:A}:{}});let W=le.map(n=>n()),B=[...W].reverse().find(n=>n.sid!==null)?.sid??null,ue=W.flatMap(n=>n.added!==null?[{name:n.name,status:n.added}]:[]),z=W.find(n=>n.refused!==null)?.refused??null;if(z!==null)return o(z.refusal,z.exit);if(e.mode==="ci"&&ue.length>0&&B!==null){let n=ue.map(({name:h,status:g})=>g==="unchanged"?`${h} is already in "${e.choice.projectName}", unchanged`:g==="versioned"?`added a new version of ${h} to session ${B}, not saved yet`:`added ${h} to session ${B}, not saved yet`);return process.stdout.write(`${n.join(`
8
8
  `)}
9
9
  extract: kane-cli context extract --resume ${B}
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as A}from"./chunk-TDPWFYTJ.js";import{b as T}from"./chunk-BHQIH2FE.js";import{d as x}from"./chunk-I52NWH4U.js";import{a as S}from"./chunk-MMBBQ4OZ.js";import{a as y}from"./chunk-TD6GCEIK.js";import{a as m}from"./chunk-FI2DVNRT.js";import{f as R}from"./chunk-A7RJQJNT.js";import{d as g,i as E}from"./chunk-FAMQ4DHU.js";import{spawn as U,execSync as L}from"child_process";import{appendFileSync as P,existsSync as f,mkdirSync as h}from"fs";import{homedir as V}from"os";import{join as D,resolve as s,dirname as v,delimiter as M}from"path";import{fileURLToPath as k}from"url";import{createInterface as I}from"readline";async function*N(e){let n=I({input:e,crlfDelay:1/0});for await(let r of n){let o=r.trim();if(o)try{let i=JSON.parse(o);i&&typeof i.type=="string"&&(yield i)}catch{}}}function O(e){return e==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function w(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function b(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(k(import.meta.url));function B(){for(let e of["python3","python"])try{return L(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function H(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",r={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},o=`${process.platform}-${process.arch}`,i=r[o];if(i)for(let t of i){let a=[s(c,"..","node_modules",t,"bin",n),s(c,"..","..","node_modules",t,"bin",n),s(c,"..","..","..","node_modules",t,"bin",n),s(c,"..","..","..","..","node_modules",t,"bin",n)];for(let u of a)if(f(u))return{cmd:u,args:[]}}let d=[s(c,"bin",n),s(c,"..","bin",n),s(c,"..","..","..","..","v16-runner","dist",n),s(c,"..","..","..","v16-runner","dist",n),s(c,"..","..","v16-runner","dist",n),s(process.cwd(),"v16-runner","dist",n),s(process.cwd(),"..","v16-runner","dist",n)];for(let t of d)if(f(t))return{cmd:t,args:[]};let l=[s(c,"..","..","v16-runner"),s(c,"..","..","..","..","v16-runner"),s(c,"..","..","..","v16-runner"),s(process.cwd(),"v16-runner"),s(process.cwd(),"..","v16-runner")];for(let t of l)if(f(s(t,"main.py"))){for(let u of[s(t,".venv","bin","python"),s(t,"..",".venv","bin","python"),s(t,"..","browser-agent",".venv","bin","python")])if(f(u))return{cmd:u,args:["main.py"],cwd:t};let a=B();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function C(e){return e?D(V(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function K(e){let n=U(e.runner.cmd,e.runner.args,{stdio:["pipe","pipe","pipe"],env:e.env,cwd:e.runner.cwd});n.stdin.on("error",()=>{});let r=C(e.sessionId);if(r)try{h(v(r),{recursive:!0})}catch{}let o=1e5,i="";n.stderr.on("data",u=>{if(i+=u.toString(),i.length>o&&(i=i.slice(-o)),r)try{P(r,u)}catch{}}),n.on("error",u=>{e.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:u.message})});let d=null,l=null,t=new Promise(u=>{n.on("close",(p,_)=>{d=p,l=_?String(_):null,e.log?.("info","RUNNER_EXIT","Runner exited",{code:p,signal:l??"none"}),u({code:p,signal:l})})}),a=N(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function G(e,n){if(!n?.platform||!n.target)return;if(R(n.target)){e.TESTMU_RUN_TARGET??="cloud",e.LT_HUB_URL??=m(e.TESTMUAI_ENV==="stage"?"stage":"prod").mobileHubUrl;return}let r=await x(n.platform)?.toolEnv(n.target)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(M)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=S();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(M),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function j(e){let n={...process.env,...y(process.env)};e.environment&&(n.TESTMUAI_ENV=e.environment),n.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(n.PYTHONIOENCODING="utf-8",n.PYTHONUTF8="1");let r=m(e.environment);n.V16_SERVER_API_HOST=r.v16ServerHost,n.ATMS_URL=r.tmsBaseUrl.replace(/\/api\/?$/,""),e.username&&e.accessKey&&(n.LT_USERNAME=e.username,n.LT_ACCESS_KEY=e.accessKey),e.sessionId&&(n.TESTMUAI_SESSION_ID=e.sessionId);let o=O(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new T().load(),d=b(e.assertionMode??(i.assertion_mode==="visual"?"visual":"dom"));Object.assign(n,d.set);for(let a of d.unset)delete n[a];let l=e.finalValidation??i.final_validation,t=w(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function W(e,n){let r=m(n?.environment),o=A();o!==void 0&&e.ap_mode===void 0&&(e.ap_mode=o),e.telemetry_proxy_url===void 0&&process.env.KANE_TELEMETRY!=="0"&&(e.telemetry_proxy_url=E),e.media_upload===void 0&&e.org_id&&e.username&&e.access_key&&(e.media_upload=$(r,e.org_id))}function $(e,n){return{url:e.shareApiBaseUrl.replace(/\/$/,"")+"/mfs/v1.0/media/upload",artefacts_host:e.mediaArtefactsHost,org_id:n,media_dir:g,files_url:e.tmsBaseUrl.replace(/\/api\/?$/,"")}}async function ue(e,n){let r=H();if(!r)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");process.env.KANE_SPAWN_DEBUG&&process.stderr.write(`[spawn-debug] ${JSON.stringify(r)}
2
+ import{a as A}from"./chunk-TDPWFYTJ.js";import{b as T}from"./chunk-LV7224DG.js";import{d as x}from"./chunk-C4KAPGBS.js";import{a as S}from"./chunk-MMBBQ4OZ.js";import{a as y}from"./chunk-TD6GCEIK.js";import{a as m}from"./chunk-ZCBOHWN3.js";import{f as R}from"./chunk-A7RJQJNT.js";import{d as g,i as E}from"./chunk-J4FIESTB.js";import{spawn as U,execSync as L}from"child_process";import{appendFileSync as P,existsSync as f,mkdirSync as h}from"fs";import{homedir as V}from"os";import{join as D,resolve as s,dirname as v,delimiter as M}from"path";import{fileURLToPath as k}from"url";import{createInterface as I}from"readline";async function*N(e){let n=I({input:e,crlfDelay:1/0});for await(let r of n){let o=r.trim();if(o)try{let i=JSON.parse(o);i&&typeof i.type=="string"&&(yield i)}catch{}}}function O(e){return e==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function w(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function b(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(k(import.meta.url));function B(){for(let e of["python3","python"])try{return L(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function H(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",r={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},o=`${process.platform}-${process.arch}`,i=r[o];if(i)for(let t of i){let a=[s(c,"..","node_modules",t,"bin",n),s(c,"..","..","node_modules",t,"bin",n),s(c,"..","..","..","node_modules",t,"bin",n),s(c,"..","..","..","..","node_modules",t,"bin",n)];for(let u of a)if(f(u))return{cmd:u,args:[]}}let d=[s(c,"bin",n),s(c,"..","bin",n),s(c,"..","..","..","..","v16-runner","dist",n),s(c,"..","..","..","v16-runner","dist",n),s(c,"..","..","v16-runner","dist",n),s(process.cwd(),"v16-runner","dist",n),s(process.cwd(),"..","v16-runner","dist",n)];for(let t of d)if(f(t))return{cmd:t,args:[]};let l=[s(c,"..","..","v16-runner"),s(c,"..","..","..","..","v16-runner"),s(c,"..","..","..","v16-runner"),s(process.cwd(),"v16-runner"),s(process.cwd(),"..","v16-runner")];for(let t of l)if(f(s(t,"main.py"))){for(let u of[s(t,".venv","bin","python"),s(t,"..",".venv","bin","python"),s(t,"..","browser-agent",".venv","bin","python")])if(f(u))return{cmd:u,args:["main.py"],cwd:t};let a=B();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function C(e){return e?D(V(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function K(e){let n=U(e.runner.cmd,e.runner.args,{stdio:["pipe","pipe","pipe"],env:e.env,cwd:e.runner.cwd});n.stdin.on("error",()=>{});let r=C(e.sessionId);if(r)try{h(v(r),{recursive:!0})}catch{}let o=1e5,i="";n.stderr.on("data",u=>{if(i+=u.toString(),i.length>o&&(i=i.slice(-o)),r)try{P(r,u)}catch{}}),n.on("error",u=>{e.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:u.message})});let d=null,l=null,t=new Promise(u=>{n.on("close",(p,_)=>{d=p,l=_?String(_):null,e.log?.("info","RUNNER_EXIT","Runner exited",{code:p,signal:l??"none"}),u({code:p,signal:l})})}),a=N(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function G(e,n){if(!n?.platform||!n.target)return;if(R(n.target)){e.TESTMU_RUN_TARGET??="cloud",e.LT_HUB_URL??=m(e.TESTMUAI_ENV==="stage"?"stage":"prod").mobileHubUrl;return}let r=await x(n.platform)?.toolEnv(n.target)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(M)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=S();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(M),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function j(e){let n={...process.env,...y(process.env)};e.environment&&(n.TESTMUAI_ENV=e.environment),n.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(n.PYTHONIOENCODING="utf-8",n.PYTHONUTF8="1");let r=m(e.environment);n.V16_SERVER_API_HOST=r.v16ServerHost,n.ATMS_URL=r.tmsBaseUrl.replace(/\/api\/?$/,""),e.username&&e.accessKey&&(n.LT_USERNAME=e.username,n.LT_ACCESS_KEY=e.accessKey),e.sessionId&&(n.TESTMUAI_SESSION_ID=e.sessionId);let o=O(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new T().load(),d=b(e.assertionMode??(i.assertion_mode==="visual"?"visual":"dom"));Object.assign(n,d.set);for(let a of d.unset)delete n[a];let l=e.finalValidation??i.final_validation,t=w(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function W(e,n){let r=m(n?.environment),o=A();o!==void 0&&e.ap_mode===void 0&&(e.ap_mode=o),e.telemetry_proxy_url===void 0&&process.env.KANE_TELEMETRY!=="0"&&(e.telemetry_proxy_url=E),e.media_upload===void 0&&e.org_id&&e.username&&e.access_key&&(e.media_upload=$(r,e.org_id))}function $(e,n){return{url:e.shareApiBaseUrl.replace(/\/$/,"")+"/mfs/v1.0/media/upload",artefacts_host:e.mediaArtefactsHost,org_id:n,media_dir:g,files_url:e.tmsBaseUrl.replace(/\/api\/?$/,"")}}async function ue(e,n){let r=H();if(!r)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");process.env.KANE_SPAWN_DEBUG&&process.stderr.write(`[spawn-debug] ${JSON.stringify(r)}
3
3
  `);let o=j({environment:n?.environment,mode:n?.mode,assertionMode:n?.assertionMode,finalValidation:n?.finalValidation,username:e.username,accessKey:e.access_key,sessionId:e.session_id});e.device?.platform&&await G(o,e.device),W(e,{environment:n?.environment});let i=K({env:o,runner:r,log:n?.log,sessionId:e.session_id}),d=i.child;d.stdin.write(JSON.stringify(e)+`
4
4
  `);let l=C(e.session_id);if(l)try{h(v(l),{recursive:!0}),P(l,`--- runner spawn ${new Date().toISOString()} run_index=${e.run_index} ---
5
5
  `)}catch{}return{child:d,events:i.events,sendUserResponse(t){let a=JSON.stringify({type:"user_response",answer:t});try{d.stdin.write(a+`